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,26 @@
# -*- coding: utf-8 -*- #
# Copyright 2021 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 sub-group for the 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.BETA, base.ReleaseTrack.GA)
class Snapshots(base.Group):
"""Create and manage Filestore snapshots."""

View File

@@ -0,0 +1,71 @@
- release_tracks: [BETA, GA]
help_text:
brief: Create a Filestore snapshot.
description: |
Create a Filestore snapshot of an instance.
This command can fail for the following reasons:
* A snapshot with the same name already exists.
* The active account does not have permission to create snapshots.
* Maximum number of snapshots for the instance has been reached.
* The service tier of the instance does not support snapshots.
examples: |
To create a snapshot with the name ``my-snapshot'' for an instance named
``my-instance'' that's located in ``us-central1'', run:
$ {command} my-snapshot --instance=my-instance --instance-region=us-central1
arguments:
params:
- arg_name: snapshot
is_positional: true
required: true
help_text: |
Name of the Filestore snapshot to be created.
- arg_name: instance
required: true
help_text: |
Name of the Filestore instance that you want to create a snapshot of.
- group:
mutex: true
required: true
params:
- arg_name: instance-region
help_text: |
Region of the Filestore instance.
- arg_name: instance-location
help_text: |
Location of the Filestore instance.
- api_field: snapshot.description
arg_name: description
required: false
help_text: |
Description of the snapshot. Limit: 2048 characters.
- 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:
BETA:
api_version: v1beta1
GA:
api_version: v1
display_resource_type: snapshot
collection: file.projects.locations.instances.snapshots
# Disable validating that a snapshot resource arg is specified (as we are using the
# file.projects.locations.instances.snapshots collection). This collection is populated manually.
disable_resource_check: true
modify_request_hooks:
- googlecloudsdk.command_lib.filestore.instances.snapshots.util:FormatSnapshotCreateRequest

View File

@@ -0,0 +1,61 @@
- release_tracks: [BETA, GA]
help_text:
brief: |
Delete a Filestore snapshot.
description: |
Delete a Filestore snapshot.
This command can fail for the following reasons:
* The snapshot or instance specified does not exist.
* The active account does not have permission to delete the given
snapshot.
examples: |
To delete a snapshot named ``my-snapshot'' for the instance ``my-instance''
from ``us-central1'', run:
$ {command} my-snapshot --instance=my-instance --instance-region=us-central1
arguments:
params:
- arg_name: snapshot
required: true
is_positional: true
help_text: |
Name of the Filestore snapshot to be deleted.
- arg_name: instance
required: true
help_text: |
Name of the Filestore instance the snapshot belongs to.
- group:
mutex: true
required: true
params:
- arg_name: instance-region
help_text: |
Region of the Filestore instance.
- arg_name: instance-location
help_text: |
Location of the Filestore instance.
async:
collection: file.projects.locations.operations
request_issued_message: |-
Delete request issued
input:
confirmation_prompt: |
You are about to delete Filestore snapshot. Are you sure?
request:
BETA:
api_version: v1beta1
GA:
api_version: v1
display_resource_type: snapshot
collection: file.projects.locations.instances.snapshots
# Disable validating that a snapshot resource arg is specified (as we are using the
# file.projects.locations.instances.snapshots collection). This collection is populated manually.
disable_resource_check: true
modify_request_hooks:
- googlecloudsdk.command_lib.filestore.instances.snapshots.util:FormatSnapshotAccessRequest

View File

