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,25 @@
# -*- coding: utf-8 -*- #
# Copyright 2022 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 Cloud Memorystore Cluster for Redis."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
class Clusters(base.Group):
"""Manage Memorystore for Redis Cluster instances."""

View File

@@ -0,0 +1,64 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Add more cluster endpoints.
description: |
This is required to enable multi-vpc for Redis cluster.
To add one cluster endpoint to an existing Redis cluster, two PSC connections MUST be added as a pair: one for the Redis cluster's discovery service attachment and the other for the additional service attachment.
Multiple cluster endpoints COULD be added simultaneously.
This command can fail for the following reasons:
* The cluster specified does not exist.
* The number of connections provided to a cluster endpoint are not in pairs.
* One of the connections is not found.
examples: |
To connect redis cluster to one additional VPC, run:
$ {command} my-redis-cluster add-cluster-endpoints --cluster-endpoint='["psc-connection":[{"psc-connection-id":"$ID","address":"$IP","network":"projects/$PROJECT/global/networks/$NETWORK","forwarding-rule":"projects/$PROJECT/regions/us-east1/forwardingRules/$FR_NAME","service-attachment":"projects/$PROJECT/regions/$REGION/serviceAttachments/$SA_NAME"},{$ADDITIONAL_PSC_CONNECTION}]]' --cluster_endpoint=$ADDITIONAL_CLUSTER_ENDPOINT
$PSCConnectionID SHOULD be extracted from forwarding rules. E.g. 75311697652483351
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:cluster
help_text: |
Arguments and flags that specify the Memorystore Redis cluster you want to update.
params:
- arg_name: cluster-endpoint
api_field: cluster.clusterEndpoints
repeated: true
required: true
help_text: |
Resource details of a redis cluster endpoint
type: arg_object
spec:
- api_field: connections
json_name: psc-connection
type: arg_object
spec:
- api_field: pscConnection.pscConnectionId
json_name: psc-connection-id
- api_field: pscConnection.network
json_name: network
- api_field: pscConnection.address
json_name: address
- api_field: pscConnection.forwardingRule
json_name: forwarding-rule
- api_field: pscConnection.serviceAttachment
json_name: service-attachment
async:
collection: redis.projects.locations.operations
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
modify_request_hooks:
- googlecloudsdk.command_lib.redis.psc_update_util:UpdateClusterEndpoints
collection: redis.projects.locations.clusters
method: patch

View File

@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*- #
# Copyright 2024 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 backup collections of Cloud Memorystore Cluster for Redis."""
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)
@base.DefaultUniverseOnly
class BackupCollections(base.Group):
"""Manage backup collections of Memorystore for Redis Cluster instances."""

View File

@@ -0,0 +1,35 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Show metadata for a backup collection.
description: |
Show metadata for a backup collection.
Displays all metadata associated with a backup collection.
This command can fail for the following reasons:
* The backup collection specified does not exist.
* The active account does not have permission to access the given
backup collection.
examples: |
To display the metadata for a backup collection with the name `my-backup-collection`
in the us-central1 region, run:
$ {commmand} my-backup-collection --region=us-central1
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:backup_collection
help_text: |
Arguments and flags that specify the backup collection you want to describe.
is_positional: true
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: redis.projects.locations.backupCollections

View File

@@ -0,0 +1,40 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
List backup collections in a region.
description: |
List all backup collections under the specified project and region.
To specify the maximum number of results, use the `--limit` flag.
examples: |
To list up to 5 backup collections in the us-central1 region, run:
$ {command} --region=us-central1 --limit=5
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:region
help_text: |
The region of the backup collections to display.
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: redis.projects.locations.backupCollections
response:
id_field: name
output:
format: |
table(
name.basename():label=BACKUP_COLLECTION_NAME:sort=2,
cluster:label=CLUSTER_NAME,
clusterUid:label=CLUSTER_UID
)

View File

@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*- #
# Copyright 2024 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 backups of Cloud Memorystore Cluster for Redis."""
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)
@base.DefaultUniverseOnly
class Backups(base.Group):
"""Manage backups of Memorystore for Redis Cluster instances."""

View File

