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,33 @@
# -*- 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 composite health checks."""
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 CompositeHealthChecks(base.Group):
"""Manage composite health checks."""
CompositeHealthChecks.category = base.COMPUTE_CATEGORY
CompositeHealthChecks.detailed_help = {
'DESCRIPTION': """
Manage composite health checks.
""",
}

View File

@@ -0,0 +1,59 @@
- release_tracks: [ALPHA, BETA]
help_text:
brief: "Create a composite health check."
description: "Create a composite health check."
examples: |
The following command creates a new composite health check:
$ {command} <COMPOSITE_HEALTH_CHECK_NAME> \
--region=<REGION> \
--health-sources=my-hs \
--health-destination=my-fr
request:
ALPHA:
api_version: alpha
BETA:
api_version: beta
collection: compute.regionCompositeHealthChecks
method: insert
modify_request_hooks:
- googlecloudsdk.api_lib.compute.composite_health_checks.modify_request_hooks:add_name_to_payload
- googlecloudsdk.api_lib.compute.composite_health_checks.modify_request_hooks:parse_health_sources_create
- googlecloudsdk.api_lib.compute.composite_health_checks.modify_request_hooks:parse_health_destination_create
async:
collection: compute.regionOperations
response_name_field: selfLink
state:
field: status
success_values: ['DONE']
arguments:
resource:
help_text: The name of the composite health check you want to create.
spec: !REF googlecloudsdk.command_lib.compute.resources:composite_health_check
params:
- arg_name: description
api_field: compositeHealthCheck.description
help_text: |
A textual description of this resource.
- arg_name: health-sources
type: googlecloudsdk.command_lib.compute.common:ArgList:min_length=1
api_field: compositeHealthCheck.healthSources
help_text: |
URLs to the HealthSource resources whose results are AND'ed. I.e. the aggregated result is
HEALTHY only if all sources are HEALTHY. Must have at least 1. Must not have more than 10.
Must be regional and in the same region as the CompositeHealthCheck. Can be mutated.
required: true
- arg_name: health-destination
api_field: compositeHealthCheck.healthDestination
help_text: |
URL to the destination resource. Must be set. Must be a ForwardingRule. The ForwardingRule
must have load balancing scheme INTERNAL or INTERNAL_MANAGED and must be regional and in the
same region as the CompositeHealthCheck (cross-region deployment for INTERNAL_MANAGED is not
supported). Can be mutated.
required: true

View File

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

View File

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

View File

@@ -0,0 +1,80 @@
# -*- 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 composite health checks."""
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 composite health checks."""
messages = None
@staticmethod
def Args(parser):
lister.AddRegionsArg(parser)
parser.display_info.AddFormat("""
table(
name:label=NAME,
region.basename():label=REGION,
healthDestination.basename():label=HEALTH_DESTINATION,
healthSources.basename():label=HEALTH_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.regionCompositeHealthChecks,
aggregation_service=client.apitools_client.regionCompositeHealthChecks,
)
return lister.Invoke(request_data, list_implementation)
@property
def service(self):
return self.compute.regionCompositeHealthChecks
@property
def resource_type(self):
return 'regionCompositeHealthChecks'
@property
def regional_service(self):
"""The service used to list regional resources."""
return self.compute.regionCompositeHealthChecks
@property
def aggregation_service(self):
"""The service used to get aggregated list of resources."""
return self.compute.regionCompositeHealthChecks

View File

@@ -0,0 +1,61 @@
- release_tracks: [ALPHA, BETA]
help_text:
brief: "Update a composite health check."
description: "Update a composite health check."
examples: |
The following command updates an existing composite health check:
$ {command} <COMPOSITE_HEALTH_CHECK_NAME> \
--region=<REGION> \
--health-destination=my-new-fr
request:
ALPHA:
api_version: alpha
BETA:
api_version: beta
collection: compute.regionCompositeHealthChecks
method: patch
modify_request_hooks:
- googlecloudsdk.api_lib.compute.composite_health_checks.modify_request_hooks:parse_health_sources_update
- googlecloudsdk.api_lib.compute.composite_health_checks.modify_request_hooks:parse_health_destination_update
async:
collection: compute.regionOperations
response_name_field: selfLink
state:
field: status
success_values: ['DONE']
arguments:
resource:
help_text: The name of the composite health check you want to update.
spec: !REF googlecloudsdk.command_lib.compute.resources:composite_health_check
params:
- group:
mutex: false
required: true
params:
- arg_name: description
api_field: compositeHealthCheckResource.description
help_text: |
A textual description of this resource.
- arg_name: health-sources
type: googlecloudsdk.command_lib.compute.common:ArgList:min_length=1
api_field: compositeHealthCheckResource.healthSources
help_text: |
URLs to the HealthSource resources whose results are AND'ed. I.e. the aggregated result is
HEALTHY only if all sources are HEALTHY. Must have at least 1. Must not have more than 10.
Must be regional and in the same region as the CompositeHealthCheck. Can be mutated.
- arg_name: health-destination
api_field: compositeHealthCheckResource.healthDestination
help_text: |
URL to the destination resource. Must be set. Must be a ForwardingRule. The ForwardingRule
must have load balancing scheme INTERNAL or INTERNAL_MANAGED and must be regional and in the
same region as the CompositeHealthCheck (cross-region deployment for INTERNAL_MANAGED is not
supported). Can be mutated.
update:
read_modify_update: true