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,49 @@
# -*- 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 Cloud Memorystore Redis instances."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
class Instances(base.Group):
"""Manage Cloud Memorystore Redis instances.
## EXAMPLES
To create an instance with the name `my-redis-instance`, run:
$ {command} create my-redis-instance
To delete an instance with the name `my-redis-instance`, run:
$ {command} delete my-redis-instance
To display the details for an instance with the name `my-redis-instance`, run:
$ {command} describe my-redis-instance
To list all the instances, run:
$ {command} list
To set the label `env` to `prod` for an instance with the name
`my-redis-instance`, run:
$ {command} my-redis-instance --update-labels=env=prod
"""

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.
"""Command group for managing Redis instance configurations."""
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 Config(base.Group):
"""Manage Redis instance configurations."""

View File

@@ -0,0 +1,38 @@
release_tracks: [ALPHA]
command_type: CONFIG_EXPORT
help_text:
brief: Export the configuration for a Redis instance.
description: |
*{command}* exports the configuration for a Redis instance.
Instance configurations can be exported in
Kubernetes Resource Model (krm) or Terraform HCL formats. The
default format is `krm`.
Specifying `--all` allows you to export the configurations for all
instances within the project.
Specifying `--path` allows you to export the configuration(s) to
a local directory.
examples: |
To export the configuration for an instance, run:
$ {command} my-instance
To export the configuration for an instance to a file, run:
$ {command} my-instance --path=/path/to/dir/
To export the configuration for an instance in Terraform
HCL format, run:
$ {command} my-instance --resource-format=terraform
To export the configurations for all instances within a
project, run:
$ {command} --all
arguments:
resource:
help_text: Instance to export the configuration for.
spec: !REF googlecloudsdk.command_lib.redis.resources:instance

View File