@@ -0,0 +1,40 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Delete a Memorystore for Redis Cluster backup.
description: |
Delete a Memorystore for Redis Cluster backup.
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 delete a backup with the name `my-backup` under backup collection `my-backup-collection`
in `us-central1` region, run:
$ {command} my-backup --backup-collection=my-backup-collection --region=us-central1
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:backup
help_text:
Arguments and flags that specify the Redis backup you want to delete.
async:
collection: redis.projects.locations.operations
input:
confirmation_prompt: |
You are about to delete backup [{__name__}] in [{locationsId}].
Any associated data will be lost.
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: redis.projects.locations.backupCollections.backups

View File

@@ -0,0 +1,34 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Show metadata for a Memorystore for Redis Cluster backup.
description: |
Show metadata for a Memorystore for Redis Cluster backup.
Displays all metadata associated with a 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 the metadata for a backup named `my-backup`, under `my-collection`
backup collection, in `us-central1` region, run:
$ {command} my-backup --backup_collection=my-collection --region=us-central1
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:backup
help_text: |
Arguments and flags that specify the backup you want to describe.
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: redis.projects.locations.backupCollections.backups

View File

@@ -0,0 +1,40 @@
- release_tracks: [ALPHA, BETA, GA]
command_type: GENERIC
help_text:
brief: |
Export a Redis cluster backup to a Google Cloud Storage bucket.
description: |
This command exports a Redis cluster backup to a Google Cloud Storage bucket.
A new folder will be created in the bucket with the backup name. And the backup files will be
stored in the folder.
examples: |
To export a backup with name `my-backup` under backup collection `my-collection`
in `us-central` region to `my-bucket` Google Cloud Storage bucket, run:
$ {command} my-backup --backup-collection=my-collection --region=us-central1 --bucket-name=my-bucket
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:backup
help_text:
Arguments and flags that specify the Redis backup you want to export.
params:
- arg_name: gcs-bucket
api_field: exportBackupRequest.gcsBucket
required: true
help_text: |
The name of the Google Cloud Storage bucket to export the backup to.
async:
collection: redis.projects.locations.operations
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: redis.projects.locations.backupCollections.backups
method: export

View File

@@ -0,0 +1,40 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
List backups under a backup collection in a region.
description: |
List backups under a backup collection in a region.
To specify the maximum number of results, use the `--limit` flag.
examples: |
To list up to 5 backups in the us-central1 region, run:
$ {command} --backup-collection=my-collection --region=us-central1 --limit=5
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:backup_collection
help_text: |
The backup collection of the backups to display.
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: redis.projects.locations.backupCollections.backups
response:
id_field: name
output:
format: |
table(
name.basename():label=BACKUP_NAME,
state:label=STATE,
createTime:label=CREATE_TIME:sort=1,
expireTime:label=EXPIRE_TIME:sort=2
)

View File

