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,24 @@
# -*- 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.
"""Manage Cluster Director resources."""
from googlecloudsdk.calliope import base
from surface.cluster_director import _init_extensions as extensions
@base.DefaultUniverseOnly
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class ClusterDirectorAlpha(extensions.ClusterDirectorAlpha):
"""Manage Cluster Director resources."""

View File

@@ -0,0 +1,34 @@
# -*- 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.
"""File to add optional custom code to extend __init__.py."""
from googlecloudsdk.calliope import base
@base.DefaultUniverseOnly
class ClusterDirectorAlpha(base.Group):
"""Optional no-auto-generated code for ALPHA."""
category = base.UNCATEGORIZED_CATEGORY
@base.DefaultUniverseOnly
class ClusterDirectorBeta(base.Group):
"""Optional no-auto-generated code for BETA."""
category = base.UNCATEGORIZED_CATEGORY
@base.DefaultUniverseOnly
class ClusterDirectorGa(base.Group):
"""Optional no-auto-generated code for GA."""
category = base.UNCATEGORIZED_CATEGORY

View File

@@ -0,0 +1,24 @@
# -*- 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.
"""Manage Cluster Director cluster resources."""
from googlecloudsdk.calliope import base
from surface.cluster_director.clusters import _init_extensions as extensions
@base.DefaultUniverseOnly
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class ClustersAlpha(extensions.ClustersAlpha):
"""Manage Cluster Director cluster resources."""

View File

@@ -0,0 +1,34 @@
# -*- 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
"""File to add optional custom code to extend __init__.py."""
from googlecloudsdk.calliope import base
@base.DefaultUniverseOnly
class ClustersAlpha(base.Group):
"""Optional no-auto-generated code for ALPHA."""
@base.DefaultUniverseOnly
class ClustersBeta(base.Group):
"""Optional no-auto-generated code for BETA."""
@base.DefaultUniverseOnly
class ClustersGa(base.Group):
"""Optional no-auto-generated code for GA."""

View File