@@ -0,0 +1,246 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Create a Memorystore Redis instance.
description: |
Create a new Redis instance.
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: |
To create a basic tier instance with the name `my-redis-instance` in region `us-central-1`
with memory size of 5 GiB, run:
$ {command} my-redis-instance --region=us-central1 --size=5
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:instance
help_text: |
Arguments and flags that specify the Memorystore Redis instance you want
to create.
params:
- arg_name: zone
api_field: instance.locationId
help_text: |
The zone of the Redis instance. If not provided the service
will pick a random zone in the region. For the standard tier, instances
will be created across two zones for protection against zonal
failures. So if --alternative-zone is also provided, it must be
different from --zone.
- arg_name: alternative-zone
api_field: instance.alternativeLocationId
help_text: |
A secondary zone for the Redis instance. Only applicable to
the standard tier. This protects the instance against zonal failures
by provisioning it across two zones. If provided, alternative zone
must be a different zone from the one provided through `--zone`.
- arg_name: network
api_field: instance.authorizedNetwork
help_text: |
The name of the Google Compute Engine network to which the instance
will be connected. If left unspecified, the default network will be
used.
default: default
processor: googlecloudsdk.command_lib.redis.instances_create_util:ParseInstanceNetworkArg
- arg_name: tier
api_field: instance.tier
help_text: |
The service tier of the instance.
choices:
- enum_value: BASIC
arg_value: basic
help_text: Basic Redis instance with no replication
- enum_value: STANDARD_HA
arg_value: standard
help_text: Standard high-availability Redis instance with replication
default: basic
- arg_name: connect-mode
api_field: instance.connectMode
help_text: |
Network connection mode used by instances.
- arg_name: transit-encryption-mode
api_field: instance.transitEncryptionMode
help_text: |
Transit encryption mode used by the instance.
choices: # Enum is mapped to keep TRANSIT-ENCRYPTION-MODE-UNSPECIFIED invisible from users.
- arg_value: DISABLED
enum_value: DISABLED
help_text: Transit encryption is disabled for the instance.
- arg_value: SERVER-AUTHENTICATION
enum_value: SERVER-AUTHENTICATION
help_text: Client to Server traffic encryption enabled with server authentication.
- arg_name: display-name
api_field: instance.displayName
help_text: |
A human-readable name for the instance.
- api_field: instance.redisConfigs.additionalProperties
metavar: KEY=VALUE
arg_name: redis-config
help_text: |
A list of Redis config KEY=VALUE pairs to set on the instance
according to http://redis.io/topics/config. Currently, the only
supported parameters are:
Redis version 3.2 and newer: maxmemory-policy, notify-keyspace-events, timeout, databases.
Redis version 4.0 and newer: activedefrag, lfu-decay-time, lfu-log-factor, maxmemory-gb.
Redis version 5.0 and newer: stream-node-max-bytes, stream-node-max-entries.
type:
arg_dict:
flatten: true
spec:
- api_field: key
- api_field: value
- arg_name: maintenance-window-day
api_field: instance.maintenancePolicy.weeklyMaintenanceWindow.day
help_text: |
Day of week for maintenance window, in UTC time zone.
MAINTENANCE_WINDOW_DAY must be one of: SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY.
- arg_name: maintenance-window-hour
api_field: instance.maintenancePolicy.weeklyMaintenanceWindow.startTime.hours
help_text: |
Hour of day (0 to 23) for maintenance window, in UTC time zone.
- arg_name: persistence-mode
api_field: instance.persistenceConfig.persistenceMode
help_text: |
Operation mode for automated persistence.
choices:
- enum_value: DISABLED
arg_value: disabled
help_text: RDB mode is disabled
- enum_value: RDB
arg_value: RDB
help_text: Automatic RDB persistence
- arg_name: rdb-snapshot-period
api_field: instance.persistenceConfig.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: 24 hours
- arg_name: rdb-snapshot-start-time
api_field: instance.persistenceConfig.rdbSnapshotStartTime
help_text: |
Date and time of the first snapshot in the ISO 1801 format, and alignment time for future snapshots. For example, 2022-11-02T03:00:00Z.
- arg_name: read-replicas-mode
api_field: instance.readReplicasMode
help_text: |
Read replicas mode used by the instance. Only works against standard tier instances with 5GB
and above provisioned capacity.
choices: # Enum is mapped to keep READ-REPLICAS-MODE-UNSPECIFIED invisible from users.
- enum_value: READ-REPLICAS-DISABLED
arg_value: READ-REPLICAS-DISABLED
help_text: |
Read replica is disabled for the instance. Read endpoint will not
be provided and the instance cannot scale up or down the number of
replicas.
- enum_value: READ-REPLICAS-ENABLED
arg_value: READ-REPLICAS-ENABLED
help_text: |
Read replica is enabled for the instance. Read endpoint will be
provided and the instance can scale up and down the number of
replicas.
- arg_name: replica-count
api_field: instance.replicaCount
type: long
help_text: |
The replica count of the instance.
- arg_name: redis-version
api_field: instance.redisVersion
metavar: VERSION
help_text: The version of Redis software.
choices:
- enum_value: REDIS_3_2
arg_value: redis_3_2
help_text: Redis 3.2 compatibility
- enum_value: REDIS_4_0
arg_value: redis_4_0
help_text: Redis 4.0 compatibility
- enum_value: REDIS_5_0
arg_value: redis_5_0
help_text: Redis 5.0 compatibility
- enum_value: REDIS_6_X
arg_value: redis_6_x
help_text: Redis 6.x compatibility
- enum_value: REDIS_7_0
arg_value: redis_7_0
help_text: Redis 7.0 compatibility
- enum_value: REDIS_7_2
arg_value: redis_7_2
help_text: Redis 7.2 compatibility
- arg_name: reserved-ip-range
api_field: instance.reservedIpRange
help_text: |
For DIRECT_PEERING mode, the CIDR range of internal addresses that are reserved for this
instance. Range must be unique and non-overlapping with existing subnets in an authorized
network. For PRIVATE_SERVICE_ACCESS mode, the name of an IP address range allocated for the
private service access connection. If not provided, the service will choose an unused /29
block, for example, 10.0.0.0/29 or 192.168.0.0/29. If READ_REPLICAS_ENABLED is used for the
--read-replicas-mode flag, then the block size required for this flag is /28.
- arg_name: customer-managed-key
api_field: instance.customerManagedKey
help_text: |
The KMS key reference that you want to use to encrypt the data at rest for this Redis
instance. If this is provided, CMEK is enabled.
- arg_name: size
api_field: instance.memorySizeGb
help_text: |
The memory size of the instance in GiB. If not provided, size of 1 GiB
will be used.
type: long
default: 1
- arg_name: enable-auth
api_field: instance.authEnabled
type: bool
action: store_true
processor: googlecloudsdk.command_lib.redis.util:WarnOnAuthEnabled
help_text: |
Enables Redis AUTH for the instance. If omitted AUTH is disabled.
- arg_name: tags
release_tracks: [GA]
api_field: instance.tags.additionalProperties
# TODO(b/348137430): Remove hidden as part of GA launch.
hidden: true
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
labels:
api_field: instance.labels
async:
collection: redis.projects.locations.operations
request:
ALPHA:
api_version: v1alpha1
modify_request_hooks:
- googlecloudsdk.command_lib.redis.instances_create_util:AddDefaultReplicaCount
BETA:
api_version: v1beta1
modify_request_hooks:
- googlecloudsdk.command_lib.redis.instances_create_util:AddDefaultReplicaCount
GA:
api_version: v1
modify_request_hooks:
- googlecloudsdk.command_lib.redis.instances_create_util:AddDefaultReplicaCount
collection: redis.projects.locations.instances