@@ -0,0 +1,285 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Create a new Memorystore for Redis Cluster instance.
description: |
Create a new Memorystore for Redis Cluster instance, and uses Private Service Connect service connectivity automation to automate connectivity for instances.
This command can fail for the following reasons:
* A cluster with the same name already exists.
* The active account does not have permission to create clusters.
* Some required APIs not enabled yet.
* No connection policy defined yet on the network and in the region a cluster will be created.
* Miss the steps for creating and configuring a service account (to grant permissions) in both host project and service project, if a shared VPC network is used.
Refer to https://cloud.google.com/memorystore/docs/cluster/networking#prerequisites_required_before_creating_a_cluster for prerequisites.
examples: |
To create a cluster with name `my-redis-cluster` in region `us-central1`
with 3 shards and with a discovery endpoint created on network "default", run:
$ {command} my-redis-cluster --region=us-central1 --shard-count=3 \
--network=projects/NETWORK_PROJECT_ID/global/networks/default
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:cluster
help_text: |
Arguments and flags that specify the cluster you want to create.
Your cluster ID must be 1 to 63 characters and use only lowercase letters, numbers, or
hyphens. It must start with a lowercase letter and end with a lowercase letter or number.
params:
- arg_name: node-type
api_field: cluster.nodeType
help_text: Node Type of the redis cluster Node.
choices:
- enum_value: REDIS_HIGHMEM_MEDIUM
arg_value: redis-highmem-medium
- enum_value: REDIS_HIGHMEM_XLARGE
arg_value: redis-highmem-xlarge
- enum_value: REDIS_STANDARD_SMALL
arg_value: redis-standard-small
- enum_value: REDIS_SHARED_CORE_NANO
arg_value: redis-shared-core-nano
- arg_name: network
api_field: cluster.pscConfigs.network
help_text: |
The network used to create your instance. It must use the format:
projects/NETWORK_PROJECT_ID/global/networks/NETWORK_ID.
The network ID used here must match the network ID used by the service connection policy.
Otherwise, the create operation fails
- arg_name: auth-mode
api_field: cluster.authorizationMode
help_text: |
Available authorization mode of a Redis cluster.
choices:
- enum_value: AUTH_MODE_DISABLED
arg_value: disabled
help_text: |
Authorization is disabled for the cluster.
- enum_value: AUTH_MODE_IAM_AUTH
arg_value: iam-auth
help_text: |
IAM basic authorization is enabled for the cluster.
- arg_name: replica-count
api_field: cluster.replicaCount
type: int
help_text: |
The replica count of each shard.
- arg_name: shard-count
api_field: cluster.shardCount
type: int
help_text: |
The shard count of the cluster.
- arg_name: transit-encryption-mode
api_field: cluster.transitEncryptionMode
help_text: |
Transit encryption mode used for the Redis cluster.
If not provided, encryption is disabled for the cluster.
choices:
- enum_value: TRANSIT_ENCRYPTION_MODE_DISABLED
arg_value: disabled
help_text: |
In-transit encryption is disabled for the cluster.
- enum_value: TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION
arg_value: server-authentication
help_text: |
The cluster uses server managed encryption for in-transit encryption.
- arg_name: deletion-protection
api_field: cluster.deletionProtectionEnabled
type: bool
# To distinguish b/w unset and default value. Otherwise, the request is always sent with
# deletionProtectionEnabled=false.
default: null
help_text: |
Enable deletion protection for the Redis Cluster. Use
`--deletion-protection`/`--no-deletion-protection` to enable/disable it.
- arg_name: redis-config
api_field: cluster.redisConfigs.additionalProperties
metavar: KEY=VALUE
help_text: |
A list of Redis config KEY=VALUE pairs to set on the Redis Cluster according to
http://redis.io/topics/config. Currently the supported Redis configs are:
maxmemory-clients, maxmemory, maxmemory-policy, notify-keyspace-events,
slowlog-log-slower-than, maxclients.
type:
arg_dict:
flatten: true
spec:
- api_field: key
- api_field: value
- arg_name: zone-distribution-mode
api_field: cluster.zoneDistributionConfig.mode
help_text: |
Determines how the cluster nodes are distributed across zones.
choices:
- enum_value: MULTI_ZONE
arg_value: multi-zone
help_text: |
Allocate cluster nodes across multiple zones.
- enum_value: SINGLE_ZONE
arg_value: single-zone
help_text: |
Allocate cluster nodes in a single zone.
- arg_name: zone
api_field: cluster.zoneDistributionConfig.zone
help_text: |
The zone used to allocate the cluster nodes. Applicable only if the zone-distribution-mode
is set to single-zone.
- arg_name: persistence-mode
api_field: cluster.persistenceConfig.mode
help_text: |
Operation mode for persistence.
choices:
- enum_value: DISABLED
arg_value: disabled
help_text: Persistence mode is disabled
- enum_value: RDB
arg_value: RDB
help_text: RDB-based persistence
- enum_value: AOF
arg_value: AOF
help_text: AOF-based persistence
- arg_name: rdb-snapshot-period
api_field: cluster.persistenceConfig.rdbConfig.rdbSnapshotPeriod
help_text: |
Attempted period between RDB snapshots.
choices:
- enum_value: ONE_HOUR
arg_value: 1h
help_text: 1 hour
- enum_value: SIX_HOURS
arg_value: 6h
help_text: 6 hours
- enum_value: TWELVE_HOURS
arg_value: 12h
help_text: 12 hours
- enum_value: TWENTY_FOUR_HOURS
arg_value: 24h
help_text: (default) 24 hours
- arg_name: rdb-snapshot-start-time
api_field: cluster.persistenceConfig.rdbConfig.rdbSnapshotStartTime
help_text: |
Date and time of the first snapshot in the ISO 1801 format, and alignment time for future snapshots. For example, 2024-01-01T01:00:00Z.
If not specified, the current time will be used.
- arg_name: aof-append-fsync
api_field: cluster.persistenceConfig.aofConfig.appendFsync
help_text: |
Fsync configuration.
choices:
- enum_value: NO # yamllint disable-line rule:truthy
arg_value: no # yamllint disable-line rule:truthy
help_text: |
Redis will not explicitly call fsync.
- enum_value: EVERYSEC
arg_value: everysec
help_text: |
(default) Redis explicitly calls fsync every second.
- enum_value: ALWAYS
arg_value: always
help_text: |
Redis explicitly calls fsync for every write command.
- arg_name: maintenance-window-day
api_field: cluster.maintenancePolicy.weeklyMaintenanceWindow.day
choices:
- arg_value: monday
enum_value: MONDAY
- arg_value: tuesday
enum_value: TUESDAY
- arg_value: wednesday
enum_value: WEDNESDAY
- arg_value: thursday
enum_value: THURSDAY
- arg_value: friday
enum_value: FRIDAY
- arg_value: saturday
enum_value: SATURDAY
- arg_value: sunday
enum_value: SUNDAY
help_text: |
Day of week when the window starts, e.g. `sunday`.
- arg_name: maintenance-window-hour
api_field: cluster.maintenancePolicy.weeklyMaintenanceWindow.startTime.hours
help_text: |
Hour of day (`0` to `23`) for the start of maintenance window, in UTC time zone.
processor: googlecloudsdk.command_lib.redis.clusters_update_util:CheckMaintenanceWindowStartTimeField
- arg_name: cross-cluster-replication-role
api_field: cluster.crossClusterReplicationConfig.clusterRole
help_text: |
The role of the cluster in cross cluster replication.
choices:
- enum_value: SECONDARY
arg_value: secondary
help_text: |
Create a secondary cluster.
- arg_name: primary-cluster
api_field: cluster.crossClusterReplicationConfig.primaryCluster.cluster
help_text: |
The primary cluster that the secondary cluster will replicate from. It must use the format:
projects/PROJECT_ID/locations/REGION/clusters/CLUSTER_ID. It must refer to an existing cluster. Otherwise, the create operation fails.
- arg_name: automated-backup-mode
api_field: cluster.automatedBackupConfig.automatedBackupMode
help_text: |
Automated backup mode
choices:
- enum_value: DISABLED
arg_value: disabled
help_text: |
(default) Automated backup is disabled.
- enum_value: ENABLED
arg_value: enabled
help_text: |
Automated backup is enabled.
- arg_name: automated-backup-start-time
api_field: cluster.automatedBackupConfig.fixedFrequencySchedule.startTime
help_text: |
One-hour window when you want automated-backup operations to start. Specify the time in the format HH:00 on a 24-hour cycle in UTC time.
ALPHA:
processor: googlecloudsdk.command_lib.redis.cluster_util:ParseTimeOfDayAlpha
BETA:
processor: googlecloudsdk.command_lib.redis.cluster_util:ParseTimeOfDayBeta
GA:
processor: googlecloudsdk.command_lib.redis.cluster_util:ParseTimeOfDayGa
- arg_name: automated-backup-ttl
api_field: cluster.automatedBackupConfig.retention
type: googlecloudsdk.core.util.times:ParseDuration
processor: googlecloudsdk.core.util.times:FormatDurationForJson
help_text: |
Time to live for automated backups. A backup will be deleted automatically after the TTL
is reached. It ranges from 1 day to 365 days. For example, "10d" for 10 days. If not specified, the default value is 35 days.
- group:
mutex: true
params:
- arg_name: import-gcs-object-uris
type: 'googlecloudsdk.calliope.arg_parsers:ArgList:'
api_field: cluster.gcsSource.uris
help_text: |
URIs of Google Cloud Storage objects to import from. For example, `gs://bucket/folder/file1.rdb,gs://bucket/folder/file2.rdb`.
- arg_name: import-managed-backup
api_field: cluster.managedBackupSource.backup
help_text: |
Managed backup to import from. For example, `projects/PROJECT_ID/locations/REGION/backupCollections/BACKUP_COLLECTION_ID/backups/BACKUP_ID`.
- arg_name: kms-key
api_field: cluster.kmsKey
help_text: |
The resource name of the customer-managed encryption key (CMEK) to use for the cluster.
It must use this format:
projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/CRYPTO_KEY.
The key must be in the same region as the cluster. Otherwise, the create operation fails.
async:
collection: redis.projects.locations.operations
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: redis.projects.locations.clusters
output:
format: yaml