@@ -0,0 +1,50 @@
- release_tracks: [BETA, GA]
help_text:
brief: Display information about a Filestore snapshot.
description: |
Displays information about a Filestore snapshot given a valid snapshot
name, as well as instance name and instance region.
This command can fail for the following reasons:
* The snapshot or instance specified does not exist.
* The active account does not have permission to access the given
snapshot.
examples: |
To display all information associated with a snapshot of the name
``my-snapshot'' for the instance ``my-instance'' from ``us-central1'', run:
$ {command} my-snapshot --instance=my-instance --instance-region=us-central1
arguments:
params:
- arg_name: snapshot
required: true
is_positional: true
help_text: |
Name of the Filestore snapshot to display information about.
- arg_name: instance
required: true
help_text: |
Name of the Filestore instance the snapshot belongs to.
- group:
mutex: true
required: true
params:
- arg_name: instance-region
help_text: |
Region of the Filestore instance.
- arg_name: instance-location
help_text: |
Location of the Filestore instance.
request:
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: file.projects.locations.instances.snapshots
# Disable validating that a snapshot resource arg is specified (as we are using the
# file.projects.locations.instances.snapshots collection). This collection is populated manually.
disable_resource_check: true
modify_request_hooks:
- googlecloudsdk.command_lib.filestore.instances.snapshots.util:FormatSnapshotAccessRequest

View File

@@ -0,0 +1,58 @@
- release_tracks: [BETA, GA]
help_text:
brief: |
List Filestore snapshots.
description: |
List all Filestore snapshots for the specified instance.
To limit the number of snapshots to list, use the `--limit` flag.
This command can fail for the following reasons:
* Specified instance does not exist.
* The active account does not have permission to list snapshots for the
given instance.
* The service tier of the instance does not support snapshots.
examples: |
To list up to five snapshots for the instance ``my-instance'' from
``us-central1'', run:
$ {command} --instance=my-instance --instance-region=us-central1 --limit=5
arguments:
params:
- arg_name: instance
required: true
help_text: |
Name of the Filestore instance the snapshot belongs to.
- group:
mutex: true
required: true
params:
- arg_name: instance-region
help_text: |
Region of the Filestore instance.
- arg_name: instance-location
help_text: |
Location of the Filestore instance.
request:
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: file.projects.locations.instances.snapshots
# Disable validating that a snapshot resource arg is specified (as we are using the
# file.projects.locations.instances.snapshots collection). This collection is populated manually.
disable_resource_check: true
modify_request_hooks:
- googlecloudsdk.command_lib.filestore.instances.snapshots.util:FormatSnapshotsListRequest
response:
id_field: name
output:
format: |
table(
name.basename():label=NAME:sort=1,
state
)

View File

@@ -0,0 +1,63 @@
- release_tracks: [BETA, GA]
help_text:
brief: |
Update the description or labels of a Filestore snapshot.
description: |
Update the metadata of a Filestore snapshot.
This command can fail for the following reasons:
* The snapshot or instance specified does not exist.
* The active account does not have permission to update the given
snapshot.
examples: |
To update the description of a snapshot named ``my-snapshot'' for the
instance ``my-instance'' from ``us-central1'', run:
$ {command} my-snapshot --instance=my-instance --instance-region=us-central1 --description="A new description."
arguments:
params:
- arg_name: snapshot
is_positional: true
required: true
help_text: |
Name of the Filestore snapshot to be updated.
- arg_name: instance
required: true
help_text: |
Name of the Filestore instance the snapshot belongs to.
- group:
mutex: true
required: true
params:
- arg_name: instance-region
help_text: |
Region of the Filestore instance.
- arg_name: instance-location
help_text: |
Location of the Filestore instance.
- 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.instances.snapshots.util:FormatSnapshotUpdateResponse
async:
collection: file.projects.locations.operations
request:
BETA:
api_version: v1beta1
GA:
api_version: v1
display_resource_type: snapshot
collection: file.projects.locations.instances.snapshots
modify_request_hooks:
- googlecloudsdk.command_lib.filestore.instances.snapshots.util:FormatSnapshotAccessRequest
- googlecloudsdk.command_lib.filestore.instances.snapshots.util:GetExistingSnapshot
- googlecloudsdk.command_lib.filestore.instances.snapshots.util:AddDescription
- googlecloudsdk.command_lib.filestore.instances.snapshots.util:UpdateLabels