feat: Add new gcloud commands, API clients, and third-party libraries across various services.

This commit is contained in:
2026-01-01 20:26:35 +01:00
parent 5e23cbece0
commit a19e592eb7
25221 changed files with 8324611 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Commands for managing health sources."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.DefaultUniverseOnly
@base.ReleaseTracks(base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA)
class HealthSources(base.Group):
"""Manage health sources."""
HealthSources.category = base.COMPUTE_CATEGORY
HealthSources.detailed_help = {
'DESCRIPTION': """
Manage health sources.
""",
}

View File

@@ -0,0 +1,74 @@
- release_tracks: [ALPHA, BETA]
help_text:
brief: "Create a health source."
description: "Create a health source."
examples: |
The following command creates a new health source:
$ {command} <HEALTH_SOURCE_NAME> \
--region=<REGION> \
--source-type=BACKEND_SERVICE \
--sources=my-backend-service \
--health-aggregation-policy=my-health-aggregation-policy
request:
ALPHA:
api_version: alpha
BETA:
api_version: beta
collection: compute.regionHealthSources
method: insert
modify_request_hooks:
- googlecloudsdk.api_lib.compute.health_sources.modify_request_hooks:add_name_to_payload
- googlecloudsdk.api_lib.compute.health_sources.modify_request_hooks:parse_health_aggregation_policy_create
- googlecloudsdk.api_lib.compute.health_sources.modify_request_hooks:parse_sources_create
async:
collection: compute.regionOperations
response_name_field: selfLink
state:
field: status
success_values: ['DONE']
arguments:
resource:
help_text: The name of the health source you want to create.
spec: !REF googlecloudsdk.command_lib.compute.resources:health_source
params:
- arg_name: description
api_field: healthSource.description
help_text: |
A textual description of the HealthSource.
required: false
- arg_name: health-aggregation-policy
api_field: healthSource.healthAggregationPolicy
help_text: |
URL to the health aggregation policy resource. Must be set. Must be
regional and in the same region as the HealthSource. Can be mutated.
required: true
- arg_name: source-type
api_field: healthSource.sourceType
help_text: |
Specifies the type of the HealthSource. The only allowed value is
BACKEND_SERVICE. Must be specified when the HealthSource is created,
and cannot be mutated.
choices:
- arg_value: backend-service
enum_value: BACKEND_SERVICE
default: backend-service
- arg_name: sources
type: googlecloudsdk.command_lib.compute.common:ArgList:min_length=1
api_field: healthSource.sources
help_text: |
URLs to the source resources. Must be size 1. Must be a BackendService
if the sourceType is BACKEND_SERVICE. The BackendService must have load
balancing scheme INTERNAL or INTERNAL_MANAGED and must be regional and
in the same region as the HealthSource (cross-region deployment for
INTERNAL_MANAGED is not supported). The BackendService may use only IGs,
MIGs, or NEGs of type GCE_VM_IP or GCE_VM_IP_PORT. The BackendService
may not use haPolicy. Can be mutated.
required: true

View File

@@ -0,0 +1,27 @@
- release_tracks: [ALPHA, BETA]
help_text:
brief: "Delete a health source."
description: "Delete a health source."
examples: |
To delete a single health source, run the following command:
$ {command} <HEALTH_SOURCE_NAME> --region=<REGION>
request:
ALPHA:
api_version: alpha
BETA:
api_version: beta
collection: compute.regionHealthSources
async:
collection: compute.regionOperations
response_name_field: selfLink
state:
field: status
success_values: ['DONE']
arguments:
resource:
help_text: Name of the health source you want to delete.
spec: !REF googlecloudsdk.command_lib.compute.resources:health_source

View File