View File

@@ -0,0 +1,47 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Create a backup of a Redis cluster.
description: |
Create a backup of a Redis cluster. The backup can be used to seed a new cluster or
exported to a Google Cloud Storage bucket.
The created backup will be added into the backup collection associated with the cluster.
Describe the cluster to get the backup collection name.
example: |
To create a new backup, run:
$ {command} my-cluster --backup-id=my-backup --ttl=7d --region=us-central1
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:cluster
help_text: |
Arguments and flags that specify the Memorystore Redis cluster to create a backup for.
params:
- arg_name: backup-id
api_field: backupClusterRequest.backupId
help_text: |
The ID of the backup.
- arg_name: ttl
api_field: backupClusterRequest.ttl
type: googlecloudsdk.core.util.times:ParseDuration
processor: googlecloudsdk.core.util.times:FormatDurationForJson
help_text: |
The time to live for the backup. The backup will be deleted automatically after the TTL
is reached. For example, "10d" for 10 days. The minimum value is 1 day. If not specified, the
default value is 100 years.
async:
collection: redis.projects.locations.operations
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: redis.projects.locations.clusters
method: backup

View File

@@ -0,0 +1,39 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Delete a Memorystore for Redis Cluster instance.
description: |
Delete a Memorystore for Redis Cluster instance.
This command can fail for the following reasons:
* The cluster specified does not exist.
* The active account does not have permission to access the given
cluster.
examples: |
To delete a cluster with the name `my-redis-cluster` in your default region, run:
$ {command} my-redis-cluster
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:cluster
help_text: |
Arguments and flags that specify the cluster you want to delete.
async:
collection: redis.projects.locations.operations
input:
confirmation_prompt: |
You are about to delete cluster [{__name__}] in [{locationsId}].
Any associated data will be lost.
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: redis.projects.locations.clusters

