From e55220b5c189bc96589abac492a490d1d99b53ff Mon Sep 17 00:00:00 2001 From: Christopher Wilcox Date: Wed, 12 Feb 2020 21:21:47 +0000 Subject: [PATCH] feat: add ConnectMode and upgrade_instance (#5) * synthtool * docs: update sample for update_instance * fix: reduce coverage percent --- .../redis_v1/gapic/cloud_redis_client.py | 6 +- google/cloud/redis_v1/gapic/enums.py | 17 + google/cloud/redis_v1/proto/cloud_redis.proto | 55 ++-- .../cloud/redis_v1/proto/cloud_redis_pb2.py | 212 +++++++----- .../redis_v1/proto/cloud_redis_pb2_grpc.py | 1 + .../redis_v1beta1/gapic/cloud_redis_client.py | 97 +++++- .../gapic/cloud_redis_client_config.py | 5 + google/cloud/redis_v1beta1/gapic/enums.py | 17 + .../transports/cloud_redis_grpc_transport.py | 14 + .../redis_v1beta1/proto/cloud_redis.proto | 83 ++++- .../redis_v1beta1/proto/cloud_redis_pb2.py | 306 +++++++++++++----- .../proto/cloud_redis_pb2_grpc.py | 19 ++ noxfile.py | 1 + synth.metadata | 28 +- synth.py | 2 +- .../gapic/v1/test_cloud_redis_client_v1.py | 28 +- .../test_cloud_redis_client_v1beta1.py | 99 +++++- 17 files changed, 783 insertions(+), 207 deletions(-) diff --git a/google/cloud/redis_v1/gapic/cloud_redis_client.py b/google/cloud/redis_v1/gapic/cloud_redis_client.py index 04621b9..52dfd83 100644 --- a/google/cloud/redis_v1/gapic/cloud_redis_client.py +++ b/google/cloud/redis_v1/gapic/cloud_redis_client.py @@ -557,8 +557,10 @@ def update_instance( >>> paths_element_2 = 'memory_size_gb' >>> paths = [paths_element, paths_element_2] >>> update_mask = {'paths': paths} - >>> display_name = ' instance.memory_size_gb=4' - >>> instance = {'display_name': display_name} + >>> display_name = 'UpdatedDisplayName' + >>> name = 'projects//locations//instances/' + >>> memory_size_gb = 4 + >>> instance = {'display_name': display_name, 'name': name, 'memory_size_gb': memory_size_gb} >>> >>> response = client.update_instance(update_mask, instance) >>> diff --git a/google/cloud/redis_v1/gapic/enums.py b/google/cloud/redis_v1/gapic/enums.py index d5a628a..1292528 100644 --- a/google/cloud/redis_v1/gapic/enums.py +++ b/google/cloud/redis_v1/gapic/enums.py @@ -22,6 +22,8 @@ class FailoverInstanceRequest(object): class DataProtectionMode(enum.IntEnum): """ + Specifies different modes of operation in relation to the data retention. + Attributes: DATA_PROTECTION_MODE_UNSPECIFIED (int): Defaults to LIMITED\_DATA\_LOSS if a data protection mode is not specified. @@ -38,6 +40,21 @@ class DataProtectionMode(enum.IntEnum): class Instance(object): + class ConnectMode(enum.IntEnum): + """ + Available connection modes. + + Attributes: + CONNECT_MODE_UNSPECIFIED (int): Not set. + DIRECT_PEERING (int): Connect via directly peering with memorystore redis hosted service. + PRIVATE_SERVICE_ACCESS (int): Connect with google via private service access and share connection + across google managed services. + """ + + CONNECT_MODE_UNSPECIFIED = 0 + DIRECT_PEERING = 1 + PRIVATE_SERVICE_ACCESS = 2 + class State(enum.IntEnum): """ Represents the different states of a Redis instance. diff --git a/google/cloud/redis_v1/proto/cloud_redis.proto b/google/cloud/redis_v1/proto/cloud_redis.proto index 1c9cd49..c16ceb6 100644 --- a/google/cloud/redis_v1/proto/cloud_redis.proto +++ b/google/cloud/redis_v1/proto/cloud_redis.proto @@ -53,6 +53,7 @@ service CloudRedis { // location (region) or all locations. // // The location should have the following format: + // // * `projects/{project_id}/locations/{location_id}` // // If `location_id` is specified as `-` (wildcard), then all regions @@ -230,6 +231,19 @@ message Instance { STANDARD_HA = 3; } + // Available connection modes. + enum ConnectMode { + // Not set. + CONNECT_MODE_UNSPECIFIED = 0; + + // Connect via directly peering with memorystore redis hosted service. + DIRECT_PEERING = 1; + + // Connect with google via private service access and share connection + // across google managed services. + PRIVATE_SERVICE_ACCESS = 2; + } + // Required. Unique name of the resource in this scope including project and // location using the form: // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` @@ -237,8 +251,8 @@ message Instance { // Note: Redis instances are managed and addressed at regional level so // location_id here refers to a GCP region; however, users may choose which // specific zone (or collection of zones for cross-zone instances) an instance - // should be provisioned in. Refer to [location_id] and - // [alternative_location_id] fields for more details. + // should be provisioned in. Refer to [location_id][google.cloud.redis.v1.Instance.location_id] and + // [alternative_location_id][google.cloud.redis.v1.Instance.alternative_location_id] fields for more details. string name = 1 [(google.api.field_behavior) = REQUIRED]; // An arbitrary and optional user-provided name for the instance. @@ -250,19 +264,18 @@ message Instance { // Optional. The zone where the instance will be provisioned. If not provided, // the service will choose a zone for the instance. For STANDARD_HA tier, // instances will be created across two zones for protection against zonal - // failures. If [alternative_location_id] is also provided, it must be - // different from [location_id]. + // failures. If [alternative_location_id][google.cloud.redis.v1.Instance.alternative_location_id] is also provided, it must be + // different from [location_id][google.cloud.redis.v1.Instance.location_id]. string location_id = 4 [(google.api.field_behavior) = OPTIONAL]; // Optional. Only applicable to STANDARD_HA tier which protects the instance // against zonal failures by provisioning it across two zones. If provided, it - // must be a different zone from the one provided in [location_id]. + // must be a different zone from the one provided in [location_id][google.cloud.redis.v1.Instance.location_id]. string alternative_location_id = 5 [(google.api.field_behavior) = OPTIONAL]; // Optional. The version of Redis software. - // If not provided, latest supported version will be used. Updating the - // version will perform an upgrade/downgrade to the new version. Currently, - // the supported values are: + // If not provided, latest supported version will be used. Currently, the + // supported values are: // // * `REDIS_4_0` for Redis 4.0 compatibility (default) // * `REDIS_3_2` for Redis 3.2 compatibility @@ -282,9 +295,9 @@ message Instance { int32 port = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The current zone where the Redis endpoint is placed. For Basic - // Tier instances, this will always be the same as the [location_id] + // Tier instances, this will always be the same as the [location_id][google.cloud.redis.v1.Instance.location_id] // provided by the user at creation time. For Standard Tier instances, - // this can be either [location_id] or [alternative_location_id] and can + // this can be either [location_id][google.cloud.redis.v1.Instance.location_id] or [alternative_location_id][google.cloud.redis.v1.Instance.alternative_location_id] and can // change after a failover event. string current_location_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -332,6 +345,11 @@ message Instance { // for a given instance so should be checked before each import/export // operation. string persistence_iam_identity = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The connect mode of Redis instance. + // If not provided, default one will be used. + // Current default: DIRECT_PEERING. + ConnectMode connect_mode = 22 [(google.api.field_behavior) = OPTIONAL]; } // Request for [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances]. @@ -351,12 +369,12 @@ message ListInstancesRequest { // If not specified, a default value of 1000 will be used by the service. // Regardless of the page_size value, the response may include a partial list // and a caller should only rely on response's - // [next_page_token][CloudRedis.ListInstancesResponse.next_page_token] + // [`next_page_token`][google.cloud.redis.v1.ListInstancesResponse.next_page_token] // to determine if there are more instances left to be queried. int32 page_size = 2; - // The next_page_token value returned from a previous List request, - // if any. + // The `next_page_token` value returned from a previous + // [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances] request, if any. string page_token = 3; } @@ -368,10 +386,10 @@ message ListInstancesResponse { // If the `location_id` in the parent field of the request is "-", all regions // available to the project are queried, and the results aggregated. // If in such an aggregated query a location is unavailable, a dummy Redis - // entry is included in the response with the "name" field set to a value of - // the form projects/{project_id}/locations/{location_id}/instances/- and the - // "status" field set to ERROR and "status_message" field set to "location not - // available for ListInstances". + // entry is included in the response with the `name` field set to a value of + // the form `projects/{project_id}/locations/{location_id}/instances/`- and + // the `status` field set to ERROR and `status_message` field set to "location + // not available for ListInstances". repeated Instance instances = 1; // Token to retrieve the next page of results, or empty if there are no more @@ -425,7 +443,7 @@ message CreateInstanceRequest { message UpdateInstanceRequest { // Required. Mask of fields to update. At least one path must be supplied in // this field. The elements of the repeated paths field may only include these - // fields from [Instance][CloudRedis.Instance]: + // fields from [Instance][google.cloud.redis.v1.Instance]: // // * `displayName` // * `labels` @@ -506,6 +524,7 @@ message ExportInstanceRequest { // Request for [Failover][google.cloud.redis.v1.CloudRedis.FailoverInstance]. message FailoverInstanceRequest { + // Specifies different modes of operation in relation to the data retention. enum DataProtectionMode { // Defaults to LIMITED_DATA_LOSS if a data protection mode is not // specified. diff --git a/google/cloud/redis_v1/proto/cloud_redis_pb2.py b/google/cloud/redis_v1/proto/cloud_redis_pb2.py index fc6e140..411880c 100644 --- a/google/cloud/redis_v1/proto/cloud_redis_pb2.py +++ b/google/cloud/redis_v1/proto/cloud_redis_pb2.py @@ -34,7 +34,7 @@ "\n\031com.google.cloud.redis.v1B\030CloudRedisServiceV1ProtoP\001Z:google.golang.org/genproto/googleapis/cloud/redis/v1;redis" ), serialized_pb=_b( - '\n-google/cloud/redis_v1/proto/cloud_redis.proto\x12\x15google.cloud.redis.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xc6\x08\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12;\n\x06labels\x18\x03 \x03(\x0b\x32+.google.cloud.redis.v1.Instance.LabelsEntry\x12\x18\n\x0blocation_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17\x61lternative_location_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rredis_version\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11reserved_ip_range\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04host\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04port\x18\x0b \x01(\x05\x42\x03\xe0\x41\x03\x12 \n\x13\x63urrent_location_id\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x39\n\x05state\x18\x0e \x01(\x0e\x32%.google.cloud.redis.v1.Instance.StateB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12M\n\rredis_configs\x18\x10 \x03(\x0b\x32\x31.google.cloud.redis.v1.Instance.RedisConfigsEntryB\x03\xe0\x41\x01\x12\x37\n\x04tier\x18\x11 \x01(\x0e\x32$.google.cloud.redis.v1.Instance.TierB\x03\xe0\x41\x02\x12\x1b\n\x0ememory_size_gb\x18\x12 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1f\n\x12\x61uthorized_network\x18\x14 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18persistence_iam_identity\x18\x15 \x01(\tB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11RedisConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\x94\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\r\n\tREPAIRING\x10\x05\x12\x0f\n\x0bMAINTENANCE\x10\x06\x12\r\n\tIMPORTING\x10\x08\x12\x10\n\x0c\x46\x41ILING_OVER\x10\t"8\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x0f\n\x0bSTANDARD_HA\x10\x03:`\xea\x41]\n\x1dredis.googleapis.com/Instance\x12\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/locations/*}/instances\xda\x41\x06parent\x12\x97\x01\n\x0bGetInstance\x12).google.cloud.redis.v1.GetInstanceRequest\x1a\x1f.google.cloud.redis.v1.Instance"<\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/locations/*/instances/*}\xda\x41\x04name\x12\x89\x02\n\x0e\x43reateInstance\x12,.google.cloud.redis.v1.CreateInstanceRequest\x1a\x1d.google.longrunning.Operation"\xa9\x01\x82\xd3\xe4\x93\x02\x39"-/v1/{parent=projects/*/locations/*}/instances:\x08instance\xda\x41\x1bparent,instance_id,instance\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\x12\x8b\x02\n\x0eUpdateInstance\x12,.google.cloud.redis.v1.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation"\xab\x01\x82\xd3\xe4\x93\x02\x42\x32\x36/v1/{instance.name=projects/*/locations/*/instances/*}:\x08instance\xda\x41\x14update_mask,instance\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\x12\xff\x01\n\x0eImportInstance\x12,.google.cloud.redis.v1.ImportInstanceRequest\x1a\x1d.google.longrunning.Operation"\x9f\x01\x82\xd3\xe4\x93\x02\x39"4/v1/{name=projects/*/locations/*/instances/*}:import:\x01*\xda\x41\x11name,input_config\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\x12\x80\x02\n\x0e\x45xportInstance\x12,.google.cloud.redis.v1.ExportInstanceRequest\x1a\x1d.google.longrunning.Operation"\xa0\x01\x82\xd3\xe4\x93\x02\x39"4/v1/{name=projects/*/locations/*/instances/*}:export:\x01*\xda\x41\x12name,output_config\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\x12\x8d\x02\n\x10\x46\x61iloverInstance\x12..google.cloud.redis.v1.FailoverInstanceRequest\x1a\x1d.google.longrunning.Operation"\xa9\x01\x82\xd3\xe4\x93\x02;"6/v1/{name=projects/*/locations/*/instances/*}:failover:\x01*\xda\x41\x19name,data_protection_mode\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\x12\xde\x01\n\x0e\x44\x65leteInstance\x12,.google.cloud.redis.v1.DeleteInstanceRequest\x1a\x1d.google.longrunning.Operation"\x7f\x82\xd3\xe4\x93\x02/*-/v1/{name=projects/*/locations/*/instances/*}\xda\x41\x04name\xca\x41@\n\x15google.protobuf.Empty\x12\'google.cloud.redis.v1.OperationMetadata\x1aH\xca\x41\x14redis.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBs\n\x19\x63om.google.cloud.redis.v1B\x18\x43loudRedisServiceV1ProtoP\x01Z:google.golang.org/genproto/googleapis/cloud/redis/v1;redisb\x06proto3' + '\n-google/cloud/redis_v1/proto/cloud_redis.proto\x12\x15google.cloud.redis.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xeb\t\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12;\n\x06labels\x18\x03 \x03(\x0b\x32+.google.cloud.redis.v1.Instance.LabelsEntry\x12\x18\n\x0blocation_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17\x61lternative_location_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rredis_version\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11reserved_ip_range\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04host\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04port\x18\x0b \x01(\x05\x42\x03\xe0\x41\x03\x12 \n\x13\x63urrent_location_id\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x39\n\x05state\x18\x0e \x01(\x0e\x32%.google.cloud.redis.v1.Instance.StateB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12M\n\rredis_configs\x18\x10 \x03(\x0b\x32\x31.google.cloud.redis.v1.Instance.RedisConfigsEntryB\x03\xe0\x41\x01\x12\x37\n\x04tier\x18\x11 \x01(\x0e\x32$.google.cloud.redis.v1.Instance.TierB\x03\xe0\x41\x02\x12\x1b\n\x0ememory_size_gb\x18\x12 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1f\n\x12\x61uthorized_network\x18\x14 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18persistence_iam_identity\x18\x15 \x01(\tB\x03\xe0\x41\x03\x12\x46\n\x0c\x63onnect_mode\x18\x16 \x01(\x0e\x32+.google.cloud.redis.v1.Instance.ConnectModeB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11RedisConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\x94\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\r\n\tREPAIRING\x10\x05\x12\x0f\n\x0bMAINTENANCE\x10\x06\x12\r\n\tIMPORTING\x10\x08\x12\x10\n\x0c\x46\x41ILING_OVER\x10\t"8\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x0f\n\x0bSTANDARD_HA\x10\x03"[\n\x0b\x43onnectMode\x12\x1c\n\x18\x43ONNECT_MODE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x44IRECT_PEERING\x10\x01\x12\x1a\n\x16PRIVATE_SERVICE_ACCESS\x10\x02:`\xea\x41]\n\x1dredis.googleapis.com/Instance\x12\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/locations/*}/instances\xda\x41\x06parent\x12\x97\x01\n\x0bGetInstance\x12).google.cloud.redis.v1.GetInstanceRequest\x1a\x1f.google.cloud.redis.v1.Instance"<\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/locations/*/instances/*}\xda\x41\x04name\x12\x89\x02\n\x0e\x43reateInstance\x12,.google.cloud.redis.v1.CreateInstanceRequest\x1a\x1d.google.longrunning.Operation"\xa9\x01\x82\xd3\xe4\x93\x02\x39"-/v1/{parent=projects/*/locations/*}/instances:\x08instance\xda\x41\x1bparent,instance_id,instance\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\x12\x8b\x02\n\x0eUpdateInstance\x12,.google.cloud.redis.v1.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation"\xab\x01\x82\xd3\xe4\x93\x02\x42\x32\x36/v1/{instance.name=projects/*/locations/*/instances/*}:\x08instance\xda\x41\x14update_mask,instance\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\x12\xff\x01\n\x0eImportInstance\x12,.google.cloud.redis.v1.ImportInstanceRequest\x1a\x1d.google.longrunning.Operation"\x9f\x01\x82\xd3\xe4\x93\x02\x39"4/v1/{name=projects/*/locations/*/instances/*}:import:\x01*\xda\x41\x11name,input_config\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\x12\x80\x02\n\x0e\x45xportInstance\x12,.google.cloud.redis.v1.ExportInstanceRequest\x1a\x1d.google.longrunning.Operation"\xa0\x01\x82\xd3\xe4\x93\x02\x39"4/v1/{name=projects/*/locations/*/instances/*}:export:\x01*\xda\x41\x12name,output_config\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\x12\x8d\x02\n\x10\x46\x61iloverInstance\x12..google.cloud.redis.v1.FailoverInstanceRequest\x1a\x1d.google.longrunning.Operation"\xa9\x01\x82\xd3\xe4\x93\x02;"6/v1/{name=projects/*/locations/*/instances/*}:failover:\x01*\xda\x41\x19name,data_protection_mode\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\x12\xde\x01\n\x0e\x44\x65leteInstance\x12,.google.cloud.redis.v1.DeleteInstanceRequest\x1a\x1d.google.longrunning.Operation"\x7f\x82\xd3\xe4\x93\x02/*-/v1/{name=projects/*/locations/*/instances/*}\xda\x41\x04name\xca\x41@\n\x15google.protobuf.Empty\x12\'google.cloud.redis.v1.OperationMetadata\x1aH\xca\x41\x14redis.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBs\n\x19\x63om.google.cloud.redis.v1B\x18\x43loudRedisServiceV1ProtoP\x01Z:google.golang.org/genproto/googleapis/cloud/redis/v1;redisb\x06proto3' ), dependencies=[ google_dot_api_dot_annotations__pb2.DESCRIPTOR, @@ -88,8 +88,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=1082, - serialized_end=1230, + serialized_start=1154, + serialized_end=1302, ) _sym_db.RegisterEnumDescriptor(_INSTANCE_STATE) @@ -115,11 +115,42 @@ ], containing_type=None, serialized_options=None, - serialized_start=1232, - serialized_end=1288, + serialized_start=1304, + serialized_end=1360, ) _sym_db.RegisterEnumDescriptor(_INSTANCE_TIER) +_INSTANCE_CONNECTMODE = _descriptor.EnumDescriptor( + name="ConnectMode", + full_name="google.cloud.redis.v1.Instance.ConnectMode", + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name="CONNECT_MODE_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="DIRECT_PEERING", index=1, number=1, serialized_options=None, type=None + ), + _descriptor.EnumValueDescriptor( + name="PRIVATE_SERVICE_ACCESS", + index=2, + number=2, + serialized_options=None, + type=None, + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=1362, + serialized_end=1453, +) +_sym_db.RegisterEnumDescriptor(_INSTANCE_CONNECTMODE) + _FAILOVERINSTANCEREQUEST_DATAPROTECTIONMODE = _descriptor.EnumDescriptor( name="DataProtectionMode", full_name="google.cloud.redis.v1.FailoverInstanceRequest.DataProtectionMode", @@ -150,8 +181,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2733, - serialized_end=2835, + serialized_start=2898, + serialized_end=3000, ) _sym_db.RegisterEnumDescriptor(_FAILOVERINSTANCEREQUEST_DATAPROTECTIONMODE) @@ -208,8 +239,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=981, - serialized_end=1026, + serialized_start=1053, + serialized_end=1098, ) _INSTANCE_REDISCONFIGSENTRY = _descriptor.Descriptor( @@ -264,8 +295,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1028, - serialized_end=1079, + serialized_start=1100, + serialized_end=1151, ) _INSTANCE = _descriptor.Descriptor( @@ -599,10 +630,28 @@ serialized_options=_b("\340A\003"), file=DESCRIPTOR, ), + _descriptor.FieldDescriptor( + name="connect_mode", + full_name="google.cloud.redis.v1.Instance.connect_mode", + index=18, + number=22, + type=14, + cpp_type=8, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b("\340A\001"), + file=DESCRIPTOR, + ), ], extensions=[], nested_types=[_INSTANCE_LABELSENTRY, _INSTANCE_REDISCONFIGSENTRY], - enum_types=[_INSTANCE_STATE, _INSTANCE_TIER], + enum_types=[_INSTANCE_STATE, _INSTANCE_TIER, _INSTANCE_CONNECTMODE], serialized_options=_b( "\352A]\n\035redis.googleapis.com/Instance\022>> paths = [paths_element, paths_element_2] >>> update_mask = {'paths': paths} >>> display_name = 'UpdatedDisplayName' + >>> name = 'projects//locations//instances/' >>> memory_size_gb = 4 - >>> instance = {'display_name': display_name, 'memory_size_gb': memory_size_gb} + >>> instance = {'display_name': display_name, 'name': name, 'memory_size_gb': memory_size_gb} >>> >>> response = client.update_instance(update_mask, instance) >>> @@ -1031,3 +1032,97 @@ def delete_instance( empty_pb2.Empty, metadata_type=any_pb2.Any, ) + + def upgrade_instance( + self, + name, + redis_version, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Upgrades Redis instance to the newer Redis version specified in the + request. + + Example: + >>> from google.cloud import redis_v1beta1 + >>> + >>> client = redis_v1beta1.CloudRedisClient() + >>> + >>> name = client.instance_path('[PROJECT]', '[LOCATION]', '[INSTANCE]') + >>> + >>> # TODO: Initialize `redis_version`: + >>> redis_version = '' + >>> + >>> response = client.upgrade_instance(name, redis_version) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + name (str): Required. Redis instance resource name using the form: + ``projects/{project_id}/locations/{location_id}/instances/{instance_id}`` + where ``location_id`` refers to a GCP region. + redis_version (str): Required. Specifies the target version of Redis software to upgrade to. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.redis_v1beta1.types._OperationFuture` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "upgrade_instance" not in self._inner_api_calls: + self._inner_api_calls[ + "upgrade_instance" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.upgrade_instance, + default_retry=self._method_configs["UpgradeInstance"].retry, + default_timeout=self._method_configs["UpgradeInstance"].timeout, + client_info=self._client_info, + ) + + request = cloud_redis_pb2.UpgradeInstanceRequest( + name=name, redis_version=redis_version + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + operation = self._inner_api_calls["upgrade_instance"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + return google.api_core.operation.from_gapic( + operation, + self.transport._operations_client, + cloud_redis_pb2.Instance, + metadata_type=any_pb2.Any, + ) diff --git a/google/cloud/redis_v1beta1/gapic/cloud_redis_client_config.py b/google/cloud/redis_v1beta1/gapic/cloud_redis_client_config.py index 262a77d..f121cc9 100644 --- a/google/cloud/redis_v1beta1/gapic/cloud_redis_client_config.py +++ b/google/cloud/redis_v1beta1/gapic/cloud_redis_client_config.py @@ -57,6 +57,11 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, + "UpgradeInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, }, } } diff --git a/google/cloud/redis_v1beta1/gapic/enums.py b/google/cloud/redis_v1beta1/gapic/enums.py index 6f76482..085c094 100644 --- a/google/cloud/redis_v1beta1/gapic/enums.py +++ b/google/cloud/redis_v1beta1/gapic/enums.py @@ -22,6 +22,8 @@ class FailoverInstanceRequest(object): class DataProtectionMode(enum.IntEnum): """ + Specifies different modes of operation in relation to the data retention. + Attributes: DATA_PROTECTION_MODE_UNSPECIFIED (int): Defaults to LIMITED\_DATA\_LOSS if a data protection mode is not specified. @@ -38,6 +40,21 @@ class DataProtectionMode(enum.IntEnum): class Instance(object): + class ConnectMode(enum.IntEnum): + """ + Available connection modes. + + Attributes: + CONNECT_MODE_UNSPECIFIED (int): Not set. + DIRECT_PEERING (int): Connect via directly peering with memorystore redis hosted service. + PRIVATE_SERVICE_ACCESS (int): Connect with google via private service access and share connection + across google managed services. + """ + + CONNECT_MODE_UNSPECIFIED = 0 + DIRECT_PEERING = 1 + PRIVATE_SERVICE_ACCESS = 2 + class State(enum.IntEnum): """ Represents the different states of a Redis instance. diff --git a/google/cloud/redis_v1beta1/gapic/transports/cloud_redis_grpc_transport.py b/google/cloud/redis_v1beta1/gapic/transports/cloud_redis_grpc_transport.py index 7ab4727..f5c24d6 100644 --- a/google/cloud/redis_v1beta1/gapic/transports/cloud_redis_grpc_transport.py +++ b/google/cloud/redis_v1beta1/gapic/transports/cloud_redis_grpc_transport.py @@ -254,3 +254,17 @@ def delete_instance(self): deserialized response object. """ return self._stubs["cloud_redis_stub"].DeleteInstance + + @property + def upgrade_instance(self): + """Return the gRPC stub for :meth:`CloudRedisClient.upgrade_instance`. + + Upgrades Redis instance to the newer Redis version specified in the + request. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["cloud_redis_stub"].UpgradeInstance diff --git a/google/cloud/redis_v1beta1/proto/cloud_redis.proto b/google/cloud/redis_v1beta1/proto/cloud_redis.proto index eafd8eb..968523f 100644 --- a/google/cloud/redis_v1beta1/proto/cloud_redis.proto +++ b/google/cloud/redis_v1beta1/proto/cloud_redis.proto @@ -53,6 +53,7 @@ service CloudRedis { // location (region) or all locations. // // The location should have the following format: + // // * `projects/{project_id}/locations/{location_id}` // // If `location_id` is specified as `-` (wildcard), then all regions @@ -113,6 +114,20 @@ service CloudRedis { }; } + // Upgrades Redis instance to the newer Redis version specified in the + // request. + rpc UpgradeInstance(UpgradeInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/instances/*}:upgrade" + body: "*" + }; + option (google.api.method_signature) = "name,redis_version"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.redis.v1beta1.Instance" + metadata_type: "google.protobuf.Any" + }; + } + // Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. // // Redis may stop serving during this operation. Instance state will be @@ -230,6 +245,19 @@ message Instance { STANDARD_HA = 3; } + // Available connection modes. + enum ConnectMode { + // Not set. + CONNECT_MODE_UNSPECIFIED = 0; + + // Connect via directly peering with memorystore redis hosted service. + DIRECT_PEERING = 1; + + // Connect with google via private service access and share connection + // across google managed services. + PRIVATE_SERVICE_ACCESS = 2; + } + // Required. Unique name of the resource in this scope including project and // location using the form: // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` @@ -237,8 +265,8 @@ message Instance { // Note: Redis instances are managed and addressed at regional level so // location_id here refers to a GCP region; however, users may choose which // specific zone (or collection of zones for cross-zone instances) an instance - // should be provisioned in. Refer to [location_id] and - // [alternative_location_id] fields for more details. + // should be provisioned in. Refer to [location_id][google.cloud.redis.v1beta1.Instance.location_id] and + // [alternative_location_id][google.cloud.redis.v1beta1.Instance.alternative_location_id] fields for more details. string name = 1 [(google.api.field_behavior) = REQUIRED]; // An arbitrary and optional user-provided name for the instance. @@ -250,19 +278,18 @@ message Instance { // Optional. The zone where the instance will be provisioned. If not provided, // the service will choose a zone for the instance. For STANDARD_HA tier, // instances will be created across two zones for protection against zonal - // failures. If [alternative_location_id] is also provided, it must be - // different from [location_id]. + // failures. If [alternative_location_id][google.cloud.redis.v1beta1.Instance.alternative_location_id] is also provided, it must be + // different from [location_id][google.cloud.redis.v1beta1.Instance.location_id]. string location_id = 4 [(google.api.field_behavior) = OPTIONAL]; // Optional. Only applicable to STANDARD_HA tier which protects the instance // against zonal failures by provisioning it across two zones. If provided, it - // must be a different zone from the one provided in [location_id]. + // must be a different zone from the one provided in [location_id][google.cloud.redis.v1beta1.Instance.location_id]. string alternative_location_id = 5 [(google.api.field_behavior) = OPTIONAL]; // Optional. The version of Redis software. - // If not provided, latest supported version will be used. Updating the - // version will perform an upgrade/downgrade to the new version. Currently, - // the supported values are: + // If not provided, latest supported version will be used. Currently, the + // supported values are: // // * `REDIS_4_0` for Redis 4.0 compatibility (default) // * `REDIS_3_2` for Redis 3.2 compatibility @@ -282,9 +309,9 @@ message Instance { int32 port = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The current zone where the Redis endpoint is placed. For Basic - // Tier instances, this will always be the same as the [location_id] + // Tier instances, this will always be the same as the [location_id][google.cloud.redis.v1beta1.Instance.location_id] // provided by the user at creation time. For Standard Tier instances, - // this can be either [location_id] or [alternative_location_id] and can + // this can be either [location_id][google.cloud.redis.v1beta1.Instance.location_id] or [alternative_location_id][google.cloud.redis.v1beta1.Instance.alternative_location_id] and can // change after a failover event. string current_location_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -332,6 +359,11 @@ message Instance { // for a given instance so should be checked before each import/export // operation. string persistence_iam_identity = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The connect mode of Redis instance. + // If not provided, default one will be used. + // Current default: DIRECT_PEERING. + ConnectMode connect_mode = 22 [(google.api.field_behavior) = OPTIONAL]; } // Request for [ListInstances][google.cloud.redis.v1beta1.CloudRedis.ListInstances]. @@ -351,12 +383,12 @@ message ListInstancesRequest { // If not specified, a default value of 1000 will be used by the service. // Regardless of the page_size value, the response may include a partial list // and a caller should only rely on response's - // [next_page_token][CloudRedis.ListInstancesResponse.next_page_token] + // [`next_page_token`][google.cloud.redis.v1beta1.ListInstancesResponse.next_page_token] // to determine if there are more instances left to be queried. int32 page_size = 2; - // The next_page_token value returned from a previous List request, - // if any. + // The `next_page_token` value returned from a previous + // [ListInstances][google.cloud.redis.v1beta1.CloudRedis.ListInstances] request, if any. string page_token = 3; } @@ -368,10 +400,10 @@ message ListInstancesResponse { // If the `location_id` in the parent field of the request is "-", all regions // available to the project are queried, and the results aggregated. // If in such an aggregated query a location is unavailable, a dummy Redis - // entry is included in the response with the "name" field set to a value of - // the form projects/{project_id}/locations/{location_id}/instances/- and the - // "status" field set to ERROR and "status_message" field set to "location not - // available for ListInstances". + // entry is included in the response with the `name` field set to a value of + // the form `projects/{project_id}/locations/{location_id}/instances/`- and + // the `status` field set to ERROR and `status_message` field set to "location + // not available for ListInstances". repeated Instance instances = 1; // Token to retrieve the next page of results, or empty if there are no more @@ -438,6 +470,22 @@ message UpdateInstanceRequest { Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; } +// Request for [UpgradeInstance][google.cloud.redis.v1beta1.CloudRedis.UpgradeInstance]. +message UpgradeInstanceRequest { + // Required. Redis instance resource name using the form: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // where `location_id` refers to a GCP region. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "redis.googleapis.com/Instance" + } + ]; + + // Required. Specifies the target version of Redis software to upgrade to. + string redis_version = 2 [(google.api.field_behavior) = REQUIRED]; +} + // Request for [DeleteInstance][google.cloud.redis.v1beta1.CloudRedis.DeleteInstance]. message DeleteInstanceRequest { // Required. Redis instance resource name using the form: @@ -506,6 +554,7 @@ message ExportInstanceRequest { // Request for [Failover][google.cloud.redis.v1beta1.CloudRedis.FailoverInstance]. message FailoverInstanceRequest { + // Specifies different modes of operation in relation to the data retention. enum DataProtectionMode { // Defaults to LIMITED_DATA_LOSS if a data protection mode is not // specified. diff --git a/google/cloud/redis_v1beta1/proto/cloud_redis_pb2.py b/google/cloud/redis_v1beta1/proto/cloud_redis_pb2.py index 528075a..96fe440 100644 --- a/google/cloud/redis_v1beta1/proto/cloud_redis_pb2.py +++ b/google/cloud/redis_v1beta1/proto/cloud_redis_pb2.py @@ -34,7 +34,7 @@ "\n\036com.google.cloud.redis.v1beta1B\032CloudRedisServiceBetaProtoP\001Z?google.golang.org/genproto/googleapis/cloud/redis/v1beta1;redis" ), serialized_pb=_b( - '\n2google/cloud/redis_v1beta1/proto/cloud_redis.proto\x12\x1agoogle.cloud.redis.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xda\x08\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12@\n\x06labels\x18\x03 \x03(\x0b\x32\x30.google.cloud.redis.v1beta1.Instance.LabelsEntry\x12\x18\n\x0blocation_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17\x61lternative_location_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rredis_version\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11reserved_ip_range\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04host\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04port\x18\x0b \x01(\x05\x42\x03\xe0\x41\x03\x12 \n\x13\x63urrent_location_id\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12>\n\x05state\x18\x0e \x01(\x0e\x32*.google.cloud.redis.v1beta1.Instance.StateB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12R\n\rredis_configs\x18\x10 \x03(\x0b\x32\x36.google.cloud.redis.v1beta1.Instance.RedisConfigsEntryB\x03\xe0\x41\x01\x12<\n\x04tier\x18\x11 \x01(\x0e\x32).google.cloud.redis.v1beta1.Instance.TierB\x03\xe0\x41\x02\x12\x1b\n\x0ememory_size_gb\x18\x12 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1f\n\x12\x61uthorized_network\x18\x14 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18persistence_iam_identity\x18\x15 \x01(\tB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11RedisConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\x94\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\r\n\tREPAIRING\x10\x05\x12\x0f\n\x0bMAINTENANCE\x10\x06\x12\r\n\tIMPORTING\x10\x08\x12\x10\n\x0c\x46\x41ILING_OVER\x10\n"8\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x0f\n\x0bSTANDARD_HA\x10\x03:`\xea\x41]\n\x1dredis.googleapis.com/Instance\x12"2/v1beta1/{parent=projects/*/locations/*}/instances:\x08instance\xda\x41\x1bparent,instance_id,instance\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\x12\x86\x02\n\x0eUpdateInstance\x12\x31.google.cloud.redis.v1beta1.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation"\xa1\x01\x82\xd3\xe4\x93\x02G2;/v1beta1/{instance.name=projects/*/locations/*/instances/*}:\x08instance\xda\x41\x14update_mask,instance\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\x12\xfa\x01\n\x0eImportInstance\x12\x31.google.cloud.redis.v1beta1.ImportInstanceRequest\x1a\x1d.google.longrunning.Operation"\x95\x01\x82\xd3\xe4\x93\x02>"9/v1beta1/{name=projects/*/locations/*/instances/*}:import:\x01*\xda\x41\x11name,input_config\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\x12\xfb\x01\n\x0e\x45xportInstance\x12\x31.google.cloud.redis.v1beta1.ExportInstanceRequest\x1a\x1d.google.longrunning.Operation"\x96\x01\x82\xd3\xe4\x93\x02>"9/v1beta1/{name=projects/*/locations/*/instances/*}:export:\x01*\xda\x41\x12name,output_config\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\x12\x88\x02\n\x10\x46\x61iloverInstance\x12\x33.google.cloud.redis.v1beta1.FailoverInstanceRequest\x1a\x1d.google.longrunning.Operation"\x9f\x01\x82\xd3\xe4\x93\x02@";/v1beta1/{name=projects/*/locations/*/instances/*}:failover:\x01*\xda\x41\x19name,data_protection_mode\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\x12\xd4\x01\n\x0e\x44\x65leteInstance\x12\x31.google.cloud.redis.v1beta1.DeleteInstanceRequest\x1a\x1d.google.longrunning.Operation"p\x82\xd3\xe4\x93\x02\x34*2/v1beta1/{name=projects/*/locations/*/instances/*}\xda\x41\x04name\xca\x41,\n\x15google.protobuf.Empty\x12\x13google.protobuf.Any\x1aH\xca\x41\x14redis.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x7f\n\x1e\x63om.google.cloud.redis.v1beta1B\x1a\x43loudRedisServiceBetaProtoP\x01Z?google.golang.org/genproto/googleapis/cloud/redis/v1beta1;redisb\x06proto3' + '\n2google/cloud/redis_v1beta1/proto/cloud_redis.proto\x12\x1agoogle.cloud.redis.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\x84\n\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12@\n\x06labels\x18\x03 \x03(\x0b\x32\x30.google.cloud.redis.v1beta1.Instance.LabelsEntry\x12\x18\n\x0blocation_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17\x61lternative_location_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rredis_version\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11reserved_ip_range\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04host\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04port\x18\x0b \x01(\x05\x42\x03\xe0\x41\x03\x12 \n\x13\x63urrent_location_id\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12>\n\x05state\x18\x0e \x01(\x0e\x32*.google.cloud.redis.v1beta1.Instance.StateB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12R\n\rredis_configs\x18\x10 \x03(\x0b\x32\x36.google.cloud.redis.v1beta1.Instance.RedisConfigsEntryB\x03\xe0\x41\x01\x12<\n\x04tier\x18\x11 \x01(\x0e\x32).google.cloud.redis.v1beta1.Instance.TierB\x03\xe0\x41\x02\x12\x1b\n\x0ememory_size_gb\x18\x12 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1f\n\x12\x61uthorized_network\x18\x14 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18persistence_iam_identity\x18\x15 \x01(\tB\x03\xe0\x41\x03\x12K\n\x0c\x63onnect_mode\x18\x16 \x01(\x0e\x32\x30.google.cloud.redis.v1beta1.Instance.ConnectModeB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11RedisConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\x94\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\r\n\tREPAIRING\x10\x05\x12\x0f\n\x0bMAINTENANCE\x10\x06\x12\r\n\tIMPORTING\x10\x08\x12\x10\n\x0c\x46\x41ILING_OVER\x10\n"8\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x0f\n\x0bSTANDARD_HA\x10\x03"[\n\x0b\x43onnectMode\x12\x1c\n\x18\x43ONNECT_MODE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x44IRECT_PEERING\x10\x01\x12\x1a\n\x16PRIVATE_SERVICE_ACCESS\x10\x02:`\xea\x41]\n\x1dredis.googleapis.com/Instance\x12"2/v1beta1/{parent=projects/*/locations/*}/instances:\x08instance\xda\x41\x1bparent,instance_id,instance\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\x12\x86\x02\n\x0eUpdateInstance\x12\x31.google.cloud.redis.v1beta1.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation"\xa1\x01\x82\xd3\xe4\x93\x02G2;/v1beta1/{instance.name=projects/*/locations/*/instances/*}:\x08instance\xda\x41\x14update_mask,instance\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\x12\xfe\x01\n\x0fUpgradeInstance\x12\x32.google.cloud.redis.v1beta1.UpgradeInstanceRequest\x1a\x1d.google.longrunning.Operation"\x97\x01\x82\xd3\xe4\x93\x02?":/v1beta1/{name=projects/*/locations/*/instances/*}:upgrade:\x01*\xda\x41\x12name,redis_version\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\x12\xfa\x01\n\x0eImportInstance\x12\x31.google.cloud.redis.v1beta1.ImportInstanceRequest\x1a\x1d.google.longrunning.Operation"\x95\x01\x82\xd3\xe4\x93\x02>"9/v1beta1/{name=projects/*/locations/*/instances/*}:import:\x01*\xda\x41\x11name,input_config\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\x12\xfb\x01\n\x0e\x45xportInstance\x12\x31.google.cloud.redis.v1beta1.ExportInstanceRequest\x1a\x1d.google.longrunning.Operation"\x96\x01\x82\xd3\xe4\x93\x02>"9/v1beta1/{name=projects/*/locations/*/instances/*}:export:\x01*\xda\x41\x12name,output_config\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\x12\x88\x02\n\x10\x46\x61iloverInstance\x12\x33.google.cloud.redis.v1beta1.FailoverInstanceRequest\x1a\x1d.google.longrunning.Operation"\x9f\x01\x82\xd3\xe4\x93\x02@";/v1beta1/{name=projects/*/locations/*/instances/*}:failover:\x01*\xda\x41\x19name,data_protection_mode\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\x12\xd4\x01\n\x0e\x44\x65leteInstance\x12\x31.google.cloud.redis.v1beta1.DeleteInstanceRequest\x1a\x1d.google.longrunning.Operation"p\x82\xd3\xe4\x93\x02\x34*2/v1beta1/{name=projects/*/locations/*/instances/*}\xda\x41\x04name\xca\x41,\n\x15google.protobuf.Empty\x12\x13google.protobuf.Any\x1aH\xca\x41\x14redis.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x7f\n\x1e\x63om.google.cloud.redis.v1beta1B\x1a\x43loudRedisServiceBetaProtoP\x01Z?google.golang.org/genproto/googleapis/cloud/redis/v1beta1;redisb\x06proto3' ), dependencies=[ google_dot_api_dot_annotations__pb2.DESCRIPTOR, @@ -88,8 +88,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=1112, - serialized_end=1260, + serialized_start=1189, + serialized_end=1337, ) _sym_db.RegisterEnumDescriptor(_INSTANCE_STATE) @@ -115,11 +115,42 @@ ], containing_type=None, serialized_options=None, - serialized_start=1262, - serialized_end=1318, + serialized_start=1339, + serialized_end=1395, ) _sym_db.RegisterEnumDescriptor(_INSTANCE_TIER) +_INSTANCE_CONNECTMODE = _descriptor.EnumDescriptor( + name="ConnectMode", + full_name="google.cloud.redis.v1beta1.Instance.ConnectMode", + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name="CONNECT_MODE_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="DIRECT_PEERING", index=1, number=1, serialized_options=None, type=None + ), + _descriptor.EnumValueDescriptor( + name="PRIVATE_SERVICE_ACCESS", + index=2, + number=2, + serialized_options=None, + type=None, + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=1397, + serialized_end=1488, +) +_sym_db.RegisterEnumDescriptor(_INSTANCE_CONNECTMODE) + _FAILOVERINSTANCEREQUEST_DATAPROTECTIONMODE = _descriptor.EnumDescriptor( name="DataProtectionMode", full_name="google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode", @@ -150,8 +181,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2803, - serialized_end=2905, + serialized_start=3080, + serialized_end=3182, ) _sym_db.RegisterEnumDescriptor(_FAILOVERINSTANCEREQUEST_DATAPROTECTIONMODE) @@ -208,8 +239,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1011, - serialized_end=1056, + serialized_start=1088, + serialized_end=1133, ) _INSTANCE_REDISCONFIGSENTRY = _descriptor.Descriptor( @@ -264,8 +295,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1058, - serialized_end=1109, + serialized_start=1135, + serialized_end=1186, ) _INSTANCE = _descriptor.Descriptor( @@ -599,10 +630,28 @@ serialized_options=_b("\340A\003"), file=DESCRIPTOR, ), + _descriptor.FieldDescriptor( + name="connect_mode", + full_name="google.cloud.redis.v1beta1.Instance.connect_mode", + index=18, + number=22, + type=14, + cpp_type=8, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b("\340A\001"), + file=DESCRIPTOR, + ), ], extensions=[], nested_types=[_INSTANCE_LABELSENTRY, _INSTANCE_REDISCONFIGSENTRY], - enum_types=[_INSTANCE_STATE, _INSTANCE_TIER], + enum_types=[_INSTANCE_STATE, _INSTANCE_TIER, _INSTANCE_CONNECTMODE], serialized_options=_b( "\352A]\n\035redis.googleapis.com/Instance\022