@@ -0,0 +1,21 @@
- release_tracks: [ALPHA, BETA]
help_text:
brief: "Describe a health source."
description: "Describe a health source."
examples: |
To retrieve a single health source and print its properties, run the following
command:
$ {command} <HEALTH_SOURCE_NAME> --region=<REGION>
request:
ALPHA:
api_version: alpha
BETA:
api_version: beta
collection: compute.regionHealthSources
arguments:
resource:
help_text: Name of the health source you want to inspect.
spec: !REF googlecloudsdk.command_lib.compute.resources:health_source

View File

@@ -0,0 +1,81 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Command for listing health sources."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.api_lib.compute import base_classes
from googlecloudsdk.api_lib.compute import lister
from googlecloudsdk.calliope import base
@base.DefaultUniverseOnly
@base.ReleaseTracks(base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA)
class List(base.ListCommand):
"""List health sources."""
messages = None
@staticmethod
def Args(parser):
lister.AddRegionsArg(parser)
parser.display_info.AddFormat("""
table(
name:label=NAME,
region.basename():label=REGION,
healthAggregationPolicy.basename():label=HEALTH_AGGREGATION_POLICY,
sourceType:label=SOURCE_TYPE,
sources.basename():label=SOURCES
)
""")
def Collection(self):
"""Override the default collection from the base class."""
return None
def Run(self, args):
holder = base_classes.ComputeApiHolder(self.ReleaseTrack())
client = holder.client
self.messages = client.messages
request_data = lister.ParseMultiScopeFlags(args, holder.resources)
list_implementation = lister.MultiScopeLister(
client,
regional_service=client.apitools_client.regionHealthSources,
aggregation_service=client.apitools_client.regionHealthSources,
)
return lister.Invoke(request_data, list_implementation)
@property
def service(self):
return self.compute.regionHealthSources
@property
def resource_type(self):
return 'regionHealthSources'
@property
def regional_service(self):
"""The service used to list regional resources."""
return self.compute.regionHealthSources
@property
def aggregation_service(self):
"""The service used to get aggregated list of resources."""
return self.compute.regionHealthSources

View File

@@ -0,0 +1,66 @@
- release_tracks: [ALPHA, BETA]
help_text:
brief: "Update a health source."
description: "Update a health source."
examples: |
The following command updates a new health source named
"my-health-source":
$ {command} <HEALTH_SOURCE_NAME> --region=<REGION> \
--source-type=BACKEND_SERVICE
--sources=my-backend-service
--health-aggregation-policy=my-health-aggregation-policy
request:
ALPHA:
api_version: alpha
BETA:
api_version: beta
collection: compute.regionHealthSources
method: patch
modify_request_hooks:
- googlecloudsdk.api_lib.compute.health_sources.modify_request_hooks:parse_health_aggregation_policy_update
- googlecloudsdk.api_lib.compute.health_sources.modify_request_hooks:parse_sources_update
async:
collection: compute.regionOperations
response_name_field: selfLink
state:
field: status
success_values: ['DONE']
arguments:
resource:
help_text: The name of the health source you want to create.
spec: !REF googlecloudsdk.command_lib.compute.resources:health_source
params:
- group:
mutex: false
required: true
params:
- arg_name: description
api_field: healthSourceResource.description
help_text: |
A textual description of the health source.
- arg_name: sources
type: googlecloudsdk.command_lib.compute.common:ArgList:min_length=1
api_field: healthSourceResource.sources
help_text: |
URLs to the source resources. Must be size 1. Must be a BackendService
if the sourceType is BACKEND_SERVICE. The BackendService must have load
balancing scheme INTERNAL or INTERNAL_MANAGED and must be regional and
in the same region as the HealthSource (cross-region deployment for
INTERNAL_MANAGED is not supported). The BackendService may use only IGs,
MIGs, or NEGs of type GCE_VM_IP or GCE_VM_IP_PORT. The BackendService
may not use haPolicy. Can be mutated.
- arg_name: health-aggregation-policy
api_field: healthSourceResource.healthAggregationPolicy
help_text: |
URL to the health aggregation policy resource. Must be set. Must be
regional and in the same region as the HealthSource. Can be mutated.
update:
read_modify_update: true