View File

@@ -0,0 +1,35 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Show metadata for a Memorystore for Redis Cluster instance.
description: |
Show metadata for a Memorystore for Redis Cluster instance.
Displays all metadata associated with a cluster given a valid
cluster name.
This command can fail for the following reasons:
* The cluster specified does not exist.
* The active account does not have permission to access the given
cluster.
examples: |
To display the metadata for a cluster with the name `my-redis-cluster`
in the default region, run:
$ {command} my-redis-cluster
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:cluster
help_text: |
Arguments and flags that specify the cluster you want to describe.
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: redis.projects.locations.clusters

View File

@@ -0,0 +1,38 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Detach a secondary cluster.
description: |
Detach a secondary cluster from the primary cluster.
After detachment, the secondary cluster becomes an independent cluster, i.e. it stops replicating
from the primary cluster and it now accepts both read and write requests.
This command is only supported on secondary clusters.
examples: |
To detach a secondary cluster with name `my-secondary-cluster` in region `us-central1`, run:
$ {command} my-secondary-cluster --region=us-central1
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:cluster
help_text: |
Arguments and flags that specify the Memorystore Redis cluster you want to update.
async:
collection: redis.projects.locations.operations
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: redis.projects.locations.clusters
method: patch
modify_request_hooks:
- googlecloudsdk.command_lib.redis.clusters_ccr_util:Detach

View File

@@ -0,0 +1,45 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Detach one or more secondary clusters from the primary cluster.
description: |
Detach one or more secondary clusters from the primary cluster.
After detachment, the secondary clusters become independent clusters, i.e. they stop replicating
from the primary cluster and will now accept both read and write requests.
This command is only supported on primary clusters.
examples: |
To detach the secondary clusters `my-secondary-cluster1` and `my-secondary-cluster2` from the primary cluster `my-primary-cluster`, run:
$ {command} my-primary-cluster --region=us-central1 --clusters-to-detach=projects/my-project/locations/us-east1/clusters/my-secondary-cluster1,projects/my-project/locations/asia-east1/clusters/my-secondary-cluster2
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:cluster
help_text: |
Arguments and flags that specify the Memorystore Redis cluster you want to update.
params:
- arg_name: clusters-to-detach
required: true
help_text: |
Comma separated list of secondary clusters to detach from the primary cluster.
Each element in the list should be in the format: `projects/PROJECT_ID/locations/REGION/clusters/CLUSTER_ID`.
async:
collection: redis.projects.locations.operations
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: redis.projects.locations.clusters
method: patch
modify_request_hooks:
- googlecloudsdk.command_lib.redis.clusters_ccr_util:DetachSecondaries

View File

