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,51 @@
# -*- coding: utf-8 -*- #
# Copyright 2018 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.
"""The command group for the Cloud VPC Access Service."""
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.GA, base.ReleaseTrack.BETA)
class VpcAccess(base.Group):
"""Manage VPC Access Service resources.
Commands for managing Google VPC Access Service resources.
"""
def Filter(self, context, args):
del context, args
# Explicitly enables user-project-override as it's disabled at compute
# level.
base.EnableUserProjectQuota()
@base.Hidden
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class VpcAccessAlpha(base.Group):
"""Manage VPC Access Service resources.
Commands for managing Google VPC Access Service resources.
"""
def Filter(self, context, args):
del context, args
# Explicitly enables user-project-override as it's disabled at compute
# level.
base.EnableUserProjectQuota()

View File

@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*- #
# Copyright 2018 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.
"""The command group for connectors of Google VPC Access Service."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
class Connectors(base.Group):
"""Manage Serverless VPC Access Service connectors.
Commands for managing connectors resource for VPC Access Service.
"""

View File

@@ -0,0 +1,142 @@
- release_tracks: [GA, BETA, ALPHA]
help_text:
brief: |
Create a VPC Access connector.
description: |
Create a new VPC Access connector with the given name.
This command can fail for the following reasons:
* An instance with the same name already exists.
* The active account does not have permission to create instances.
examples: |
The following command creates a VPC Access connector with name 'my-vpc-connector'
in region 'us-central1' in network 'my-network' with IP CIDR range of '10.132.0.0/28'.
$ {command} my-vpc-connector --region=us-central1 --network=my-network
--range=10.132.0.0/28
async:
collection: vpcaccess.projects.locations.operations
request:
collection: vpcaccess.projects.locations.connectors
api_version: v1
BETA:
api_version: v1beta1
ALPHA:
api_version: v1alpha1
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.compute.networks.vpc_access.resources:connector_v1
ALPHA:
spec: !REF googlecloudsdk.command_lib.compute.networks.vpc_access.resources:connector
help_text: |
Arguments and flags that specify the VPC Access connector you want to create.
params:
- group:
mutex: true
params:
- group:
help_text: |
The Serverless VPC Access API can internally manage the creation
of a subnet to house the VPC connector. To create this
subnet, the network ID (--network) and an IP CIDR range (--range)
for the subnet must be provided.
params:
- arg_name: network
api_field: connector.network
required: false
help_text: |
Name of the Compute Engine network to which the connector
will be connected. If left unspecified, the default network will be
used.
default: default
- arg_name: range
api_field: connector.ipCidrRange
required: false
help_text: |
CIDR range of internal addresses that are reserved for this
connector. For example, 10.132.0.0/28. Range must be unique and
non-overlapping with existing ranges in the network.
- group:
help_text: |
You can specify a subnet in which to place the connector rather than
using an internally managed subnet. If you wish to use this
connector to attach your Serverless application to a Shared VPC,
first share a subnet to the project to which you are deploying your connector.
Then, supply the name of the subnet (--subnet) and the
project ID (--subnet-project) from which the subnet is hosted to
connect to this VPC.
params:
- arg_name: subnet
api_field: connector.subnet.name
required: false
help_text: |
User-provided subnet to house the connector. This field can be used in
favor of specifying the `network` and `range` fields.
e.g. "my-subnet"
- arg_name: subnet-project
api_field: connector.subnet.projectId
required: false
help_text: |
Project ID of the provided subnet. The default is the project of the connector.
- group:
release_tracks: [ALPHA, BETA, GA]
mutex: true
params:
- group:
help_text: |
Scaling settings of a VPC Access Connector can be specified in terms of
throughput.
params:
- arg_name: min-throughput
api_field: connector.minThroughput
required: false
help_text: |
Minimum throughput of the connector in Mbps. Refers to the expected throughput when
using an `e2-micro` machine type. Value must be a multiple of 100 from 200 through
900. Must be lower than the value specified by `--max-throughput`. If both
min-throughput and min-instances are provided, min-instances takes precedence over
min-throughput. The use of `min-throughput` is discouraged in favor of
`min-instances`.
- arg_name: max-throughput
api_field: connector.maxThroughput
required: false
help_text: |
Maximum throughput of the connector in Mbps. Refers to the expected throughput when
using an `e2-micro` machine type. Value must be a multiple of 100 from 300 through
1000. Must be higher than the value specified by `--min-throughput`. If both
max-throughput and max-instances are provided, max-instances takes precedence over
max-throughput. The use of `max-throughput` is discouraged in favor of
`max-instances`.
- group:
help_text: |
Scaling settings of a VPC Access Connector can be specified in terms of number
of Google Compute Engine VM instances underlying the connector autoscaling group.
params:
- arg_name: min-instances
api_field: connector.minInstances
default: 2
required: false
help_text: |
Minimum number of instances within an autoscaling group underlying the connector.
Value must be between 2 and 9, inclusive. Must be lower than the value specified by
`--max-instances`.
- arg_name: max-instances
api_field: connector.maxInstances
default: 10
required: false
help_text: |
Maximum number of instances within an autoscaling group underlying the connector.
Value must be between 3 and 10, inclusive. Must be higher than the value specified by
`--min-instances`.
- arg_name: machine-type
api_field: connector.machineType
release_tracks: [ALPHA, BETA, GA]
required: false
help_text: |
Machine type of VMs underlying the VPC Access connector. Accepted values are ``e2-micro'',
``f1-micro'', and ``e2-standard-4''. If left unspecified, the ``e2-micro'' machine type is
used.

View File

@@ -0,0 +1,38 @@
- release_tracks: [GA, BETA, ALPHA]
help_text:
brief: |
Delete a VPC Access connector.
description: |
Delete a new VPC Access connector with the given name.
This command can fail for the following reasons:
* An instance with the same name already exists.
* The active account does not have permission to delete instances.
examples: |
The following command deletes a VPC Access connector with name
`my-vpc-connector` in region `us-central1`:
$ {command} my-vpc-connector --region=us-central1
async:
collection: vpcaccess.projects.locations.operations
request:
collection: vpcaccess.projects.locations.connectors
api_version: v1
BETA:
api_version: v1beta1
ALPHA:
api_version: v1alpha1
input:
confirmation_prompt: |
You are about to delete connector [{__name__}] in [{locationsId}].
Any associated data will be lost.
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.compute.networks.vpc_access.resources:connector
help_text: |
Arguments and flags that specify the VPC Access connector you want
to delete.

View File

@@ -0,0 +1,49 @@
- release_tracks: [GA, BETA, ALPHA]
help_text:
brief: |
Show metadata for a VPC Access connector.
description: |
Display all metadata associated with a VPC Access connector
given a valid connector name.
This command can fail for the following reasons:
* The connector specified does not exist.
* The active account does not have permission to access the given
operation.
examples: |
The following command prints metadata for a connector with name
`my-vpcaccesss-connector` in region `us-central1`:
$ {command} my-vpcaccess-connector --region=us-central
request:
collection: vpcaccess.projects.locations.connectors
api_version: v1
BETA:
api_version: v1beta1
ALPHA:
api_version: v1alpha1
response:
id_field: name
arguments:
resource:
help_text: The connector to describe.
spec: !REF googlecloudsdk.command_lib.compute.networks.vpc_access.resources:connector
BETA:
output:
format: |
table(
name.basename():label=CONNECTOR_ID:sort=1,
name.segment(3):label=REGION,
network,
ipCidrRange,
subnet.name:label=SUBNET,
subnet.projectId:label=SUBNET_PROJECT,
machineType,
minInstances,
maxInstances,
state
)

View File

@@ -0,0 +1,77 @@
- release_tracks: [GA, BETA, ALPHA]
help_text:
brief: |
List VPC Access connectors.
description: |
List all VPC Access connectors under the specified project and region.
You can specify the maximum number of connectors to list using the
`--limit` flag.
examples: |
The following command lists a maximum of five instances in us-central1:
$ {command} --region=us-central1 --limit=5
request:
collection: vpcaccess.projects.locations.connectors
api_version: v1
BETA:
api_version: v1beta1
ALPHA:
api_version: v1alpha1
response:
id_field: name
arguments:
resource:
help_text: The region of the connectors to list.
spec: !REF googlecloudsdk.command_lib.compute.networks.vpc_access.resources:region
ALPHA:
output:
format: |
table(
name.basename():label=CONNECTOR_ID:sort=1,
name.segment(3):label=REGION,
network,
ipCidrRange,
subnet.name:label=SUBNET,
subnet.projectId:label=SUBNET_PROJECT,
machineType,
minInstances,
maxInstances,
status
)
BETA:
output:
format: |
table(
name.basename():label=CONNECTOR_ID:sort=1,
name.segment(3):label=REGION,
network,
ipCidrRange,
subnet.name:label=SUBNET,
subnet.projectId:label=SUBNET_PROJECT,
machineType,
minInstances,
maxInstances,
state
)
GA:
output:
format: |
table(
name.basename():label=CONNECTOR_ID:sort=1,
name.segment(3):label=REGION,
network,
ipCidrRange,
subnet.name:label=SUBNET,
subnet.projectId:label=SUBNET_PROJECT,
machineType,
minInstances,
maxInstances,
minThroughput,
maxThroughput,
state
)

View File

@@ -0,0 +1,60 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Update a VPC Access connector.
description: |
Update an existing VPC Access connector with the given name.
This command can fail for the following reasons:
* Invalid parameters are passed to this command.
* The active account does not have permission to update instances.
examples: |
The following command updates a VPC Access connector with name
`my-vpc-connector` in region `us-central1`:
$ {command} my-vpc-connector --region=us-central1 --min-instances=3 --max-instances=5
async:
collection: vpcaccess.projects.locations.operations
request:
collection: vpcaccess.projects.locations.connectors
api_version: v1
BETA:
api_version: v1beta1
ALPHA:
api_version: v1alpha1
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.compute.networks.vpc_access.resources:connector_v1
ALPHA:
spec: !REF googlecloudsdk.command_lib.compute.networks.vpc_access.resources:connector
help_text: |
Arguments and flags that specify the VPC Access connector you want to update.
params:
- arg_name: min-instances
release_tracks: [ALPHA, BETA, GA]
api_field: connector.minInstances
required: false
help_text: |
If set, updates the minimum number of instances within an autoscaling group underlying the
connector. Value must be between 2 and 9, inclusive, greater than or equal to the currently
set minimum number of instances, and less than the value specified by --max-instances`.
`--max-instances` must be provided
- arg_name: max-instances
release_tracks: [ALPHA, BETA, GA]
api_field: connector.maxInstances
required: false
help_text: |
If set, updates the maximum number of instances within an autoscaling group underlying the
connector. Value must be between 3 and 10, inclusive, greater than or equal to the currently
set maximum number of instances, and greater than the value specified by `--min-instances`.
`--min-instances` must be provided.
- arg_name: machine-type
release_tracks: [ALPHA, BETA, GA]
api_field: connector.machineType
required: false
help_text: |
If set, updates the machine type of VMs underlying the connector. Accepted values are
"e2-micro", "f1-micro", and "e2-standard-4".

View File

@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*- #
# Copyright 2018 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.
"""The command group for locations of Google VPC Access Service."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
class Locations(base.Group):
"""Manage locations resource for VPC Access Service.
Commands for managing locations resource for VPC Access Service.
"""