View File

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

View File

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

View File

@@ -0,0 +1,34 @@
- release_tracks: [GA, BETA, ALPHA]
command_type: GENERIC
help_text:
brief: Export data from a Memorystore Redis instance to Google Cloud Storage.
description: |
Export data from a Memorystore Redis instance to Google Cloud Storage.
examples: |
To export the instance with the name `my-redis-instance` in region
`us-central1` to Cloud Storage object
gs://my-bucket/my-redis-instance.rdb run:
$ {command} gs://my-bucket/my-redis-instance.rdb my-redis-instance --region=us-central1
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:instance
help_text: |
Arguments and flags that specify the Memorystore Redis instance you want
to export.
params:
- arg_name: destination
api_field: exportInstanceRequest.outputConfig.gcsDestination.uri
help_text: |
The Cloud Storage object path to export the instance to. Must have
the redis DB file extension *.rdb*.
is_positional: true
async:
collection: redis.projects.locations.operations
request:
collection: redis.projects.locations.instances
api_version: v1
method: export

View File

@@ -0,0 +1,53 @@
release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Failover a standard tier Cloud Memorystore for Redis instance from the master node to its
replica.
description: |
Failover a standard tier Cloud Memorystore for Redis instance from the master node to its
replica.
examples: |
To failover an instance with the name 'my-redis-instance' in region 'us-central-1', run:
$ {command} my-redis-instance --region=us-central1
To failover an instance with the name 'my-redis-instance' in region 'us-central-1' without
attempting to limit data loss, run:
$ {command} my-redis-instance --region=us-central1 --data-protection-mode=force-data-loss
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:instance
help_text: |
Arguments and flags that specify the standard tier Cloud Memorystore for Redis instance you
want to failover.
params:
- arg_name: data-protection-mode
api_field: failoverInstanceRequest.dataProtectionMode
choices:
- arg_value: force-data-loss
enum_value: FORCE_DATA_LOSS
help_text: Failover without data loss protection. Can cause significant data loss.
- arg_value: limited-data-loss
enum_value: LIMITED_DATA_LOSS
help_text: Failover with data loss protection that ensures loss is within system thresholds.
help_text: |
Data protection mode to use for the failover. If not specified, defaults to
'limited-data-loss'.
input:
confirmation_prompt: |-
WARNING: Failover can result in the loss of unreplicated data. Using 'force-data-loss' can potentially cause significant data loss. See manual failover documentation for more details.
async:
collection: redis.projects.locations.operations
request:
api_version: v1
collection: redis.projects.locations.instances
method: failover
output:
format: none

View File

@@ -0,0 +1,37 @@
release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Show AUTH string for a Memorystore Redis instance.
description: |
Show AUTH string for a Memorystore Redis instance.
Result is empty if AUTH is disabled for the instance.
This command can fail for the following reasons:
* The instance specified does not exist.
* The active account does not have permission to view the AUTH string
examples: |
To display the AUTH string for an instance with the name `my-redis-instance` in the default
region, run:
$ {command} my-redis-instance
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:instance
help_text: |
Arguments and flags that specify the Memorystore Redis instance you want
to view the AUTH string for.
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: redis.projects.locations.instances
method: getAuthString
output:
format: "yaml[private]"