@@ -0,0 +1,176 @@
# -*- 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 to create a cluster-director cluster resource."""
import textwrap
from googlecloudsdk.api_lib.hypercomputecluster import utils as api_utils
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.cluster_director.clusters import flags
from googlecloudsdk.command_lib.cluster_director.clusters import utils
from googlecloudsdk.core import log
DETAILED_HELP = {
"DESCRIPTION": textwrap.dedent("""
*{command}* facilitates the creation of a cluster resource.
There are following ways to create a cluster:
- [Preferred] Use granular flags to define cluster specs.
- Use --config flag with cluster specs in JSON format.
Please refer to the examples below for more details.
"""),
"EXAMPLES": textwrap.dedent("""
To create a cluster `my-cluster` in location `us-central1-a` with granular flags, run the following example:
$ {command} my-cluster --location us-central1-a \
--description "My cluster description" \
--labels env=prod,client=gcloud-cli \
--create-network name=network0 \
--create-filestores name=locations/us-central1-a/instances/filestore0,tier=BASIC_HDD,capacityGb={filestoreSize},fileshare={fileshare} \
--filestores locations/us-central1-a/instances/filestore1 \
--create-buckets name=bucket0 \
--buckets bucket1 \
--create-lustres name=locations/us-central1-a/instances/lustre0,capacityGb={lustreSize},filesystem={filesystem} \
--lustres locations/us-central1-a/instances/lustre1 \
--reserved-instances id=compute0,machineType={machineType},reservation=zones/us-central1-a/reservations/{reservation} \
--slurm-login-node machineType={machineType},zone=us-central1-a \
--slurm-node-sets id=nodeset0,computeId=compute0 \
--slurm-partitions id=partition0,nodesetIds=[nodeset0] \
--slurm-default-partition partition0 \
--format json
To create a cluster `my-cluster` in location `us-central1-a` with config in JSON string format run the following example:
$ {command} my-cluster --location=us-central1-a --config='{"key": "value"}'
Or create a JSON file `my-cluster-config.json` with the cluster specs and run the following file example:
$ {command} my-cluster --location=us-central1-a --config=my-cluster-config.json
"""),
}
@base.DefaultUniverseOnly
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class Create(base.CreateCommand):
"""Creates a Cluster Director resource."""
@classmethod
def Args(cls, parser):
"""Specifies command flags.
Args:
parser: argparse.Parser: Parser object for command line inputs.
"""
base.ASYNC_FLAG.AddToParser(parser)
api_version = api_utils.GetApiVersion(cls.ReleaseTrack())
utils.AddClusterNameArgToParser(parser=parser, api_version=api_version)
group = parser.add_group(
help="Cluster configuration for provisioning.",
mutex=True,
required=True,
)
flags.AddConfig(parser=group, api_version=api_version)
flag_group = group.add_group(
help="Flag Configurations to define cluster spec.",
)
flags.AddDescription(parser=flag_group, api_version=api_version)
flags.AddLabels(parser=flag_group, api_version=api_version)
network_group = flag_group.add_group(
mutex=True,
required=True,
help="Network configuration for the cluster.",
)
flags.AddCreateNetwork(parser=network_group, api_version=api_version)
network_source_group = network_group.add_group(
help="Use an existing network source for the cluster.",
)
flags.AddNetworkSource(
parser=network_source_group, api_version=api_version, required=True
)
flags.AddSubnetSource(
parser=network_source_group, api_version=api_version, required=True
)
flags.AddCreateFilestores(parser=flag_group, api_version=api_version)
flags.AddFilestores(parser=flag_group, api_version=api_version)
flags.AddCreateGcsBuckets(parser=flag_group, api_version=api_version)
flags.AddGcsBuckets(parser=flag_group, api_version=api_version)
flags.AddCreateLustres(parser=flag_group, api_version=api_version)
flags.AddLustres(parser=flag_group, api_version=api_version)
flags.AddOnDemandInstances(parser=flag_group, api_version=api_version)
flags.AddSpotInstances(parser=flag_group, api_version=api_version)
flags.AddReservedInstances(parser=flag_group, api_version=api_version)
flags.AddDwsFlexInstances(parser=flag_group, api_version=api_version)
flags.AddSlurmLoginNode(
parser=flag_group, api_version=api_version, required=True
)
flags.AddSlurmNodeSets(
parser=flag_group, api_version=api_version, required=True
)
flags.AddSlurmPartitions(
parser=flag_group, api_version=api_version, required=True
)
flags.AddSlurmDefaultPartition(parser=flag_group, api_version=api_version)
def Run(self, args):
"""Constructs and sends request.
Args:
args: argparse.Namespace, An object that contains the values for the
arguments specified in the .Args() method.
Returns:
ProcessHttpResponse of the request made.
"""
release_track = self.ReleaseTrack()
client = api_utils.GetClientInstance(release_track)
messages = api_utils.GetMessagesModule(release_track)
cluster_util = utils.ClusterUtil(args=args, message_module=messages)
cluster_ref = cluster_util.cluster_ref
if args.IsSpecified("config"):
cluster = cluster_util.MakeClusterFromConfig()
else:
cluster = cluster_util.MakeCluster()
operation = client.projects_locations_clusters.Create(
messages.HypercomputeclusterProjectsLocationsClustersCreateRequest(
parent=cluster_ref.Parent().RelativeName(),
clusterId=cluster_ref.Name(),
cluster=cluster,
)
)
log.status.Print(
"Create request issued for: [{0}]".format(cluster_ref.Name())
)
if args.async_:
return operation
response = api_utils.WaitForOperation(
client=client,
operation=operation,
message="Waiting for operation [{0}] to complete".format(
operation.name
),
max_wait_sec=7200,
)
log.status.Print("Created cluster [{0}].".format(cluster_ref.Name()))
return response
Create.detailed_help = DETAILED_HELP

View File

@@ -0,0 +1,41 @@
# -*- 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.
- release_tracks:
- ALPHA
help_text:
brief: Deletes a Cluster Director resource
description: |
Deletes a Cluster Director resource.
examples: |-
To delete a cluster `my-cluster` in location `us-central1-a` run:
$ {command} my-cluster --location=us-central1-a
arguments:
params:
- help_text: |-
Identifier. Name of the cluster to delete.
Formats: cluster | projects/{project}/locations/{locations}/clusters/{cluster}
is_positional: true
is_primary_resource: true
request_id_field: name
resource_spec: !REF googlecloudsdk.command_lib.cluster_director.clusters.resources:projects_locations_clusters
required: true
request:
api_version: v1alpha
collection:
- hypercomputecluster.projects.locations.clusters
async:
collection:
- hypercomputecluster.projects.locations.operations

View File