@@ -0,0 +1,35 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Get the certificate authority information for a Memorystore for Redis Cluster instance.
description: |
Get the certificate authority information for a Memorystore for Redis Cluster instance.
This command can fail for the following reasons:
* The cluster specified does not exist.
* The active account does not have permission to access the given
cluster.
examples: |
To get the metadata for a cluster with the name `my-redis-cluster`
in the default region, run:
$ {command} my-redis-cluster
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:cluster
help_text: |
Arguments and flags that specify the cluster.
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: redis.projects.locations.clusters
method: getCertificateAuthority
modify_request_hooks:
- googlecloudsdk.command_lib.redis.util:UpdateGetCertificateAuthorityRequestPath

View File

@@ -0,0 +1,46 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
List Memorystore for Redis Cluster instances.
description: |
List all clusters under the specified project and region.
To specify the maximum number of clusters to list, use the --limit flag.
examples: |
To list up to five clusters, run:
$ {command} --limit=5
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:region
help_text: |
The region of the clusters to display.
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: redis.projects.locations.clusters
response:
id_field: name
output:
format: |
table(
name.basename():label=CLUSTER_NAME:sort=2,
state:label=STATUS,
name.segment(3):label=REGION,
nodeType:label=NODE_TYPE,
preciseSizeGb:label=PRECISE_SIZE_GB,
sizeGb:label=SIZE_GB,
shardCount:label=SHARD_COUNT,
replicaCount:label=REPLICA_COUNT,
createTime.date()
)

View File

@@ -0,0 +1,53 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Remove existing Memorystore cluster endpoints.
description: |
To remove one cluster endpoint from an existing Redis cluster, two PSC connections MUST be removed as a pair: one to the Redis cluster's discovery service attachment and the other to its additional service attachment.
Multiple cluster endpoints COULD be removed simultaneously.
This command can fail for the following reasons:
* The cluster specified does not exist.
* Some connections in the to be removed list do not exist.
examples: |
To remove an endpoint from redis cluster, run:
$ {command} my-redis-cluster remove-cluster-endpoints --cluster-endpoint='["psc-connection":[{"psc-connection-id":"$PSC_CONNECTION_ID"},{$ADDITIONAL_PSC_CONNECTION}]]' --cluster_endpoint=$ADDITIONAL_CLUSTER_ENDPOINT
$PSCConnectionID SHOULD be extracted from forwarding rules. E.g. 75311697652483351
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:cluster
help_text: |
Arguments and flags that specify the Memorystore Redis cluster you want to update.
params:
- arg_name: cluster-endpoint
api_field: cluster.clusterEndpoints
repeated: true
required: true
help_text: |
Resource details of a redis cluster endpoint
type: arg_object
spec:
- api_field: connections
json_name: psc-connection
type: arg_object
spec:
- api_field: pscConnection.pscConnectionId
json_name: psc-connection-id
async:
collection: redis.projects.locations.operations
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
modify_request_hooks:
- googlecloudsdk.command_lib.redis.psc_update_util:RemoveClusterEndpoints
collection: redis.projects.locations.clusters
method: patch

View File

@@ -0,0 +1,49 @@
release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Reschedule maintenance window for a Memorystore for
Redis Cluster instance.
description: |
Reschedule maintenance window for a Memorystore for
Redis Cluster instance.
examples: |
To reschedule maintenance window for an instance with the name 'my-redis-cluster' in region
'us-central-1' with immediate, run:
$ {command} my-redis-cluster --region=us-central1 --reschedule-type=IMMEDIATE
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:cluster
help_text: |
Arguments and flags that specify the Cloud Memorystore for Redis cluster instance you
want to reschedule maintenance window.
params:
- arg_name: reschedule-type
api_field: rescheduleClusterMaintenanceRequest.rescheduleType
required: true
choices:
- arg_value: IMMEDIATE
enum_value: IMMEDIATE
help_text: Reschedule the maintenance to perform now.
- arg_value: SPECIFIC-TIME
enum_value: SPECIFIC_TIME
help_text: Reschedule the maintenance to a specific time.
help_text: |
Reschedule type to use for the reschedule maintenance window.
- arg_name: schedule-time
api_field: rescheduleClusterMaintenanceRequest.scheduleTime
help_text: |
Time in RFC3339 format, for example: 2012-11-15T16:19:00.094Z
async:
collection: redis.projects.locations.operations
request:
ALPHA:
api_version: v1alpha1
modify_request_hooks:
- googlecloudsdk.command_lib.redis.clusters_reschedule_util:CheckSpecificTimeField
collection: redis.projects.locations.clusters
method: rescheduleClusterMaintenance