View File

@@ -0,0 +1,30 @@
- release_tracks: [GA, BETA, ALPHA]
help_text:
brief: |
List VPC Access Service regions
description: |
List all regions where VPC Access Service API is available.
examples: |
The following command lists all the regions where you can create VPC
Access connectors:
$ {command}
request:
collection: vpcaccess.projects.locations
api_version: v1
BETA:
api_version: v1beta1
ALPHA:
api_version: v1alpha1
response:
id_field: name
arguments:
resource:
help_text: The project of the locations to list.
spec: !REF googlecloudsdk.command_lib.compute.networks.vpc_access.resources:project
output:
format: table(name.scope("locations").segment(0):label=REGION:sort=1)

View File

@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*- #
# Copyright 2018 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.
"""The command group for operations of Google VPC Access Service."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
class Operations(base.Group):
"""Manage operations resource for VPC Access Service.
Commands for managing operations resource for VPC Access Service.
"""

View File

@@ -0,0 +1,34 @@
- release_tracks: [GA, BETA, ALPHA]
help_text:
brief: |
Show metadata for a VPC Access Service operation.
description: |
Display all metadata associated with a VPC Access Service operation
given a valid operation name.
This command can fail for the following reasons:
* The operation specified does not exist.
* The active account does not have permission to access the given
operation.
examples: |
The following command prints metadata for an operation with the name
in region `us-central1`:
$ {command} operation-1564112342235-435a134f8c3f8-81bb4b49-0830c1f8
--region=us-central
request:
collection: vpcaccess.projects.locations.operations
api_version: v1
BETA:
api_version: v1beta1
ALPHA:
api_version: v1alpha1
response:
id_field: name
arguments:
resource:
help_text: The operation to describe.
spec: !REF googlecloudsdk.command_lib.compute.networks.vpc_access.resources:operation

View File

@@ -0,0 +1,43 @@
- release_tracks: [GA, BETA, ALPHA]
help_text:
brief: |
List VPC Access Service operations.
description: |
List all VPC Access Service operations under the specified project and
region.
You can specify the maximum number of operations to list using the
`--limit` flag.
examples: |
The following command lists a maximum of five operations in region
`us-central1`:
$ {command} --region=us-central1 --limit=5
request:
collection: vpcaccess.projects.locations.operations
api_version: v1
BETA:
api_version: v1beta1
ALPHA:
api_version: v1alpha1
response:
id_field: name
arguments:
resource:
help_text: The region of the operations to list.
spec: !REF googlecloudsdk.command_lib.compute.networks.vpc_access.resources:region
output:
format: |
table(
name.basename():label=OPERATION_ID,
name.segment(3):label=REGION,
metadata.target.basename(),
metadata.method:label=METHOD,
done,
metadata.firstof(createTime, insertTime).date():label=START_TIME:sort=1:reverse,
metadata.endTime.date().yesno(no="-")
)