@@ -0,0 +1,38 @@
# -*- 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.
- release_tracks:
- ALPHA
help_text:
brief: Gets details of a Cluster Director resource
description: |
Gets details of a Cluster Director resource.
examples: |-
To get the details of a cluster `my-cluster` in location `us-central1-a` run:
$ {command} my-cluster --location=us-central1-a
arguments:
params:
- help_text: |-
Identifier. Name of the cluster to retrieve.
Format: cluster | projects/{project}/locations/{location}/clusters/{cluster}
is_positional: true
is_primary_resource: true
request_id_field: name
resource_spec: !REF googlecloudsdk.command_lib.cluster_director.clusters.resources:projects_locations_clusters
required: true
request:
api_version: v1alpha
collection:
- hypercomputecluster.projects.locations.clusters

View File

@@ -0,0 +1,40 @@
# -*- 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.
- release_tracks:
- ALPHA
help_text:
brief: List Cluster Director resources
description: |
List Cluster Director resources.
examples: |-
To list all clusters in particular location `us-central1-a` run:
$ {command} --location=us-central1-a
arguments:
params:
- help_text: |-
Identifier. Parent collection which own list of clusters.
Format: location | projects/{project}/locations/{location}
is_positional: false
is_primary_resource: true
request_id_field: parent
resource_spec: !REF googlecloudsdk.command_lib.cluster_director.clusters.resources:projects_locations
required: true
request:
api_version: v1alpha
collection:
- hypercomputecluster.projects.locations.clusters
response:
id_field: name

View File

