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 2020 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 backups."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA,
base.ReleaseTrack.GA)
class Backups(base.Group):
"""Create and manage Filestore backups.
## EXAMPLES
To create a backup with the name 'my-backup', run:
$ {command} create my-backup --region=Region
To delete a backup with the name 'my-backup', run:
$ {command} delete my-backup --region=Region
To display the details for an backup with the name 'my-backup', run:
$ {command} describe my-backup --region=Region
To list all the backups, run:
$ {command} list [--region=Region]
To set the label 'env' to 'prod' for an backup with the name
'my-backup', run:
$ {command} my-backup --update-labels=env=prod
"""

View File

@@ -0,0 +1,109 @@
- release_tracks: [GA, BETA, ALPHA]
help_text:
brief: Create a Filestore backup.
description: |
Create a Filestore backup of an instance file share.
This command can fail for the following reasons:
* A backup with the same name already exists.
* The active account does not have permission to create backups.
examples: |
To create a backup with the name 'my-backup' and description 'My backup description' 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-backup --instance=my-instance --file-share=my-fs --instance-zone=us-central1-c --region=us-central1 --description="My backup description"
arguments:
params:
- arg_name: backup
is_positional: true
required: true
help_text: |
Arguments and flags that specify the Filestore backup you want to
create.
- arg_name: instance
required: true
help_text: |
Share name of the Filestore instance you want to backup.
- arg_name: region
required: true
help_text: |
Region (e.g. us-central1) for the backup.
- group:
mutex: true
required: true
params:
- arg_name: instance-zone
help_text: |
Zone of the Filestore instance.
- arg_name: instance-location
release_tracks: [BETA, GA]
help_text: |
Region of the Filestore instance.
- api_field: backup.description
arg_name: description
required: false
help_text: |
Description for the backup. Limit: 2048 characters.
- api_field: backup.kmsKeyName
arg_name: kms-key
required: false
release_tracks: [BETA]
help_text: |
CMEK for backup in the form of `projects/{project}/locations/{location}/keyRings/{key-ring}/cryptoKeys/{crypto-key}`
- api_field: backup.kmsKey
arg_name: kms-key
required: false
release_tracks: [GA]
help_text: |
CMEK for backup in the form of `projects/{project}/locations/{location}/keyRings/{key-ring}/cryptoKeys/{crypto-key}`
- api_field: backup.sourceFileShare
arg_name: file-share
required: true
help_text: |
File share name on the Filestore instance to backup.
- api_field: backup.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
- api_field: backup.tags.additionalProperties
arg_name: tags
release_tracks: [BETA, GA]
required: false
metavar: KEY=VALUE
help_text: |
List of tag KEY=VALUE pairs to add.
type:
arg_dict:
flatten: true
spec:
- api_field: key
- api_field: value
async:
collection: file.projects.locations.operations
request:
ALPHA:
api_version: v1p1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
display_resource_type: backup
collection: file.projects.locations.backups
# Disable validating that a backups resource arg is specified (as we are using the
# file.projects.locations.backups collection). This collection is populated manually.
disable_resource_check: true
modify_request_hooks:
- googlecloudsdk.command_lib.filestore.backups.util:FormatBackupCreateRequest
- googlecloudsdk.command_lib.filestore.backups.util:AddInstanceNameToRequest

View File

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

View File

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

View File

@@ -0,0 +1,47 @@
- release_tracks: [GA, BETA, ALPHA]
help_text:
brief: |
List Filestore backups.
description: |
List all Filestore backups in a project for either a specified region or for all region.
To specify the maximum number of backups to list, use the --limit flag.
examples: |
To list up to five backups, run:
$ {command} --limit=5
arguments:
params:
- arg_name: region
help_text: |
The region of the Backups to display. If unspecified, all backups will be listed.
resource:
help_text: |
Project name.
spec: !REF googlecloudsdk.command_lib.filestore.resources:project
override_resource_collection: true
request:
ALPHA:
api_version: v1p1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: file.projects.locations.backups
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,56 @@
- release_tracks: [GA, BETA, ALPHA]
help_text:
brief: |
Update a Filestore backup.
description: |
Update the metadata of a Filestore backup.
This command can fail for the following reasons:
* The backup specified does not exist.
* The active account does not have permission to update the given
backup.
examples: |
The following command updates the Filestore Backup named 'my-backup' in region
us-central1 to change the description to 'A new description.'
$ {command} my-backup --region=us-central1 --description="A new description."
arguments:
params:
- arg_name: backup
is_positional: true
required: true
help_text: |
Arguments and flags that specify the Filestore backup you want to
update.
- arg_name: region
required: true
help_text: |
Compute region (e.g. us-central1) for the backup.
- arg_name: description
api_field: backup.description
help_text: |
Description of the backup.
additional_arguments_hook: googlecloudsdk.command_lib.filestore.update_util:UpdateLabelsFlags
response:
modify_response_hooks:
- googlecloudsdk.command_lib.filestore.backups.update_util:FormatBackupUpdateResponse
async:
collection: file.projects.locations.operations
request:
ALPHA:
api_version: v1p1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
display_resource_type: backup
collection: file.projects.locations.backups
modify_request_hooks:
- googlecloudsdk.command_lib.filestore.backups.util:FormatBackupAccessRequest
- googlecloudsdk.command_lib.filestore.backups.update_util:GetExistingBackup
- googlecloudsdk.command_lib.filestore.backups.update_util:AddDescription
- googlecloudsdk.command_lib.filestore.backups.update_util:UpdateLabels