View File

@@ -0,0 +1,34 @@
- release_tracks: [GA, BETA, ALPHA]
command_type: GENERIC
help_text:
brief: Import data to a Memorystore Redis instance from Google Cloud Storage.
description: |
Import data to a Memorystore Redis instance from Google Cloud Storage.
examples: |
To import to the instance with the name `my-redis-instance` in region
`us-central1` from Cloud Storage object
gs://my-bucket/my-redis-instance.rdb run:
$ {command} gs://my-bucket/my-redis-instance.rdb my-redis-instance --region=us-central1
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:instance
help_text: |
Arguments and flags that specify the Memorystore Redis instance you want
to import to.
params:
- arg_name: source
api_field: importInstanceRequest.inputConfig.gcsSource.uri
help_text: |
The Cloud Storage object path to import the instance from. Must have
the redis DB file extension *.rdb*.
is_positional: true
async:
collection: redis.projects.locations.operations
request:
collection: redis.projects.locations.instances
api_version: v1
method: import

View File

@@ -0,0 +1,40 @@
- help_text:
brief: |
List Memorystore Redis instances.
description: |
List all Redis instances under the specified project and region.
To specify the maximum number of instances to list, use the --limit flag.
examples: |
To list up to five instances, run:
$ {command} --limit=5
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:region
help_text: |
The region of the instances to display.
request:
api_version: v1
collection: redis.projects.locations.instances
response:
id_field: name
output:
format: |
table(
name.basename():label=INSTANCE_NAME:sort=2,
redisVersion:label=VERSION,
name.segment(3):label=REGION,
tier,
memorySizeGb:label=SIZE_GB,
host.yesno(no="-"),
port.yesno(no="-"),
authorizedNetwork.basename():label=NETWORK,
reservedIpRange:label=RESERVED_IP,
state:label=STATUS,
createTime.date()
)

View File

@@ -0,0 +1,59 @@
release_tracks: [BETA, ALPHA, GA]
help_text:
brief: |
Reschedule maintenance window for a Redis instance.
description: |
Reschedule maintenance window for a Redis instance.
examples: |
To reschedule maintenance window for an instance with the name 'my-redis-instance' in region
'us-central-1' with next available window, run:
$ {command} my-redis-instance --region=us-central1 --reschedule-type=next-available-window
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:instance
help_text: |
Arguments and flags that specify the Cloud Memorystore for Redis instance you
want to reschedule maintenance window.
params:
- arg_name: reschedule-type
api_field: rescheduleMaintenanceRequest.rescheduleType
required: true
choices:
- arg_value: IMMEDIATE
enum_value: IMMEDIATE
help_text: Reschedule the maintenance window to perform now.
- arg_value: NEXT-AVAILABLE-WINDOW
enum_value: NEXT_AVAILABLE_WINDOW
help_text: Reschedule the maintenance window to the next available window.
- arg_value: SPECIFIC-TIME
enum_value: SPECIFIC_TIME
help_text: Reschedule the maintenance window to a specific time.
help_text: |
Reschedule type to use for the reschedule maintenance window.
Reschedule Type must be one of:IMMEDIATE, NEXT-AVAILABLE-WINDOW, or SPECIFIC-TIME.
- arg_name: schedule-time
api_field: rescheduleMaintenanceRequest.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.instances_reschedule_util:CheckSpecificTimeField
BETA:
api_version: v1beta1
modify_request_hooks:
- googlecloudsdk.command_lib.redis.instances_reschedule_util:CheckSpecificTimeField
GA:
api_version: v1
modify_request_hooks:
- googlecloudsdk.command_lib.redis.instances_reschedule_util:CheckSpecificTimeField
collection: redis.projects.locations.instances
method: rescheduleMaintenance

View File