@@ -0,0 +1,228 @@
# -*- 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 to update a cluster-director cluster resource."""
import textwrap
from googlecloudsdk.api_lib.hypercomputecluster import utils as api_utils
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.cluster_director.clusters import flags
from googlecloudsdk.command_lib.cluster_director.clusters import utils
from googlecloudsdk.core import log
DETAILED_HELP = {
"DESCRIPTION": textwrap.dedent("""
*{command}* facilitates the updation of a cluster resource.
There are following ways to update a cluster:
- [Preferred] Use granular flags to update cluster specs, based on read-modify-update pattern.
- Read the existing cluster specs through `get` cluster request.
- Modify the cluster specs through granular flags.
- Update the cluster specs through `patch` cluster request.
- Use --config with cluster specs and --update-mask flags, both in JSON format.
- Map and repeated fields update requires existing and new values.
- For e.g. if we want to update a cluster to add a new nodeset, then we will use the update_mask "orchestrator.slurm.node_sets", and the patch cluster must include all the existing nodesets as well as the new one.
Please refer to the examples below for more details.
"""),
"EXAMPLES": textwrap.dedent("""
To update a cluster `my-cluster` in location `us-central1-a` with granular flags, run the following example:
Add labels, compute instances, slurm node sets, slurm partitions and update description and default partition:
$ {command} my-cluster --location us-central1-a \
--description "My updated cluster description" \
--add-labels env=prod,client=gcloud-cli \
--add-on-demand-instances id=compute1,zone=us-central1-a,machineType=n2-standard-2 \
--add-reserved-instances id=compute2,reservation=zones/us-central1-a/reservations/{reservation},machineType={machineType} \
--add-spot-instances id=compute3,zone=us-central1-a,machineType=n2-standard-2 \
--add-dws-flex-instances id=compute4,zone=us-central1-a,machineType=a4-highgpu-8g,maxDuration=10000s \
--add-new-lustre-instances lustre=locations/us-central1-a/instances/lustre1,capacityGb=1024,filesystem=lustre1 \
--add-lustre-instances locations/us-central1-a/instances/lustre0 \
--add-slurm-node-sets id=nodeset1,computeId=compute1 \
--add-slurm-node-sets id=nodeset2,computeId=compute2 \
--add-slurm-node-sets id=nodeset3,computeId=compute3 \
--add-slurm-node-sets id=nodeset4,computeId=compute4 \
--add-slurm-partitions id=partition1,nodesetIds=[nodeset1] \
--add-slurm-partitions id=partition2,nodesetIds=[nodeset2,nodeset3,nodeset4] \
--slurm-default-partition partition1
Update slurm node sets and slurm partitions:
$ {command} my-cluster --location us-central1-a \
--update-slurm-node-sets id=nodeset1,staticNodeCount=2,maxDynamicNodeCount=10 \
--update-slurm-partitions id=partition1,nodesetIds=[nodeset0],exclusive=true
Remove slurm node sets, slurm partitions and compute instances and update default partition:
$ {command} my-cluster --location us-central1-a \
--slurm-default-partition partition0 \
--remove-labels env,client \
--remove-lustre-instances locations/us-central1-a/instances/lustre0 \
--remove-slurm-partitions partition1 \
--remove-slurm-partitions partition2 \
--remove-slurm-node-sets nodeset1 \
--remove-slurm-node-sets nodeset2 \
--remove-slurm-node-sets nodeset3 \
--remove-slurm-node-sets nodeset4 \
--remove-on-demand-instances compute1 \
--remove-reserved-instances compute2 \
--remove-spot-instances compute3 \
--remove-dws-flex-instances compute4
Or cluster `my-cluster` in location `us-central1-a` with config JSON run the following JSON example:
$ {command} my-cluster --location=us-central1-a --update-mask=labels --config='{"key": "value"}'
Or create a JSON file `my-cluster-config.json` with the cluster specs and run the following file example:
$ {command} my-cluster --location=us-central1-a --update-mask=labels --config-from-file=my-cluster-config.json
Or create a JSON file with the update mask and run the following file example:
$ {command} my-cluster --location=us-central1-a --update-mask-from-file=my-update-mask.json --config-from-file=my-cluster-config.json
"""),
}
@base.DefaultUniverseOnly
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class Update(base.UpdateCommand):
"""Updates a Cluster Director resource."""
@classmethod
def Args(cls, parser):
"""Specifies command flags.
Args:
parser: argparse.Parser: Parser object for command line inputs.
"""
base.ASYNC_FLAG.AddToParser(parser)
api_version = api_utils.GetApiVersion(cls.ReleaseTrack())
utils.AddClusterNameArgToParser(parser=parser, api_version=api_version)
group = parser.add_group(
help="Cluster configuration for provisioning with updates.",
mutex=True,
required=True,
)
config_group = group.add_group(
help="Cluster configuration for updates.",
)
flags.AddConfig(parser=config_group, api_version=api_version, required=True)
flags.AddUpdateMask(
parser=config_group, api_version=api_version, required=True
)
flag_group = group.add_group(
help="Flag Configurations to define cluster updates.",
)
flags.AddDescription(parser=flag_group, api_version=api_version)
flags.AddLabels(
parser=flag_group, api_version=api_version, include_update_flags=True
)
flags.AddCreateFilestores(
parser=flag_group, api_version=api_version, include_update_flags=True
)
flags.AddFilestores(
parser=flag_group, api_version=api_version, include_update_flags=True
)
flags.AddGcsBuckets(
parser=flag_group, api_version=api_version, include_update_flags=True
)
flags.AddCreateGcsBuckets(
parser=flag_group, api_version=api_version, include_update_flags=True
)
flags.AddCreateLustres(
parser=flag_group, api_version=api_version, include_update_flags=True
)
flags.AddLustres(
parser=flag_group, api_version=api_version, include_update_flags=True
)
flags.AddOnDemandInstances(
parser=flag_group, api_version=api_version, include_update_flags=True
)
flags.AddSpotInstances(
parser=flag_group, api_version=api_version, include_update_flags=True
)
flags.AddReservedInstances(
parser=flag_group, api_version=api_version, include_update_flags=True
)
flags.AddDwsFlexInstances(
parser=flag_group, api_version=api_version, include_update_flags=True
)
flags.AddSlurmNodeSets(
parser=flag_group, api_version=api_version, include_update_flags=True
)
flags.AddSlurmPartitions(
parser=flag_group, api_version=api_version, include_update_flags=True
)
flags.AddSlurmDefaultPartition(parser=flag_group, api_version=api_version)
flags.AddSlurmLoginNode(
parser=flag_group, api_version=api_version, include_update_flags=True
)
def Run(self, args):
"""Constructs and sends request.
Args:
args: argparse.Namespace, An object that contains the values for the
arguments specified in the .Args() method.
Returns:
ProcessHttpResponse of the request made.
"""
release_track = self.ReleaseTrack()
client = api_utils.GetClientInstance(release_track)
messages = api_utils.GetMessagesModule(release_track)
existing_cluster = None
if not args.IsSpecified("config"):
existing_cluster = api_utils.GetCluster(client, args, messages)
cluster_util = utils.ClusterUtil(
args=args, message_module=messages, existing_cluster=existing_cluster
)
cluster_ref = cluster_util.cluster_ref
if args.IsSpecified("config"):
cluster_patch, update_mask = cluster_util.MakeClusterPatchFromConfig()
else:
cluster_patch, update_mask = cluster_util.MakeClusterPatch()
operation = client.projects_locations_clusters.Patch(
messages.HypercomputeclusterProjectsLocationsClustersPatchRequest(
name=cluster_ref.RelativeName(),
cluster=cluster_patch,
updateMask=update_mask,
)
)
log.status.Print(
"Update request issued for: [{0}]".format(cluster_ref.Name())
)
if args.async_:
return operation
response = api_utils.WaitForOperation(
client=client,
operation=operation,
message="Waiting for operation [{0}] to complete".format(
operation.name
),
max_wait_sec=3600,
)
log.status.Print("Updated cluster [{0}].".format(cluster_ref.Name()))
return response
Update.detailed_help = DETAILED_HELP

