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,50 @@
# -*- 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.
"""Command group for Filestore snapshots."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class Snapshots(base.Group):
"""Create and manage Filestore snapshots.
## EXAMPLES
To create a snapshot with the name 'my-snapshot', run:
$ {command} create my-snapshot
To delete a snapshot with the name 'my-snapshot', run:
$ {command} delete my-snapshot
To display the details for an snapshot with the name 'my-snapshot', run:
$ {command} describe my-snapshot
To list all the snapshots, run:
$ {command} list
To set the label 'env' to 'prod' for an snapshot with the name
'my-snapshot', run:
$ {command} my-snapshot --update-labels=env=prod
"""

View File

@@ -0,0 +1,74 @@
- help_text:
brief: |
Create a Filestore snapshot.
description: |
Take a Filestore snapshot of an instance file share.
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 snapshots.
examples: |
To create a snapshot with the name 'my-snapshot' from an instance called 'my-instance' in
'us-central1-c' and the source file share called 'my-fs', run:
$ {command} my-snapshot --instance=my-instance --file-share=my-fs
--instance-zone=us-central1-c
To create a snapshot with the name 'my-snapshot' in a particular region like 'us-central1'
from an instance called 'my-instance' in 'us-central1-c' and the source file share called
'my-fs', run:
$ {command} my-snapshot --instance=my-instance --file-share=my-fs
--instance-zone=us-central1-c --region=us-central1
arguments:
params:
- arg_name: snapshot
is_positional: true
required: true
help_text: |
Arguments and flags that specify the Filestore snapshot you want to
create.
- arg_name: instance
required: true
help_text: |
Share name of the Filestore instance you want to snapshot.
- arg_name: instance-zone
required: true
help_text: |
Zone of the Filestore instance.
- arg_name: region
help_text: |
Region (e.g. us-central1) for the regional snapshot.
- api_field: snapshot.sourceFileShare
arg_name: file-share
required: true
help_text: |
File share name on the Filestore instance to snapshot.
- api_field: snapshot.labels.additionalProperties
arg_name: labels
metavar: KEY=VALUE
required: false
help_text: |
List of label KEY=VALUE pairs to add.
type:
arg_dict:
flatten: true
spec:
- api_field: key
- api_field: value
async:
collection: file.projects.locations.operations
request:
api_version: v1p1alpha1
display_resource_type: snapshot
collection: file.projects.locations.snapshots
# Disable validating that a snapshots resource arg is specified (as we are using the
# file.projects.locations.snapshots collection). This collection is populated manually.
disable_resource_check: true
modify_request_hooks:
- googlecloudsdk.command_lib.filestore.snapshots.util:FormatSnapshotCreateRequest
- googlecloudsdk.command_lib.filestore.snapshots.util:AddInstanceNameToRequest

View File

@@ -0,0 +1,51 @@
- help_text:
brief: |
Delete a Filestore snapshot.
description: |
Delete a Filestore snapshot.
This command can fail for the following reasons:
* The snapshot specified does not exist.
* The active account does not have permission to delete the given
snapshot.
examples: |
The following command deletes a snapshot with the name 'my-snapshot' in the region
us-central1:
$ {command} my-snapshot --region=us-central1
arguments:
params:
- arg_name: snapshot
is_positional: true
help_text: |
Arguments and flags that specify the Filestore snapshot you want to
delete.
- group:
mutex: true
required: true
params:
- arg_name: zone
help_text: |
Compute zone (e.g. us-central1-c) for the snapshot.
- arg_name: region
help_text: |
Compute region (e.g. us-central1) for the snapshot.
async:
collection: file.projects.locations.operations
request_issued_message: |-
Delete request issued
input:
confirmation_prompt: |
You are about to delete a snapshot
request:
api_version: v1p1alpha1
display_resource_type: snapshot
collection: file.projects.locations.snapshots
disable_resource_check: true
modify_request_hooks:
- googlecloudsdk.command_lib.filestore.snapshots.util:FormatSnapshotAccessRequest

View File

@@ -0,0 +1,40 @@
- help_text:
brief: |
Describe a Filestore snapshot.
description: |
Displays all data associated with a Filestore snapshot given a valid snapshot name.
This command can fail for the following reasons:
* The snapshot specified does not exist.
* The active account does not have permission to access the given
snapshot.
examples: |
To display all data associated with a snapshot of the name 'my-snapshot' in the
region us-central1:
$ {command} my-snapshot --region=us-central1
arguments:
params:
- arg_name: snapshot
is_positional: true
help_text: |
Arguments and flags that specify the Filestore snapshot you want to
create.
- group:
mutex: true
required: true
params:
- arg_name: zone
help_text: |
Zone (e.g. us-central1-c) for the snapshot.
- arg_name: region
help_text: |
Region (e.g. us-central1) for the snapshot.
request:
api_version: v1p1alpha1
collection: file.projects.locations.snapshots
disable_resource_check: true
modify_request_hooks:
- googlecloudsdk.command_lib.filestore.snapshots.util:FormatSnapshotAccessRequest

View File

@@ -0,0 +1,49 @@
- help_text:
brief: |
List Filestore snapshots.
description: |
List all Filestore snapshots under the specified project and region.
To specify the maximum number of snapshots to list, use the --limit flag.
examples: |
To list up to five snapshots, run:
$ {command} --limit=5
arguments:
resource:
help_text: |
Project name.
spec: !REF googlecloudsdk.command_lib.filestore.resources:project
override_resource_collection: true
params:
- group:
mutex: true
params:
- arg_name: zone
help_text: |
The zone of the Local Snapshots to display. If unspecified, all snapshots will be
listed.
- arg_name: region
help_text: |
The region of the Snapshots to display. If unspecified, all snapshots will be listed.
request:
api_version: v1p1alpha1
collection: file.projects.locations.snapshots
modify_request_hooks:
- googlecloudsdk.command_lib.filestore.util:AddDefaultLocationToListRequest
response:
id_field: name
output:
format: |
table(
name.basename():label=NAME:sort=1,
name.segment(3):label=LOCATION,
sourceInstance.split('/').slice(3:).join('/'):label=SRC_INSTANCE,
sourceFileShare:label=SRC_FILE_SHARE,
state
)

View File

@@ -0,0 +1,55 @@
- help_text:
brief: |
Update a Filestore snapshot.
description: |
Update the metadata of a Filestore snapshot.
This command can fail for the following reasons:
* The snapshot specified does not exist.
* The active account does not have permission to update the given
snapshot.
examples: |
The following command updates the Filestore Snapshot named 'my-snapshot' in region
us-central1 to change the description to 'A new description.'
$ {command} my-snapshot --region=us-central1 --description="A new description."
arguments:
params:
- arg_name: snapshot
is_positional: true
help_text: |
Arguments and flags that specify the Filestore snapshot you want to
update.
- group:
mutex: true
required: true
params:
- arg_name: zone
help_text: |
Compute zone (e.g. us-central1-c) for the snapshot.
- arg_name: region
help_text: |
Compute region (e.g. us-central1) for the snapshot.
- arg_name: description
api_field: snapshot.description
help_text: |
Description of the snapshot.
additional_arguments_hook: googlecloudsdk.command_lib.filestore.update_util:UpdateLabelsFlags
response:
modify_response_hooks:
- googlecloudsdk.command_lib.filestore.snapshots.update_util:FormatSnapshotUpdateResponse
async:
collection: file.projects.locations.operations
request:
api_version: v1p1alpha1
display_resource_type: snapshot
collection: file.projects.locations.snapshots
modify_request_hooks:
- googlecloudsdk.command_lib.filestore.snapshots.util:FormatSnapshotAccessRequest
- googlecloudsdk.command_lib.filestore.snapshots.update_util:GetExistingSnapshot
- googlecloudsdk.command_lib.filestore.snapshots.update_util:AddDescription
- googlecloudsdk.command_lib.filestore.snapshots.update_util:UpdateLabels