@@ -0,0 +1,202 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Update Memorystore Redis instances.
description: |
Update the metadata and/or configuration parameters of a Redis instance.
This command can fail for the following reasons:
* The instance specified does not exist.
* The active account does not have permission to update the given
instance.
examples: |
To update a Redis instance with the name `my-redis-instance` to have the display name
"Cache for Foo Service", and add the two labels, `env` and `service`, run:
$ {command} my-redis-instance --display-name="Cache for Foo Service" \
--update-labels=env=test,service=foo
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:instance
help_text: |
Arguments and flags that specify the Memorystore Redis instance you want
to update.
params:
- arg_name: display-name
api_field: instance.displayName
help_text: |
A human-readable name for the instance.
- arg_name: size
api_field: instance.memorySizeGb
type: long
help_text: |
The memory size of the instance in GiB.
- arg_name: enable-auth
api_field: instance.authEnabled
type: bool
action: store_true
help_text: |
Enables Redis AUTH for the instance.
- arg_name: persistence-mode
api_field: instance.persistenceConfig.persistenceMode
help_text: |
Operation mode for automated persistence.
choices:
- enum_value: DISABLED
arg_value: disabled
help_text: RDB mode is disabled
- enum_value: RDB
arg_value: RDB
help_text: Automatic RDB persistence
- arg_name: rdb-snapshot-period
api_field: instance.persistenceConfig.rdbSnapshotPeriod
help_text: |
The 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: 24 hours
- arg_name: rdb-snapshot-start-time
api_field: instance.persistenceConfig.rdbSnapshotStartTime
help_text: |
Date and time of the first snapshot in the ISO 1801 format, and alignment time for future snapshots. For example, 2022-11-02T03:00:00Z.
- arg_name: replica-count
api_field: instance.replicaCount
type: long
help_text: |
The replica count of the instance. Valid from 0 to 5.
- arg_name: read-replicas-mode
api_field: instance.readReplicasMode
help_text: |
Read replicas mode used by the instance. Only works against standard tier instances with
5GB and above provisioned capacity and Redis version 5.0 and above.
This is an irreversible update i.e. Read replicas can not be disabled for the instance
once it is enabled. Also this update is exclusive and cannot be clubbed with other update
operations.
choices: # Enum is mapped to keep READ-REPLICAS-MODE-UNSPECIFIED invisible from users.
- enum_value: READ-REPLICAS-ENABLED
arg_value: READ-REPLICAS-ENABLED
help_text: |
Read replica is enabled for the instance if not already enabled. Read endpoint will be
provided and the instance can scale up and down the number of replicas.
- enum_value: READ-REPLICAS-DISABLED
arg_value: READ-REPLICAS-DISABLED
help_text: |
If read replica is not enabled on the instance, no changes are done. If read replica is
enabled for the instance, update operation fails
- arg_name: secondary-ip-range
api_field: instance.secondaryIpRange
help_text: |
Required only when read-replicas-mode is enabled on the instance. The CIDR range of
internal addresses that are reserved for this instance. For example, 10.0.0.0/28 or
192.168.0.0/28. Range must be unique and non-overlapping with existing ranges in the
network. If value 'auto' passed, the service will automatically pick an available range.
- arg_name: maintenance-version
api_field: instance.maintenanceVersion
help_text: |
Specifies which maintenance version to apply to your instance during self-service maintenance.
To view the available maintenance versions for your instance, run `gcloud redis
instances describe [INSTANCE_ID]`. Acceptable values for this flag are either `current_default` or
one of the specific versions listed by the describe command. If you pass the value
`current_default`, the Memorystore updates to the most recent available maintenance version during self service maintenance.
- 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: instance.maintenancePolicy.weeklyMaintenanceWindow.day
help_text: |
Day of week for maintenance window, in UTC time zone.
MAINTENANCE_WINDOW_DAY must be one of: SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY.
- arg_name: maintenance-window-hour
api_field: instance.maintenancePolicy.weeklyMaintenanceWindow.startTime.hours
help_text: |
Hour of day (0 to 23) for maintenance window, in UTC time zone.
additional_arguments_hook: googlecloudsdk.command_lib.redis.util:AdditionalInstanceUpdateArguments
labels:
api_field: instance.labels
async:
collection: redis.projects.locations.operations
request:
ALPHA:
api_version: v1alpha1
modify_request_hooks:
- googlecloudsdk.command_lib.redis.instances_update_util:CheckFieldsSpecifiedAlpha
- googlecloudsdk.command_lib.redis.instances_update_util:AddDisplayName
- googlecloudsdk.command_lib.redis.instances_update_util:AddSize
- googlecloudsdk.command_lib.redis.instances_update_util:RemoveRedisConfigs
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateMaintenanceWindowAny
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateMaintenanceWindowDay
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateMaintenanceWindowHour
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateRedisConfigs
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateAuthEnabled
- googlecloudsdk.command_lib.redis.instances_update_util:UpdatePersistenceMode
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateRdbSnapshotPeriod
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateRdbSnapshotStartTime
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateReplicaCount
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateReadReplicasMode
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateSecondaryIpRange
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateMaintenanceVersion
BETA:
api_version: v1beta1
modify_request_hooks:
- googlecloudsdk.command_lib.redis.instances_update_util:CheckFieldsSpecifiedBeta
- googlecloudsdk.command_lib.redis.instances_update_util:AddDisplayName
- googlecloudsdk.command_lib.redis.instances_update_util:AddSize
- googlecloudsdk.command_lib.redis.instances_update_util:RemoveRedisConfigs
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateMaintenanceWindowAny
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateMaintenanceWindowDay
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateMaintenanceWindowHour
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateRedisConfigs
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateAuthEnabled
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateReplicaCount
- googlecloudsdk.command_lib.redis.instances_update_util:UpdatePersistenceMode
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateRdbSnapshotPeriod
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateRdbSnapshotStartTime
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateReadReplicasMode
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateSecondaryIpRange
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateMaintenanceVersion
GA:
api_version: v1
modify_request_hooks:
- googlecloudsdk.command_lib.redis.instances_update_util:CheckFieldsSpecifiedGA
- googlecloudsdk.command_lib.redis.instances_update_util:AddDisplayName
- googlecloudsdk.command_lib.redis.instances_update_util:AddSize
- googlecloudsdk.command_lib.redis.instances_update_util:RemoveRedisConfigs
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateMaintenanceWindowAny
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateMaintenanceWindowDay
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateMaintenanceWindowHour
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateRedisConfigs
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateAuthEnabled
- googlecloudsdk.command_lib.redis.instances_update_util:UpdatePersistenceMode
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateRdbSnapshotPeriod
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateRdbSnapshotStartTime
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateReplicaCount
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateReadReplicasMode
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateSecondaryIpRange
- googlecloudsdk.command_lib.redis.instances_update_util:UpdateMaintenanceVersion
collection: redis.projects.locations.instances
update:
read_modify_update: true
disable_auto_field_mask: true