View File

@@ -0,0 +1,39 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Switchover to a secondary cluster.
description: |
This command promotes the secondary cluster to become the new primary cluster. The old primary
and other secondary clusters will automatically become the secondary clusters of this cluster.
After the successful completion of this operation, the new primary cluster will accept both read
and write requests.
This command is only supported on secondary clusters.
examples: |
To switchover to a secondary cluster with name `my-secondary-cluster` in region `us-central1`, run:
$ {command} my-secondary-cluster --region=us-central1
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:cluster
help_text: |
Arguments and flags that specify the Memorystore Redis cluster you want to update.
async:
collection: redis.projects.locations.operations
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: redis.projects.locations.clusters
method: patch
modify_request_hooks:
- googlecloudsdk.command_lib.redis.clusters_ccr_util:Switchover

View File

@@ -0,0 +1,232 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Update Memorystore Cluster for Redis instance.
description: |
Update the metadata and/or configuration parameters of a Redis cluster.
This command can fail for the following reasons:
* The cluster specified does not exist.
* The active account does not have permission to update the given
cluster.
examples: |
To update a Redis cluster with 5 shard and 2 replica, run:
$ {command} my-redis-cluster --shard-count=5 --replica-count=2
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:cluster
help_text: |
Arguments and flags that specify the Memorystore Redis cluster you want to update.
params:
- arg_name: node-type
api_field: cluster.nodeType
help_text: Node Type of the redis cluster Node.
choices:
- enum_value: REDIS_HIGHMEM_MEDIUM
arg_value: redis-highmem-medium
- enum_value: REDIS_HIGHMEM_XLARGE
arg_value: redis-highmem-xlarge
- enum_value: REDIS_STANDARD_SMALL
arg_value: redis-standard-small
- enum_value: REDIS_SHARED_CORE_NANO
arg_value: redis-shared-core-nano
- arg_name: replica-count
api_field: cluster.replicaCount
type: int
help_text: |
The replica count of each shard.
- arg_name: maintenance-version
api_field: cluster.maintenanceVersion
help_text: |
The maintenance version of the cluster.
- arg_name: shard-count
api_field: cluster.shardCount
type: int
help_text: |
The shard count of the cluster.
- arg_name: deletion-protection
api_field: cluster.deletionProtectionEnabled
type: bool
help_text: |
Enable deletion protection for the Redis Cluster. Use
`--deletion-protection`/`--no-deletion-protection` to enable/disable it.
- arg_name: persistence-mode
api_field: cluster.persistenceConfig.mode
help_text: |
Operation mode for persistence.
choices:
- enum_value: DISABLED
arg_value: disabled
help_text: Persistence mode is disabled
- enum_value: RDB
arg_value: RDB
help_text: RDB-based persistence
- enum_value: AOF
arg_value: AOF
help_text: AOF-based persistence
- arg_name: rdb-snapshot-period
api_field: cluster.persistenceConfig.rdbConfig.rdbSnapshotPeriod
help_text: |
Attempted period between RDB snapshots.
choices:
- enum_value: ONE_HOUR
arg_value: 1h
help_text: 1 hour
- enum_value: SIX_HOURS
arg_value: 6h
help_text: 6 hours
- enum_value: TWELVE_HOURS
arg_value: 12h
help_text: 12 hours
- enum_value: TWENTY_FOUR_HOURS
arg_value: 24h
help_text: (default) 24 hours
- arg_name: rdb-snapshot-start-time
api_field: cluster.persistenceConfig.rdbConfig.rdbSnapshotStartTime
help_text: |
Date and time of the first snapshot in the ISO 1801 format, and alignment time for future snapshots. For example, 2024-01-01T01:00:00Z.
If not specified, the current time will be used.
- arg_name: aof-append-fsync
api_field: cluster.persistenceConfig.aofConfig.appendFsync
help_text: |
Fsync configuration.
choices:
- enum_value: NO # yamllint disable-line rule:truthy
arg_value: no # yamllint disable-line rule:truthy
help_text: |
Redis will not explicitly call fsync.
- enum_value: EVERYSEC
arg_value: everysec
help_text: |
(default) Redis explicitly calls fsync every second.
- enum_value: ALWAYS
arg_value: always
help_text: |
Redis explicitly calls fsync for every write command.
- arg_name: automated-backup-mode
api_field: cluster.automatedBackupConfig.automatedBackupMode
help_text: |
Automated backup mode
choices:
- enum_value: DISABLED
arg_value: disabled
help_text: |
(default) Automated backup is disabled.
- enum_value: ENABLED
arg_value: enabled
help_text: |
Automated backup is enabled.
- arg_name: automated-backup-start-time
api_field: cluster.automatedBackupConfig.fixedFrequencySchedule.startTime
help_text: |
One-hour window when you want automated-backup operations to start. Specify the time in the format HH:00 on a 24-hour cycle in UTC time.
ALPHA:
processor: googlecloudsdk.command_lib.redis.cluster_util:ParseTimeOfDayAlpha
BETA:
processor: googlecloudsdk.command_lib.redis.cluster_util:ParseTimeOfDayBeta
GA:
processor: googlecloudsdk.command_lib.redis.cluster_util:ParseTimeOfDayGa
- arg_name: automated-backup-ttl
api_field: cluster.automatedBackupConfig.retention
type: googlecloudsdk.core.util.times:ParseDuration
processor: googlecloudsdk.core.util.times:FormatDurationForJson
help_text: |
Time to live for automated backups. A backup will be deleted automatically after the TTL
is reached. It ranges from 1 day to 365 days. For example, "10d" for 10 days. If not specified, the default value is 35 days.
- group:
mutex: true
params:
- arg_name: maintenance-window-any
action: store_true
help_text: |
Removes the user-specified maintenance window.
- group:
params:
- arg_name: maintenance-window-day
api_field: cluster.maintenancePolicy.weeklyMaintenanceWindow.day
choices:
- arg_value: monday
enum_value: MONDAY
- arg_value: tuesday
enum_value: TUESDAY
- arg_value: wednesday
enum_value: WEDNESDAY
- arg_value: thursday
enum_value: THURSDAY
- arg_value: friday
enum_value: FRIDAY
- arg_value: saturday
enum_value: SATURDAY
- arg_value: sunday
enum_value: SUNDAY
help_text: |
The day of week when the window starts, e.g. `sunday`.
- arg_name: maintenance-window-hour
api_field: cluster.maintenancePolicy.weeklyMaintenanceWindow.startTime.hours
help_text: |
Hour of day (`0` to `23`) for the start of maintenance window, in UTC time zone.
processor: googlecloudsdk.command_lib.redis.clusters_update_util:CheckMaintenanceWindowStartTimeField
- arg_name: simulate-maintenance-event
action: store_true
help_text: |
Trigger a simulation for maintenance event.
type: bool
additional_arguments_hook: googlecloudsdk.command_lib.redis.cluster_util:AdditionalClusterUpdateArguments
async:
collection: redis.projects.locations.operations
request:
ALPHA:
api_version: v1alpha1
modify_request_hooks:
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateReplicaCount
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateShardCount
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateDeletionProtection
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdatePersistenceConfig
- googlecloudsdk.command_lib.redis.clusters_update_util:RemoveRedisConfigs
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateRedisConfigs
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateMaintenanceWindowAny
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateMaintenanceWindowPolicy
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateSimulateMaintenanceEvent
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateAutomatedBackupConfig
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateNodeType
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateMaintenanceVersion
BETA:
api_version: v1beta1
modify_request_hooks:
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateReplicaCount
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateShardCount
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateDeletionProtection
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdatePersistenceConfig
- googlecloudsdk.command_lib.redis.clusters_update_util:RemoveRedisConfigs
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateRedisConfigs
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateMaintenanceWindowAny
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateMaintenanceWindowPolicy
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateSimulateMaintenanceEvent
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateAutomatedBackupConfig
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateNodeType
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateMaintenanceVersion
GA:
api_version: v1
modify_request_hooks:
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateReplicaCount
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateShardCount
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateDeletionProtection
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdatePersistenceConfig
- googlecloudsdk.command_lib.redis.clusters_update_util:RemoveRedisConfigs
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateRedisConfigs
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateMaintenanceWindowAny
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateMaintenanceWindowPolicy
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateSimulateMaintenanceEvent
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateAutomatedBackupConfig
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateNodeType
- googlecloudsdk.command_lib.redis.clusters_update_util:UpdateMaintenanceVersion
collection: redis.projects.locations.clusters
update:
read_modify_update: true
disable_auto_field_mask: true