View File

@@ -0,0 +1,24 @@
# -*- 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.
"""View Locations resources."""
from googlecloudsdk.calliope import base
from surface.cluster_director.locations import _init_extensions as extensions
@base.DefaultUniverseOnly
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class LocationsAlpha(extensions.LocationsAlpha):
"""View Locations resources."""

View File

@@ -0,0 +1,31 @@
# -*- 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.
"""File to add optional custom code to extend __init__.py."""
from googlecloudsdk.calliope import base
@base.DefaultUniverseOnly
class LocationsAlpha(base.Group):
"""Optional no-auto-generated code for ALPHA."""
@base.DefaultUniverseOnly
class LocationsBeta(base.Group):
"""Optional no-auto-generated code for BETA."""
@base.DefaultUniverseOnly
class LocationsGa(base.Group):
"""Optional no-auto-generated code for GA."""

View File

@@ -0,0 +1,34 @@
# -*- 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.
- release_tracks: [ALPHA]
help_text:
brief: Describe locations
description: |
Describe a location.
examples: |-
To describe the operation, run:
$ {command} us-central1
arguments:
params:
- help_text: |
The name of the location resource.
is_positional: true
resource_spec: !REF googlecloudsdk.command_lib.cluster_director.custom_resources:location
required: true
request:
ALPHA:
api_version: v1alpha
collection: hypercomputecluster.projects.locations

View File

@@ -0,0 +1,34 @@
# -*- 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.
- release_tracks: [ALPHA]
help_text:
brief: List locations.
description: |
List locations.
examples: |-
To list all locations, run:
$ {command}
arguments:
params:
- help_text: |-
The name of the location's parent resource.
is_positional: false
resource_spec: !REF googlecloudsdk.command_lib.cluster_director.custom_resources:project
required: true
request:
ALPHA:
api_version: v1alpha
collection: hypercomputecluster.projects.locations

View File

@@ -0,0 +1,24 @@
# -*- 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.
"""Manage Operation resources."""
from googlecloudsdk.calliope import base
from surface.cluster_director.operations import _init_extensions as extensions
@base.DefaultUniverseOnly
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class OperationsAlpha(extensions.OperationsAlpha):
"""Manage Operation resources."""

View File

@@ -0,0 +1,31 @@
# -*- 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.
"""File to add optional custom code to extend __init__.py."""
from googlecloudsdk.calliope import base
@base.DefaultUniverseOnly
class OperationsAlpha(base.Group):
"""Optional no-auto-generated code for ALPHA."""
@base.DefaultUniverseOnly
class OperationsBeta(base.Group):
"""Optional no-auto-generated code for BETA."""
@base.DefaultUniverseOnly
class OperationsGa(base.Group):
"""Optional no-auto-generated code for GA."""

View File

@@ -0,0 +1,34 @@
# -*- 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.
- release_tracks:
- ALPHA
help_text:
brief: Describe operations
description: Describe an operation
examples: |-
To describe the operation `my-operation` in location `us-central1-a`, run:
$ {command} my-operation --location=us-central1-a
arguments:
params:
- help_text: |-
The name of the operation resource.
is_positional: true
resource_spec: !REF googlecloudsdk.command_lib.cluster_director.default_resources:projects_locations_operations
required: true
request:
api_version: v1alpha
collection:
- hypercomputecluster.projects.locations.operations