View File

@@ -0,0 +1,53 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief:
Upgrade a Memorystore for Redis instance to a specified Redis version.
description: |
Upgrade a Memorystore for Redis instance to a specified Redis version.
examples: |
To upgrade an instance with the name `my-redis-instance` in region
`us-central1` to Redis version 4.0 run:
$ {command} my-redis-instance --region=us-central1 --redis-version=redis_4_0
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.redis.resources:instance
help_text: |
Arguments and flags that specify the Memorystore for Redis instance you want
to upgrade.
params:
- arg_name: redis-version
api_field: upgradeInstanceRequest.redisVersion
required: true
metavar: VERSION
help_text: Target version of Redis software.
choices:
- enum_value: REDIS_4_0
arg_value: redis_4_0
help_text: Redis 4.0 compatibility
- enum_value: REDIS_5_0
arg_value: redis_5_0
help_text: Redis 5.0 compatibility
- enum_value: REDIS_6_X
arg_value: redis_6_x
help_text: Redis 6.x compatibility
- enum_value: REDIS_7_0
arg_value: redis_7_0
help_text: Redis 7.0 compatibility
- enum_value: REDIS_7_2
arg_value: redis_7_2
help_text: Redis 7.2 compatibility
input:
confirmation_prompt: |-
WARNING: Upgrading will cause connection reset for Basic Tier instances and a failover for Standard Tier instances. The instance will also be temporarily unavailable. To prevent data loss, back up your instance before continuing. For more information, see "Behavior during version upgrade" section in the official Memorystore for Redis documentation.
async:
collection: redis.projects.locations.operations
request:
collection: redis.projects.locations.instances
api_version: v1
method: upgrade