diff --git a/google-api-grpc/grpc-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisGrpc.java b/google-api-grpc/grpc-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisGrpc.java index 61592f75a56b..7b8ad9d84716 100644 --- a/google-api-grpc/grpc-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisGrpc.java +++ b/google-api-grpc/grpc-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisGrpc.java @@ -254,6 +254,60 @@ private CloudRedisGrpc() {} return getUpdateInstanceMethod; } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getFailoverInstanceMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.redis.v1beta1.FailoverInstanceRequest, com.google.longrunning.Operation> + METHOD_FAILOVER_INSTANCE = getFailoverInstanceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.redis.v1beta1.FailoverInstanceRequest, com.google.longrunning.Operation> + getFailoverInstanceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.redis.v1beta1.FailoverInstanceRequest, com.google.longrunning.Operation> + getFailoverInstanceMethod() { + return getFailoverInstanceMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.redis.v1beta1.FailoverInstanceRequest, com.google.longrunning.Operation> + getFailoverInstanceMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.redis.v1beta1.FailoverInstanceRequest, + com.google.longrunning.Operation> + getFailoverInstanceMethod; + if ((getFailoverInstanceMethod = CloudRedisGrpc.getFailoverInstanceMethod) == null) { + synchronized (CloudRedisGrpc.class) { + if ((getFailoverInstanceMethod = CloudRedisGrpc.getFailoverInstanceMethod) == null) { + CloudRedisGrpc.getFailoverInstanceMethod = + getFailoverInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.redis.v1beta1.CloudRedis", "FailoverInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.redis.v1beta1.FailoverInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudRedisMethodDescriptorSupplier("FailoverInstance")) + .build(); + } + } + } + return getFailoverInstanceMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") @java.lang.Deprecated // Use {@link #getDeleteInstanceMethod()} instead. public static final io.grpc.MethodDescriptor< @@ -380,7 +434,7 @@ public void getInstance( * *
      * Creates a Redis instance based on the specified tier and memory size.
-     * By default, the instance is peered to the project's
+     * By default, the instance is accessible from the project's
      * [default network](/compute/docs/networks-and-firewalls#networks).
      * The creation is executed asynchronously and callers may check the returned
      * operation to track its progress. Once the operation is completed the Redis
@@ -412,6 +466,20 @@ public void updateInstance(
       asyncUnimplementedUnaryCall(getUpdateInstanceMethodHelper(), responseObserver);
     }
 
+    /**
+     *
+     *
+     * 
+     * Failover the master role to current replica node against a specific
+     * STANDARD tier redis instance.
+     * 
+ */ + public void failoverInstance( + com.google.cloud.redis.v1beta1.FailoverInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getFailoverInstanceMethodHelper(), responseObserver); + } + /** * * @@ -454,6 +522,12 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.redis.v1beta1.UpdateInstanceRequest, com.google.longrunning.Operation>(this, METHODID_UPDATE_INSTANCE))) + .addMethod( + getFailoverInstanceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.redis.v1beta1.FailoverInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_FAILOVER_INSTANCE))) .addMethod( getDeleteInstanceMethodHelper(), asyncUnaryCall( @@ -539,7 +613,7 @@ public void getInstance( * *
      * Creates a Redis instance based on the specified tier and memory size.
-     * By default, the instance is peered to the project's
+     * By default, the instance is accessible from the project's
      * [default network](/compute/docs/networks-and-firewalls#networks).
      * The creation is executed asynchronously and callers may check the returned
      * operation to track its progress. Once the operation is completed the Redis
@@ -577,6 +651,23 @@ public void updateInstance(
           responseObserver);
     }
 
+    /**
+     *
+     *
+     * 
+     * Failover the master role to current replica node against a specific
+     * STANDARD tier redis instance.
+     * 
+ */ + public void failoverInstance( + com.google.cloud.redis.v1beta1.FailoverInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getFailoverInstanceMethodHelper(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -665,7 +756,7 @@ public com.google.cloud.redis.v1beta1.Instance getInstance( * *
      * Creates a Redis instance based on the specified tier and memory size.
-     * By default, the instance is peered to the project's
+     * By default, the instance is accessible from the project's
      * [default network](/compute/docs/networks-and-firewalls#networks).
      * The creation is executed asynchronously and callers may check the returned
      * operation to track its progress. Once the operation is completed the Redis
@@ -697,6 +788,20 @@ public com.google.longrunning.Operation updateInstance(
           getChannel(), getUpdateInstanceMethodHelper(), getCallOptions(), request);
     }
 
+    /**
+     *
+     *
+     * 
+     * Failover the master role to current replica node against a specific
+     * STANDARD tier redis instance.
+     * 
+ */ + public com.google.longrunning.Operation failoverInstance( + com.google.cloud.redis.v1beta1.FailoverInstanceRequest request) { + return blockingUnaryCall( + getChannel(), getFailoverInstanceMethodHelper(), getCallOptions(), request); + } + /** * * @@ -783,7 +888,7 @@ protected CloudRedisFutureStub build(io.grpc.Channel channel, io.grpc.CallOption * *
      * Creates a Redis instance based on the specified tier and memory size.
-     * By default, the instance is peered to the project's
+     * By default, the instance is accessible from the project's
      * [default network](/compute/docs/networks-and-firewalls#networks).
      * The creation is executed asynchronously and callers may check the returned
      * operation to track its progress. Once the operation is completed the Redis
@@ -815,6 +920,20 @@ protected CloudRedisFutureStub build(io.grpc.Channel channel, io.grpc.CallOption
           getChannel().newCall(getUpdateInstanceMethodHelper(), getCallOptions()), request);
     }
 
+    /**
+     *
+     *
+     * 
+     * Failover the master role to current replica node against a specific
+     * STANDARD tier redis instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + failoverInstance(com.google.cloud.redis.v1beta1.FailoverInstanceRequest request) { + return futureUnaryCall( + getChannel().newCall(getFailoverInstanceMethodHelper(), getCallOptions()), request); + } + /** * * @@ -834,7 +953,8 @@ protected CloudRedisFutureStub build(io.grpc.Channel channel, io.grpc.CallOption private static final int METHODID_GET_INSTANCE = 1; private static final int METHODID_CREATE_INSTANCE = 2; private static final int METHODID_UPDATE_INSTANCE = 3; - private static final int METHODID_DELETE_INSTANCE = 4; + private static final int METHODID_FAILOVER_INSTANCE = 4; + private static final int METHODID_DELETE_INSTANCE = 5; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -875,6 +995,11 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.redis.v1beta1.UpdateInstanceRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_FAILOVER_INSTANCE: + serviceImpl.failoverInstance( + (com.google.cloud.redis.v1beta1.FailoverInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_DELETE_INSTANCE: serviceImpl.deleteInstance( (com.google.cloud.redis.v1beta1.DeleteInstanceRequest) request, @@ -948,6 +1073,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getGetInstanceMethodHelper()) .addMethod(getCreateInstanceMethodHelper()) .addMethod(getUpdateInstanceMethodHelper()) + .addMethod(getFailoverInstanceMethodHelper()) .addMethod(getDeleteInstanceMethodHelper()) .build(); } diff --git a/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisServiceBetaProto.java b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisServiceBetaProto.java index 1d05b115ace2..c373d10cb86e 100644 --- a/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisServiceBetaProto.java +++ b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisServiceBetaProto.java @@ -48,6 +48,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_redis_v1beta1_DeleteInstanceRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_redis_v1beta1_DeleteInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_v1beta1_FailoverInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_v1beta1_FailoverInstanceRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_redis_v1beta1_LocationMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -71,75 +75,88 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n,google/cloud/redis/v1beta1/cloud_redis" + ".proto\022\032google.cloud.redis.v1beta1\032\034goog" - + "le/api/annotations.proto\032#google/longrun" - + "ning/operations.proto\032 google/protobuf/f" - + "ield_mask.proto\032\037google/protobuf/timesta" - + "mp.proto\"\344\006\n\010Instance\022\014\n\004name\030\001 \001(\t\022\024\n\014d" - + "isplay_name\030\002 \001(\t\022@\n\006labels\030\003 \003(\01320.goog" - + "le.cloud.redis.v1beta1.Instance.LabelsEn" - + "try\022\023\n\013location_id\030\004 \001(\t\022\037\n\027alternative_" - + "location_id\030\005 \001(\t\022\025\n\rredis_version\030\007 \001(\t" - + "\022\031\n\021reserved_ip_range\030\t \001(\t\022\014\n\004host\030\n \001(" - + "\t\022\014\n\004port\030\013 \001(\005\022\033\n\023current_location_id\030\014" - + " \001(\t\022/\n\013create_time\030\r \001(\0132\032.google.proto" - + "buf.Timestamp\0229\n\005state\030\016 \001(\0162*.google.cl" - + "oud.redis.v1beta1.Instance.State\022\026\n\016stat" - + "us_message\030\017 \001(\t\022M\n\rredis_configs\030\020 \003(\0132" - + "6.google.cloud.redis.v1beta1.Instance.Re" - + "disConfigsEntry\0227\n\004tier\030\021 \001(\0162).google.c" - + "loud.redis.v1beta1.Instance.Tier\022\026\n\016memo" - + "ry_size_gb\030\022 \001(\005\022\032\n\022authorized_network\030\024" - + " \001(\t\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu" - + "e\030\002 \001(\t:\0028\001\0323\n\021RedisConfigsEntry\022\013\n\003key\030" - + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"s\n\005State\022\025\n\021STA" - + "TE_UNSPECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005READY\020" - + "\002\022\014\n\010UPDATING\020\003\022\014\n\010DELETING\020\004\022\r\n\tREPAIRI" - + "NG\020\005\022\017\n\013MAINTENANCE\020\006\"8\n\004Tier\022\024\n\020TIER_UN" - + "SPECIFIED\020\000\022\t\n\005BASIC\020\001\022\017\n\013STANDARD_HA\020\003\"" - + "M\n\024ListInstancesRequest\022\016\n\006parent\030\001 \001(\t\022" - + "\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"i" - + "\n\025ListInstancesResponse\0227\n\tinstances\030\001 \003" - + "(\0132$.google.cloud.redis.v1beta1.Instance" - + "\022\027\n\017next_page_token\030\002 \001(\t\"\"\n\022GetInstance" - + "Request\022\014\n\004name\030\001 \001(\t\"t\n\025CreateInstanceR" - + "equest\022\016\n\006parent\030\001 \001(\t\022\023\n\013instance_id\030\002 " - + "\001(\t\0226\n\010instance\030\003 \001(\0132$.google.cloud.red" - + "is.v1beta1.Instance\"\200\001\n\025UpdateInstanceRe" - + "quest\022/\n\013update_mask\030\001 \001(\0132\032.google.prot" - + "obuf.FieldMask\0226\n\010instance\030\002 \001(\0132$.googl" - + "e.cloud.redis.v1beta1.Instance\"%\n\025Delete" - + "InstanceRequest\022\014\n\004name\030\001 \001(\t\"\316\001\n\020Locati" - + "onMetadata\022Y\n\017available_zones\030\001 \003(\0132@.go" - + "ogle.cloud.redis.v1beta1.LocationMetadat" - + "a.AvailableZonesEntry\032_\n\023AvailableZonesE" - + "ntry\022\013\n\003key\030\001 \001(\t\0227\n\005value\030\002 \001(\0132(.googl" - + "e.cloud.redis.v1beta1.ZoneMetadata:\0028\001\"\016" - + "\n\014ZoneMetadata2\341\006\n\nCloudRedis\022\260\001\n\rListIn" - + "stances\0220.google.cloud.redis.v1beta1.Lis" - + "tInstancesRequest\0321.google.cloud.redis.v" - + "1beta1.ListInstancesResponse\":\202\323\344\223\0024\0222/v" - + "1beta1/{parent=projects/*/locations/*}/i" - + "nstances\022\237\001\n\013GetInstance\022..google.cloud." - + "redis.v1beta1.GetInstanceRequest\032$.googl" - + "e.cloud.redis.v1beta1.Instance\":\202\323\344\223\0024\0222" - + "/v1beta1/{name=projects/*/locations/*/in" - + "stances/*}\022\250\001\n\016CreateInstance\0221.google.c" - + "loud.redis.v1beta1.CreateInstanceRequest" - + "\032\035.google.longrunning.Operation\"D\202\323\344\223\002>\"" - + "2/v1beta1/{parent=projects/*/locations/*" - + "}/instances:\010instance\022\261\001\n\016UpdateInstance" - + "\0221.google.cloud.redis.v1beta1.UpdateInst" - + "anceRequest\032\035.google.longrunning.Operati" - + "on\"M\202\323\344\223\002G2;/v1beta1/{instance.name=proj" - + "ects/*/locations/*/instances/*}:\010instanc" - + "e\022\236\001\n\016DeleteInstance\0221.google.cloud.redi" - + "s.v1beta1.DeleteInstanceRequest\032\035.google" - + ".longrunning.Operation\":\202\323\344\223\0024*2/v1beta1" - + "/{name=projects/*/locations/*/instances/" - + "*}B\177\n\036com.google.cloud.redis.v1beta1B\032Cl" - + "oudRedisServiceBetaProtoP\001Z?google.golan" - + "g.org/genproto/googleapis/cloud/redis/v1" - + "beta1;redisb\006proto3" + + "le/api/annotations.proto\032\031google/api/res" + + "ource.proto\032#google/longrunning/operatio" + + "ns.proto\032 google/protobuf/field_mask.pro" + + "to\032\037google/protobuf/timestamp.proto\"\206\007\n\010" + + "Instance\022\014\n\004name\030\001 \001(\t\022\024\n\014display_name\030\002" + + " \001(\t\022@\n\006labels\030\003 \003(\01320.google.cloud.redi" + + "s.v1beta1.Instance.LabelsEntry\022\023\n\013locati" + + "on_id\030\004 \001(\t\022\037\n\027alternative_location_id\030\005" + + " \001(\t\022\025\n\rredis_version\030\007 \001(\t\022\031\n\021reserved_" + + "ip_range\030\t \001(\t\022\014\n\004host\030\n \001(\t\022\014\n\004port\030\013 \001" + + "(\005\022\033\n\023current_location_id\030\014 \001(\t\022/\n\013creat" + + "e_time\030\r \001(\0132\032.google.protobuf.Timestamp" + + "\0229\n\005state\030\016 \001(\0162*.google.cloud.redis.v1b" + + "eta1.Instance.State\022\026\n\016status_message\030\017 " + + "\001(\t\022M\n\rredis_configs\030\020 \003(\01326.google.clou" + + "d.redis.v1beta1.Instance.RedisConfigsEnt" + + "ry\0227\n\004tier\030\021 \001(\0162).google.cloud.redis.v1" + + "beta1.Instance.Tier\022\026\n\016memory_size_gb\030\022 " + + "\001(\005\022\032\n\022authorized_network\030\024 \001(\t\032-\n\013Label" + + "sEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0323" + + "\n\021RedisConfigsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu" + + "e\030\002 \001(\t:\0028\001\"\224\001\n\005State\022\025\n\021STATE_UNSPECIFI" + + "ED\020\000\022\014\n\010CREATING\020\001\022\t\n\005READY\020\002\022\014\n\010UPDATIN" + + "G\020\003\022\014\n\010DELETING\020\004\022\r\n\tREPAIRING\020\005\022\017\n\013MAIN" + + "TENANCE\020\006\022\r\n\tIMPORTING\020\010\022\020\n\014FAILING_OVER" + + "\020\n\"8\n\004Tier\022\024\n\020TIER_UNSPECIFIED\020\000\022\t\n\005BASI" + + "C\020\001\022\017\n\013STANDARD_HA\020\003\"M\n\024ListInstancesReq" + + "uest\022\016\n\006parent\030\001 \001(\t\022\021\n\tpage_size\030\002 \001(\005\022" + + "\022\n\npage_token\030\003 \001(\t\"~\n\025ListInstancesResp" + + "onse\0227\n\tinstances\030\001 \003(\0132$.google.cloud.r" + + "edis.v1beta1.Instance\022\027\n\017next_page_token" + + "\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"\"\n\022GetInstan" + + "ceRequest\022\014\n\004name\030\001 \001(\t\"t\n\025CreateInstanc" + + "eRequest\022\016\n\006parent\030\001 \001(\t\022\023\n\013instance_id\030" + + "\002 \001(\t\0226\n\010instance\030\003 \001(\0132$.google.cloud.r" + + "edis.v1beta1.Instance\"\200\001\n\025UpdateInstance" + + "Request\022/\n\013update_mask\030\001 \001(\0132\032.google.pr" + + "otobuf.FieldMask\0226\n\010instance\030\002 \001(\0132$.goo" + + "gle.cloud.redis.v1beta1.Instance\"%\n\025Dele" + + "teInstanceRequest\022\014\n\004name\030\001 \001(\t\"\365\001\n\027Fail" + + "overInstanceRequest\022\014\n\004name\030\001 \001(\t\022d\n\024dat" + + "a_protection_mode\030\002 \001(\0162F.google.cloud.r" + + "edis.v1beta1.FailoverInstanceRequest.Dat" + + "aProtectionMode\"f\n\022DataProtectionMode\022$\n" + + " DATA_PROTECTION_MODE_UNSPECIFIED\020\000\022\025\n\021L" + + "IMITED_DATA_LOSS\020\001\022\023\n\017FORCE_DATA_LOSS\020\002\"" + + "\316\001\n\020LocationMetadata\022Y\n\017available_zones\030" + + "\001 \003(\0132@.google.cloud.redis.v1beta1.Locat" + + "ionMetadata.AvailableZonesEntry\032_\n\023Avail" + + "ableZonesEntry\022\013\n\003key\030\001 \001(\t\0227\n\005value\030\002 \001" + + "(\0132(.google.cloud.redis.v1beta1.ZoneMeta" + + "data:\0028\001\"\016\n\014ZoneMetadata2\222\010\n\nCloudRedis\022" + + "\260\001\n\rListInstances\0220.google.cloud.redis.v" + + "1beta1.ListInstancesRequest\0321.google.clo" + + "ud.redis.v1beta1.ListInstancesResponse\":" + + "\202\323\344\223\0024\0222/v1beta1/{parent=projects/*/loca" + + "tions/*}/instances\022\237\001\n\013GetInstance\022..goo" + + "gle.cloud.redis.v1beta1.GetInstanceReque" + + "st\032$.google.cloud.redis.v1beta1.Instance" + + "\":\202\323\344\223\0024\0222/v1beta1/{name=projects/*/loca" + + "tions/*/instances/*}\022\250\001\n\016CreateInstance\022" + + "1.google.cloud.redis.v1beta1.CreateInsta" + + "nceRequest\032\035.google.longrunning.Operatio" + + "n\"D\202\323\344\223\002>\"2/v1beta1/{parent=projects/*/l" + + "ocations/*}/instances:\010instance\022\261\001\n\016Upda" + + "teInstance\0221.google.cloud.redis.v1beta1." + + "UpdateInstanceRequest\032\035.google.longrunni" + + "ng.Operation\"M\202\323\344\223\002G2;/v1beta1/{instance" + + ".name=projects/*/locations/*/instances/*" + + "}:\010instance\022\256\001\n\020FailoverInstance\0223.googl" + + "e.cloud.redis.v1beta1.FailoverInstanceRe" + + "quest\032\035.google.longrunning.Operation\"F\202\323" + + "\344\223\002@\";/v1beta1/{name=projects/*/location" + + "s/*/instances/*}:failover:\001*\022\236\001\n\016DeleteI" + + "nstance\0221.google.cloud.redis.v1beta1.Del" + + "eteInstanceRequest\032\035.google.longrunning." + + "Operation\":\202\323\344\223\0024*2/v1beta1/{name=projec" + + "ts/*/locations/*/instances/*}B\177\n\036com.goo" + + "gle.cloud.redis.v1beta1B\032CloudRedisServi" + + "ceBetaProtoP\001Z?google.golang.org/genprot" + + "o/googleapis/cloud/redis/v1beta1;redisb\006" + + "proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -153,6 +170,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), com.google.protobuf.FieldMaskProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), @@ -212,7 +230,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_redis_v1beta1_ListInstancesResponse_descriptor, new java.lang.String[] { - "Instances", "NextPageToken", + "Instances", "NextPageToken", "Unreachable", }); internal_static_google_cloud_redis_v1beta1_GetInstanceRequest_descriptor = getDescriptor().getMessageTypes().get(3); @@ -246,8 +264,16 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( new java.lang.String[] { "Name", }); - internal_static_google_cloud_redis_v1beta1_LocationMetadata_descriptor = + internal_static_google_cloud_redis_v1beta1_FailoverInstanceRequest_descriptor = getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_redis_v1beta1_FailoverInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_v1beta1_FailoverInstanceRequest_descriptor, + new java.lang.String[] { + "Name", "DataProtectionMode", + }); + internal_static_google_cloud_redis_v1beta1_LocationMetadata_descriptor = + getDescriptor().getMessageTypes().get(8); internal_static_google_cloud_redis_v1beta1_LocationMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_redis_v1beta1_LocationMetadata_descriptor, @@ -265,7 +291,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( "Key", "Value", }); internal_static_google_cloud_redis_v1beta1_ZoneMetadata_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(9); internal_static_google_cloud_redis_v1beta1_ZoneMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_redis_v1beta1_ZoneMetadata_descriptor, @@ -276,6 +302,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); com.google.longrunning.OperationsProto.getDescriptor(); com.google.protobuf.FieldMaskProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); diff --git a/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/FailoverInstanceRequest.java b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/FailoverInstanceRequest.java new file mode 100644 index 000000000000..503b0dbd4a9f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/FailoverInstanceRequest.java @@ -0,0 +1,912 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1beta1/cloud_redis.proto + +package com.google.cloud.redis.v1beta1; + +/** + * + * + *
+ * Request for
+ * [Failover][google.cloud.redis.v1beta1.CloudRedis.FailoverInstance].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.v1beta1.FailoverInstanceRequest} + */ +public final class FailoverInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.v1beta1.FailoverInstanceRequest) + FailoverInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use FailoverInstanceRequest.newBuilder() to construct. + private FailoverInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FailoverInstanceRequest() { + name_ = ""; + dataProtectionMode_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FailoverInstanceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + dataProtectionMode_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.v1beta1.CloudRedisServiceBetaProto + .internal_static_google_cloud_redis_v1beta1_FailoverInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1beta1.CloudRedisServiceBetaProto + .internal_static_google_cloud_redis_v1beta1_FailoverInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1beta1.FailoverInstanceRequest.class, + com.google.cloud.redis.v1beta1.FailoverInstanceRequest.Builder.class); + } + + /** Protobuf enum {@code google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode} */ + public enum DataProtectionMode implements com.google.protobuf.ProtocolMessageEnum { + /** DATA_PROTECTION_MODE_UNSPECIFIED = 0; */ + DATA_PROTECTION_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Instance failover will be protected with data loss control. More
+     * specifically, the failover will only be performed if the current
+     * replication offset diff between master and replica is under a certain
+     * threshold.
+     * 
+ * + * LIMITED_DATA_LOSS = 1; + */ + LIMITED_DATA_LOSS(1), + /** + * + * + *
+     * Instance failover will be performed without data loss control.
+     * 
+ * + * FORCE_DATA_LOSS = 2; + */ + FORCE_DATA_LOSS(2), + UNRECOGNIZED(-1), + ; + + /** DATA_PROTECTION_MODE_UNSPECIFIED = 0; */ + public static final int DATA_PROTECTION_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Instance failover will be protected with data loss control. More
+     * specifically, the failover will only be performed if the current
+     * replication offset diff between master and replica is under a certain
+     * threshold.
+     * 
+ * + * LIMITED_DATA_LOSS = 1; + */ + public static final int LIMITED_DATA_LOSS_VALUE = 1; + /** + * + * + *
+     * Instance failover will be performed without data loss control.
+     * 
+ * + * FORCE_DATA_LOSS = 2; + */ + public static final int FORCE_DATA_LOSS_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static DataProtectionMode valueOf(int value) { + return forNumber(value); + } + + public static DataProtectionMode forNumber(int value) { + switch (value) { + case 0: + return DATA_PROTECTION_MODE_UNSPECIFIED; + case 1: + return LIMITED_DATA_LOSS; + case 2: + return FORCE_DATA_LOSS; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public DataProtectionMode findValueByNumber(int number) { + return DataProtectionMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.redis.v1beta1.FailoverInstanceRequest.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final DataProtectionMode[] VALUES = values(); + + public static DataProtectionMode valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private DataProtectionMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * 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; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * 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; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_PROTECTION_MODE_FIELD_NUMBER = 2; + private int dataProtectionMode_; + /** + * + * + *
+   * Optional. Available data protection modes that the user can choose. If it's
+   * unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
+   * 
+ * + * + * .google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode data_protection_mode = 2; + * + */ + public int getDataProtectionModeValue() { + return dataProtectionMode_; + } + /** + * + * + *
+   * Optional. Available data protection modes that the user can choose. If it's
+   * unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
+   * 
+ * + * + * .google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode data_protection_mode = 2; + * + */ + public com.google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode + getDataProtectionMode() { + @SuppressWarnings("deprecation") + com.google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode result = + com.google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode.valueOf( + dataProtectionMode_); + return result == null + ? com.google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (dataProtectionMode_ + != com.google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode + .DATA_PROTECTION_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, dataProtectionMode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (dataProtectionMode_ + != com.google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode + .DATA_PROTECTION_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, dataProtectionMode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.v1beta1.FailoverInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.redis.v1beta1.FailoverInstanceRequest other = + (com.google.cloud.redis.v1beta1.FailoverInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (dataProtectionMode_ != other.dataProtectionMode_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DATA_PROTECTION_MODE_FIELD_NUMBER; + hash = (53 * hash) + dataProtectionMode_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.v1beta1.FailoverInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.v1beta1.FailoverInstanceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.v1beta1.FailoverInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.v1beta1.FailoverInstanceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.v1beta1.FailoverInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.v1beta1.FailoverInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.v1beta1.FailoverInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.v1beta1.FailoverInstanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.v1beta1.FailoverInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.v1beta1.FailoverInstanceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.v1beta1.FailoverInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.v1beta1.FailoverInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.redis.v1beta1.FailoverInstanceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for
+   * [Failover][google.cloud.redis.v1beta1.CloudRedis.FailoverInstance].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.v1beta1.FailoverInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.v1beta1.FailoverInstanceRequest) + com.google.cloud.redis.v1beta1.FailoverInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.v1beta1.CloudRedisServiceBetaProto + .internal_static_google_cloud_redis_v1beta1_FailoverInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1beta1.CloudRedisServiceBetaProto + .internal_static_google_cloud_redis_v1beta1_FailoverInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1beta1.FailoverInstanceRequest.class, + com.google.cloud.redis.v1beta1.FailoverInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.redis.v1beta1.FailoverInstanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + dataProtectionMode_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.v1beta1.CloudRedisServiceBetaProto + .internal_static_google_cloud_redis_v1beta1_FailoverInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.v1beta1.FailoverInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.redis.v1beta1.FailoverInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.v1beta1.FailoverInstanceRequest build() { + com.google.cloud.redis.v1beta1.FailoverInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.v1beta1.FailoverInstanceRequest buildPartial() { + com.google.cloud.redis.v1beta1.FailoverInstanceRequest result = + new com.google.cloud.redis.v1beta1.FailoverInstanceRequest(this); + result.name_ = name_; + result.dataProtectionMode_ = dataProtectionMode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.v1beta1.FailoverInstanceRequest) { + return mergeFrom((com.google.cloud.redis.v1beta1.FailoverInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.v1beta1.FailoverInstanceRequest other) { + if (other == com.google.cloud.redis.v1beta1.FailoverInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.dataProtectionMode_ != 0) { + setDataProtectionModeValue(other.getDataProtectionModeValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.redis.v1beta1.FailoverInstanceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.redis.v1beta1.FailoverInstanceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * 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; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int dataProtectionMode_ = 0; + /** + * + * + *
+     * Optional. Available data protection modes that the user can choose. If it's
+     * unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
+     * 
+ * + * + * .google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode data_protection_mode = 2; + * + */ + public int getDataProtectionModeValue() { + return dataProtectionMode_; + } + /** + * + * + *
+     * Optional. Available data protection modes that the user can choose. If it's
+     * unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
+     * 
+ * + * + * .google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode data_protection_mode = 2; + * + */ + public Builder setDataProtectionModeValue(int value) { + dataProtectionMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Available data protection modes that the user can choose. If it's
+     * unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
+     * 
+ * + * + * .google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode data_protection_mode = 2; + * + */ + public com.google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode + getDataProtectionMode() { + @SuppressWarnings("deprecation") + com.google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode result = + com.google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode.valueOf( + dataProtectionMode_); + return result == null + ? com.google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Available data protection modes that the user can choose. If it's
+     * unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
+     * 
+ * + * + * .google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode data_protection_mode = 2; + * + */ + public Builder setDataProtectionMode( + com.google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode value) { + if (value == null) { + throw new NullPointerException(); + } + + dataProtectionMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Available data protection modes that the user can choose. If it's
+     * unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
+     * 
+ * + * + * .google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode data_protection_mode = 2; + * + */ + public Builder clearDataProtectionMode() { + + dataProtectionMode_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.redis.v1beta1.FailoverInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.v1beta1.FailoverInstanceRequest) + private static final com.google.cloud.redis.v1beta1.FailoverInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.v1beta1.FailoverInstanceRequest(); + } + + public static com.google.cloud.redis.v1beta1.FailoverInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FailoverInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FailoverInstanceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.redis.v1beta1.FailoverInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/FailoverInstanceRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/FailoverInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..d1391dd1e014 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/FailoverInstanceRequestOrBuilder.java @@ -0,0 +1,62 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1beta1/cloud_redis.proto + +package com.google.cloud.redis.v1beta1; + +public interface FailoverInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.v1beta1.FailoverInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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; + */ + java.lang.String getName(); + /** + * + * + *
+   * 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; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Available data protection modes that the user can choose. If it's
+   * unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
+   * 
+ * + * + * .google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode data_protection_mode = 2; + * + */ + int getDataProtectionModeValue(); + /** + * + * + *
+   * Optional. Available data protection modes that the user can choose. If it's
+   * unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
+   * 
+ * + * + * .google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode data_protection_mode = 2; + * + */ + com.google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode getDataProtectionMode(); +} diff --git a/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/Instance.java b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/Instance.java index 79523ef7d8d9..2a7d80479330 100644 --- a/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/Instance.java +++ b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/Instance.java @@ -311,8 +311,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Redis instance is being repaired and may be unusable. Details can be
-     * found in the `status_message` field.
+     * Redis instance is being repaired and may be unusable.
      * 
* * REPAIRING = 5; @@ -328,6 +327,26 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * MAINTENANCE = 6; */ MAINTENANCE(6), + /** + * + * + *
+     * Redis instance is importing data (availability may be affected).
+     * 
+ * + * IMPORTING = 8; + */ + IMPORTING(8), + /** + * + * + *
+     * Redis instance is failing over (availability may be affected).
+     * 
+ * + * FAILING_OVER = 10; + */ + FAILING_OVER(10), UNRECOGNIZED(-1), ; @@ -387,8 +406,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Redis instance is being repaired and may be unusable. Details can be
-     * found in the `status_message` field.
+     * Redis instance is being repaired and may be unusable.
      * 
* * REPAIRING = 5; @@ -404,6 +422,26 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * MAINTENANCE = 6; */ public static final int MAINTENANCE_VALUE = 6; + /** + * + * + *
+     * Redis instance is importing data (availability may be affected).
+     * 
+ * + * IMPORTING = 8; + */ + public static final int IMPORTING_VALUE = 8; + /** + * + * + *
+     * Redis instance is failing over (availability may be affected).
+     * 
+ * + * FAILING_OVER = 10; + */ + public static final int FAILING_OVER_VALUE = 10; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -435,6 +473,10 @@ public static State forNumber(int value) { return REPAIRING; case 6: return MAINTENANCE; + case 8: + return IMPORTING; + case 10: + return FAILING_OVER; default: return null; } @@ -640,7 +682,7 @@ private Tier(int value) { * location using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` * Note: Redis instances are managed and addressed at regional level so - * location_id here refers to a GCP region; however, users get to choose which + * 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. @@ -667,7 +709,7 @@ public java.lang.String getName() { * location using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` * Note: Redis instances are managed and addressed at regional level so - * location_id here refers to a GCP region; however, users get to choose which + * 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. @@ -832,7 +874,7 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { * 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 + * failures. If [alternative_location_id] is also provided, it must be * different from [location_id]. *
* @@ -856,7 +898,7 @@ public java.lang.String getLocationId() { * 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 + * failures. If [alternative_location_id] is also provided, it must be * different from [location_id]. *
* @@ -928,7 +970,11 @@ public com.google.protobuf.ByteString getAlternativeLocationIdBytes() { * *
    * Optional. The version of Redis software.
-   * If not provided, latest supported version will be used.
+   * 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:
+   *  *   `REDIS_4_0` for Redis 4.0 compatibility
+   *  *   `REDIS_3_2` for Redis 3.2 compatibility (default)
    * 
* * string redis_version = 7; @@ -949,7 +995,11 @@ public java.lang.String getRedisVersion() { * *
    * Optional. The version of Redis software.
-   * If not provided, latest supported version will be used.
+   * 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:
+   *  *   `REDIS_4_0` for Redis 4.0 compatibility
+   *  *   `REDIS_3_2` for Redis 3.2 compatibility (default)
    * 
* * string redis_version = 7; @@ -975,7 +1025,7 @@ public com.google.protobuf.ByteString getRedisVersionBytes() { * Optional. The CIDR range of internal addresses that are reserved for this * instance. If not provided, the service will choose an unused /29 block, * for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique - * and non-overlapping with existing subnets in a network. + * and non-overlapping with existing subnets in an authorized network. *
* * string reserved_ip_range = 9; @@ -998,7 +1048,7 @@ public java.lang.String getReservedIpRange() { * Optional. The CIDR range of internal addresses that are reserved for this * instance. If not provided, the service will choose an unused /29 block, * for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique - * and non-overlapping with existing subnets in a network. + * and non-overlapping with existing subnets in an authorized network. *
* * string reserved_ip_range = 9; @@ -1021,7 +1071,7 @@ public com.google.protobuf.ByteString getReservedIpRangeBytes() { * * *
-   * Output only. Hostname or IP address of the exposed redis endpoint used by
+   * Output only. Hostname or IP address of the exposed Redis endpoint used by
    * clients to connect to the service.
    * 
* @@ -1042,7 +1092,7 @@ public java.lang.String getHost() { * * *
-   * Output only. Hostname or IP address of the exposed redis endpoint used by
+   * Output only. Hostname or IP address of the exposed Redis endpoint used by
    * clients to connect to the service.
    * 
* @@ -1066,7 +1116,7 @@ public com.google.protobuf.ByteString getHostBytes() { * * *
-   * Output only. The port number of the exposed redis endpoint.
+   * Output only. The port number of the exposed Redis endpoint.
    * 
* * int32 port = 11; @@ -1081,11 +1131,11 @@ public int getPort() { * * *
-   * Output only. The current zone where the Redis endpoint is placed. In
-   * single zone deployments, this will always be the same as [location_id]
-   * provided by the user at creation time. In cross-zone instances (only
-   * applicable in STANDARD_HA tier), this can be either [location_id] or
-   * [alternative_location_id] and can change on a failover event.
+   * 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]
+   * provided by the user at creation time. For Standard Tier instances,
+   * this can be either [location_id] or [alternative_location_id] and can
+   * change after a failover event.
    * 
* * string current_location_id = 12; @@ -1105,11 +1155,11 @@ public java.lang.String getCurrentLocationId() { * * *
-   * Output only. The current zone where the Redis endpoint is placed. In
-   * single zone deployments, this will always be the same as [location_id]
-   * provided by the user at creation time. In cross-zone instances (only
-   * applicable in STANDARD_HA tier), this can be either [location_id] or
-   * [alternative_location_id] and can change on a failover event.
+   * 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]
+   * provided by the user at creation time. For Standard Tier instances,
+   * this can be either [location_id] or [alternative_location_id] and can
+   * change after a failover event.
    * 
* * string current_location_id = 12; @@ -1274,8 +1324,13 @@ public int getRedisConfigsCount() { * Optional. Redis configuration parameters, according to * http://redis.io/topics/config. Currently, the only supported parameters * are: - * * maxmemory-policy - * * notify-keyspace-events + * Redis 3.2 and above: + * * maxmemory-policy + * * notify-keyspace-events + * Redis 4.0 and above: + * * activedefrag + * * lfu-log-factor + * * lfu-decay-time * * * map<string, string> redis_configs = 16; @@ -1298,8 +1353,13 @@ public java.util.Map getRedisConfigs() { * Optional. Redis configuration parameters, according to * http://redis.io/topics/config. Currently, the only supported parameters * are: - * * maxmemory-policy - * * notify-keyspace-events + * Redis 3.2 and above: + * * maxmemory-policy + * * notify-keyspace-events + * Redis 4.0 and above: + * * activedefrag + * * lfu-log-factor + * * lfu-decay-time * * * map<string, string> redis_configs = 16; @@ -1314,8 +1374,13 @@ public java.util.Map getRedisConfigsMap() { * Optional. Redis configuration parameters, according to * http://redis.io/topics/config. Currently, the only supported parameters * are: - * * maxmemory-policy - * * notify-keyspace-events + * Redis 3.2 and above: + * * maxmemory-policy + * * notify-keyspace-events + * Redis 4.0 and above: + * * activedefrag + * * lfu-log-factor + * * lfu-decay-time * * * map<string, string> redis_configs = 16; @@ -1335,8 +1400,13 @@ public java.lang.String getRedisConfigsOrDefault( * Optional. Redis configuration parameters, according to * http://redis.io/topics/config. Currently, the only supported parameters * are: - * * maxmemory-policy - * * notify-keyspace-events + * Redis 3.2 and above: + * * maxmemory-policy + * * notify-keyspace-events + * Redis 4.0 and above: + * * activedefrag + * * lfu-log-factor + * * lfu-decay-time * * * map<string, string> redis_configs = 16; @@ -1388,7 +1458,7 @@ public com.google.cloud.redis.v1beta1.Instance.Tier getTier() { * * *
-   * Required. Redis memory size in GB.
+   * Required. Redis memory size in GiB.
    * 
* * int32 memory_size_gb = 18; @@ -2073,7 +2143,7 @@ public Builder mergeFrom( * location using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` * Note: Redis instances are managed and addressed at regional level so - * location_id here refers to a GCP region; however, users get to choose which + * 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. @@ -2100,7 +2170,7 @@ public java.lang.String getName() { * location using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` * Note: Redis instances are managed and addressed at regional level so - * location_id here refers to a GCP region; however, users get to choose which + * 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. @@ -2127,7 +2197,7 @@ public com.google.protobuf.ByteString getNameBytes() { * location using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` * Note: Redis instances are managed and addressed at regional level so - * location_id here refers to a GCP region; however, users get to choose which + * 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. @@ -2152,7 +2222,7 @@ public Builder setName(java.lang.String value) { * location using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` * Note: Redis instances are managed and addressed at regional level so - * location_id here refers to a GCP region; however, users get to choose which + * 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. @@ -2174,7 +2244,7 @@ public Builder clearName() { * location using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` * Note: Redis instances are managed and addressed at regional level so - * location_id here refers to a GCP region; however, users get to choose which + * 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. @@ -2447,7 +2517,7 @@ public Builder putAllLabels(java.util.Map va * 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 + * failures. If [alternative_location_id] is also provided, it must be * different from [location_id]. * * @@ -2471,7 +2541,7 @@ public java.lang.String getLocationId() { * 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 + * failures. If [alternative_location_id] is also provided, it must be * different from [location_id]. * * @@ -2495,7 +2565,7 @@ public com.google.protobuf.ByteString getLocationIdBytes() { * 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 + * failures. If [alternative_location_id] is also provided, it must be * different from [location_id]. * * @@ -2517,7 +2587,7 @@ public Builder setLocationId(java.lang.String value) { * 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 + * failures. If [alternative_location_id] is also provided, it must be * different from [location_id]. * * @@ -2536,7 +2606,7 @@ public Builder clearLocationId() { * 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 + * failures. If [alternative_location_id] is also provided, it must be * different from [location_id]. * * @@ -2663,7 +2733,11 @@ public Builder setAlternativeLocationIdBytes(com.google.protobuf.ByteString valu * *
      * Optional. The version of Redis software.
-     * If not provided, latest supported version will be used.
+     * 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:
+     *  *   `REDIS_4_0` for Redis 4.0 compatibility
+     *  *   `REDIS_3_2` for Redis 3.2 compatibility (default)
      * 
* * string redis_version = 7; @@ -2684,7 +2758,11 @@ public java.lang.String getRedisVersion() { * *
      * Optional. The version of Redis software.
-     * If not provided, latest supported version will be used.
+     * 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:
+     *  *   `REDIS_4_0` for Redis 4.0 compatibility
+     *  *   `REDIS_3_2` for Redis 3.2 compatibility (default)
      * 
* * string redis_version = 7; @@ -2705,7 +2783,11 @@ public com.google.protobuf.ByteString getRedisVersionBytes() { * *
      * Optional. The version of Redis software.
-     * If not provided, latest supported version will be used.
+     * 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:
+     *  *   `REDIS_4_0` for Redis 4.0 compatibility
+     *  *   `REDIS_3_2` for Redis 3.2 compatibility (default)
      * 
* * string redis_version = 7; @@ -2724,7 +2806,11 @@ public Builder setRedisVersion(java.lang.String value) { * *
      * Optional. The version of Redis software.
-     * If not provided, latest supported version will be used.
+     * 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:
+     *  *   `REDIS_4_0` for Redis 4.0 compatibility
+     *  *   `REDIS_3_2` for Redis 3.2 compatibility (default)
      * 
* * string redis_version = 7; @@ -2740,7 +2826,11 @@ public Builder clearRedisVersion() { * *
      * Optional. The version of Redis software.
-     * If not provided, latest supported version will be used.
+     * 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:
+     *  *   `REDIS_4_0` for Redis 4.0 compatibility
+     *  *   `REDIS_3_2` for Redis 3.2 compatibility (default)
      * 
* * string redis_version = 7; @@ -2764,7 +2854,7 @@ public Builder setRedisVersionBytes(com.google.protobuf.ByteString value) { * Optional. The CIDR range of internal addresses that are reserved for this * instance. If not provided, the service will choose an unused /29 block, * for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique - * and non-overlapping with existing subnets in a network. + * and non-overlapping with existing subnets in an authorized network. * * * string reserved_ip_range = 9; @@ -2787,7 +2877,7 @@ public java.lang.String getReservedIpRange() { * Optional. The CIDR range of internal addresses that are reserved for this * instance. If not provided, the service will choose an unused /29 block, * for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique - * and non-overlapping with existing subnets in a network. + * and non-overlapping with existing subnets in an authorized network. * * * string reserved_ip_range = 9; @@ -2810,7 +2900,7 @@ public com.google.protobuf.ByteString getReservedIpRangeBytes() { * Optional. The CIDR range of internal addresses that are reserved for this * instance. If not provided, the service will choose an unused /29 block, * for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique - * and non-overlapping with existing subnets in a network. + * and non-overlapping with existing subnets in an authorized network. * * * string reserved_ip_range = 9; @@ -2831,7 +2921,7 @@ public Builder setReservedIpRange(java.lang.String value) { * Optional. The CIDR range of internal addresses that are reserved for this * instance. If not provided, the service will choose an unused /29 block, * for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique - * and non-overlapping with existing subnets in a network. + * and non-overlapping with existing subnets in an authorized network. * * * string reserved_ip_range = 9; @@ -2849,7 +2939,7 @@ public Builder clearReservedIpRange() { * Optional. The CIDR range of internal addresses that are reserved for this * instance. If not provided, the service will choose an unused /29 block, * for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique - * and non-overlapping with existing subnets in a network. + * and non-overlapping with existing subnets in an authorized network. * * * string reserved_ip_range = 9; @@ -2870,7 +2960,7 @@ public Builder setReservedIpRangeBytes(com.google.protobuf.ByteString value) { * * *
-     * Output only. Hostname or IP address of the exposed redis endpoint used by
+     * Output only. Hostname or IP address of the exposed Redis endpoint used by
      * clients to connect to the service.
      * 
* @@ -2891,7 +2981,7 @@ public java.lang.String getHost() { * * *
-     * Output only. Hostname or IP address of the exposed redis endpoint used by
+     * Output only. Hostname or IP address of the exposed Redis endpoint used by
      * clients to connect to the service.
      * 
* @@ -2912,7 +3002,7 @@ public com.google.protobuf.ByteString getHostBytes() { * * *
-     * Output only. Hostname or IP address of the exposed redis endpoint used by
+     * Output only. Hostname or IP address of the exposed Redis endpoint used by
      * clients to connect to the service.
      * 
* @@ -2931,7 +3021,7 @@ public Builder setHost(java.lang.String value) { * * *
-     * Output only. Hostname or IP address of the exposed redis endpoint used by
+     * Output only. Hostname or IP address of the exposed Redis endpoint used by
      * clients to connect to the service.
      * 
* @@ -2947,7 +3037,7 @@ public Builder clearHost() { * * *
-     * Output only. Hostname or IP address of the exposed redis endpoint used by
+     * Output only. Hostname or IP address of the exposed Redis endpoint used by
      * clients to connect to the service.
      * 
* @@ -2969,7 +3059,7 @@ public Builder setHostBytes(com.google.protobuf.ByteString value) { * * *
-     * Output only. The port number of the exposed redis endpoint.
+     * Output only. The port number of the exposed Redis endpoint.
      * 
* * int32 port = 11; @@ -2981,7 +3071,7 @@ public int getPort() { * * *
-     * Output only. The port number of the exposed redis endpoint.
+     * Output only. The port number of the exposed Redis endpoint.
      * 
* * int32 port = 11; @@ -2996,7 +3086,7 @@ public Builder setPort(int value) { * * *
-     * Output only. The port number of the exposed redis endpoint.
+     * Output only. The port number of the exposed Redis endpoint.
      * 
* * int32 port = 11; @@ -3013,11 +3103,11 @@ public Builder clearPort() { * * *
-     * Output only. The current zone where the Redis endpoint is placed. In
-     * single zone deployments, this will always be the same as [location_id]
-     * provided by the user at creation time. In cross-zone instances (only
-     * applicable in STANDARD_HA tier), this can be either [location_id] or
-     * [alternative_location_id] and can change on a failover event.
+     * 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]
+     * provided by the user at creation time. For Standard Tier instances,
+     * this can be either [location_id] or [alternative_location_id] and can
+     * change after a failover event.
      * 
* * string current_location_id = 12; @@ -3037,11 +3127,11 @@ public java.lang.String getCurrentLocationId() { * * *
-     * Output only. The current zone where the Redis endpoint is placed. In
-     * single zone deployments, this will always be the same as [location_id]
-     * provided by the user at creation time. In cross-zone instances (only
-     * applicable in STANDARD_HA tier), this can be either [location_id] or
-     * [alternative_location_id] and can change on a failover event.
+     * 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]
+     * provided by the user at creation time. For Standard Tier instances,
+     * this can be either [location_id] or [alternative_location_id] and can
+     * change after a failover event.
      * 
* * string current_location_id = 12; @@ -3061,11 +3151,11 @@ public com.google.protobuf.ByteString getCurrentLocationIdBytes() { * * *
-     * Output only. The current zone where the Redis endpoint is placed. In
-     * single zone deployments, this will always be the same as [location_id]
-     * provided by the user at creation time. In cross-zone instances (only
-     * applicable in STANDARD_HA tier), this can be either [location_id] or
-     * [alternative_location_id] and can change on a failover event.
+     * 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]
+     * provided by the user at creation time. For Standard Tier instances,
+     * this can be either [location_id] or [alternative_location_id] and can
+     * change after a failover event.
      * 
* * string current_location_id = 12; @@ -3083,11 +3173,11 @@ public Builder setCurrentLocationId(java.lang.String value) { * * *
-     * Output only. The current zone where the Redis endpoint is placed. In
-     * single zone deployments, this will always be the same as [location_id]
-     * provided by the user at creation time. In cross-zone instances (only
-     * applicable in STANDARD_HA tier), this can be either [location_id] or
-     * [alternative_location_id] and can change on a failover event.
+     * 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]
+     * provided by the user at creation time. For Standard Tier instances,
+     * this can be either [location_id] or [alternative_location_id] and can
+     * change after a failover event.
      * 
* * string current_location_id = 12; @@ -3102,11 +3192,11 @@ public Builder clearCurrentLocationId() { * * *
-     * Output only. The current zone where the Redis endpoint is placed. In
-     * single zone deployments, this will always be the same as [location_id]
-     * provided by the user at creation time. In cross-zone instances (only
-     * applicable in STANDARD_HA tier), this can be either [location_id] or
-     * [alternative_location_id] and can change on a failover event.
+     * 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]
+     * provided by the user at creation time. For Standard Tier instances,
+     * this can be either [location_id] or [alternative_location_id] and can
+     * change after a failover event.
      * 
* * string current_location_id = 12; @@ -3511,8 +3601,13 @@ public int getRedisConfigsCount() { * Optional. Redis configuration parameters, according to * http://redis.io/topics/config. Currently, the only supported parameters * are: - * * maxmemory-policy - * * notify-keyspace-events + * Redis 3.2 and above: + * * maxmemory-policy + * * notify-keyspace-events + * Redis 4.0 and above: + * * activedefrag + * * lfu-log-factor + * * lfu-decay-time * * * map<string, string> redis_configs = 16; @@ -3535,8 +3630,13 @@ public java.util.Map getRedisConfigs() { * Optional. Redis configuration parameters, according to * http://redis.io/topics/config. Currently, the only supported parameters * are: - * * maxmemory-policy - * * notify-keyspace-events + * Redis 3.2 and above: + * * maxmemory-policy + * * notify-keyspace-events + * Redis 4.0 and above: + * * activedefrag + * * lfu-log-factor + * * lfu-decay-time * * * map<string, string> redis_configs = 16; @@ -3551,8 +3651,13 @@ public java.util.Map getRedisConfigsMap() { * Optional. Redis configuration parameters, according to * http://redis.io/topics/config. Currently, the only supported parameters * are: - * * maxmemory-policy - * * notify-keyspace-events + * Redis 3.2 and above: + * * maxmemory-policy + * * notify-keyspace-events + * Redis 4.0 and above: + * * activedefrag + * * lfu-log-factor + * * lfu-decay-time * * * map<string, string> redis_configs = 16; @@ -3572,8 +3677,13 @@ public java.lang.String getRedisConfigsOrDefault( * Optional. Redis configuration parameters, according to * http://redis.io/topics/config. Currently, the only supported parameters * are: - * * maxmemory-policy - * * notify-keyspace-events + * Redis 3.2 and above: + * * maxmemory-policy + * * notify-keyspace-events + * Redis 4.0 and above: + * * activedefrag + * * lfu-log-factor + * * lfu-decay-time * * * map<string, string> redis_configs = 16; @@ -3600,8 +3710,13 @@ public Builder clearRedisConfigs() { * Optional. Redis configuration parameters, according to * http://redis.io/topics/config. Currently, the only supported parameters * are: - * * maxmemory-policy - * * notify-keyspace-events + * Redis 3.2 and above: + * * maxmemory-policy + * * notify-keyspace-events + * Redis 4.0 and above: + * * activedefrag + * * lfu-log-factor + * * lfu-decay-time * * * map<string, string> redis_configs = 16; @@ -3625,8 +3740,13 @@ public java.util.Map getMutableRedisConfigs( * Optional. Redis configuration parameters, according to * http://redis.io/topics/config. Currently, the only supported parameters * are: - * * maxmemory-policy - * * notify-keyspace-events + * Redis 3.2 and above: + * * maxmemory-policy + * * notify-keyspace-events + * Redis 4.0 and above: + * * activedefrag + * * lfu-log-factor + * * lfu-decay-time * * * map<string, string> redis_configs = 16; @@ -3648,8 +3768,13 @@ public Builder putRedisConfigs(java.lang.String key, java.lang.String value) { * Optional. Redis configuration parameters, according to * http://redis.io/topics/config. Currently, the only supported parameters * are: - * * maxmemory-policy - * * notify-keyspace-events + * Redis 3.2 and above: + * * maxmemory-policy + * * notify-keyspace-events + * Redis 4.0 and above: + * * activedefrag + * * lfu-log-factor + * * lfu-decay-time * * * map<string, string> redis_configs = 16; @@ -3740,7 +3865,7 @@ public Builder clearTier() { * * *
-     * Required. Redis memory size in GB.
+     * Required. Redis memory size in GiB.
      * 
* * int32 memory_size_gb = 18; @@ -3752,7 +3877,7 @@ public int getMemorySizeGb() { * * *
-     * Required. Redis memory size in GB.
+     * Required. Redis memory size in GiB.
      * 
* * int32 memory_size_gb = 18; @@ -3767,7 +3892,7 @@ public Builder setMemorySizeGb(int value) { * * *
-     * Required. Redis memory size in GB.
+     * Required. Redis memory size in GiB.
      * 
* * int32 memory_size_gb = 18; diff --git a/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/InstanceOrBuilder.java b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/InstanceOrBuilder.java index 4fde35188732..0d3bc8d6ee3d 100644 --- a/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/InstanceOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/InstanceOrBuilder.java @@ -16,7 +16,7 @@ public interface InstanceOrBuilder * location using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` * Note: Redis instances are managed and addressed at regional level so - * location_id here refers to a GCP region; however, users get to choose which + * 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. @@ -33,7 +33,7 @@ public interface InstanceOrBuilder * location using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` * Note: Redis instances are managed and addressed at regional level so - * location_id here refers to a GCP region; however, users get to choose which + * 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. @@ -125,7 +125,7 @@ public interface InstanceOrBuilder * 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 + * failures. If [alternative_location_id] is also provided, it must be * different from [location_id]. * * @@ -139,7 +139,7 @@ public interface InstanceOrBuilder * 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 + * failures. If [alternative_location_id] is also provided, it must be * different from [location_id]. * * @@ -177,7 +177,11 @@ public interface InstanceOrBuilder * *
    * Optional. The version of Redis software.
-   * If not provided, latest supported version will be used.
+   * 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:
+   *  *   `REDIS_4_0` for Redis 4.0 compatibility
+   *  *   `REDIS_3_2` for Redis 3.2 compatibility (default)
    * 
* * string redis_version = 7; @@ -188,7 +192,11 @@ public interface InstanceOrBuilder * *
    * Optional. The version of Redis software.
-   * If not provided, latest supported version will be used.
+   * 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:
+   *  *   `REDIS_4_0` for Redis 4.0 compatibility
+   *  *   `REDIS_3_2` for Redis 3.2 compatibility (default)
    * 
* * string redis_version = 7; @@ -202,7 +210,7 @@ public interface InstanceOrBuilder * Optional. The CIDR range of internal addresses that are reserved for this * instance. If not provided, the service will choose an unused /29 block, * for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique - * and non-overlapping with existing subnets in a network. + * and non-overlapping with existing subnets in an authorized network. * * * string reserved_ip_range = 9; @@ -215,7 +223,7 @@ public interface InstanceOrBuilder * Optional. The CIDR range of internal addresses that are reserved for this * instance. If not provided, the service will choose an unused /29 block, * for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique - * and non-overlapping with existing subnets in a network. + * and non-overlapping with existing subnets in an authorized network. * * * string reserved_ip_range = 9; @@ -226,7 +234,7 @@ public interface InstanceOrBuilder * * *
-   * Output only. Hostname or IP address of the exposed redis endpoint used by
+   * Output only. Hostname or IP address of the exposed Redis endpoint used by
    * clients to connect to the service.
    * 
* @@ -237,7 +245,7 @@ public interface InstanceOrBuilder * * *
-   * Output only. Hostname or IP address of the exposed redis endpoint used by
+   * Output only. Hostname or IP address of the exposed Redis endpoint used by
    * clients to connect to the service.
    * 
* @@ -249,7 +257,7 @@ public interface InstanceOrBuilder * * *
-   * Output only. The port number of the exposed redis endpoint.
+   * Output only. The port number of the exposed Redis endpoint.
    * 
* * int32 port = 11; @@ -260,11 +268,11 @@ public interface InstanceOrBuilder * * *
-   * Output only. The current zone where the Redis endpoint is placed. In
-   * single zone deployments, this will always be the same as [location_id]
-   * provided by the user at creation time. In cross-zone instances (only
-   * applicable in STANDARD_HA tier), this can be either [location_id] or
-   * [alternative_location_id] and can change on a failover event.
+   * 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]
+   * provided by the user at creation time. For Standard Tier instances,
+   * this can be either [location_id] or [alternative_location_id] and can
+   * change after a failover event.
    * 
* * string current_location_id = 12; @@ -274,11 +282,11 @@ public interface InstanceOrBuilder * * *
-   * Output only. The current zone where the Redis endpoint is placed. In
-   * single zone deployments, this will always be the same as [location_id]
-   * provided by the user at creation time. In cross-zone instances (only
-   * applicable in STANDARD_HA tier), this can be either [location_id] or
-   * [alternative_location_id] and can change on a failover event.
+   * 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]
+   * provided by the user at creation time. For Standard Tier instances,
+   * this can be either [location_id] or [alternative_location_id] and can
+   * change after a failover event.
    * 
* * string current_location_id = 12; @@ -367,8 +375,13 @@ public interface InstanceOrBuilder * Optional. Redis configuration parameters, according to * http://redis.io/topics/config. Currently, the only supported parameters * are: - * * maxmemory-policy - * * notify-keyspace-events + * Redis 3.2 and above: + * * maxmemory-policy + * * notify-keyspace-events + * Redis 4.0 and above: + * * activedefrag + * * lfu-log-factor + * * lfu-decay-time * * * map<string, string> redis_configs = 16; @@ -381,8 +394,13 @@ public interface InstanceOrBuilder * Optional. Redis configuration parameters, according to * http://redis.io/topics/config. Currently, the only supported parameters * are: - * * maxmemory-policy - * * notify-keyspace-events + * Redis 3.2 and above: + * * maxmemory-policy + * * notify-keyspace-events + * Redis 4.0 and above: + * * activedefrag + * * lfu-log-factor + * * lfu-decay-time * * * map<string, string> redis_configs = 16; @@ -398,8 +416,13 @@ public interface InstanceOrBuilder * Optional. Redis configuration parameters, according to * http://redis.io/topics/config. Currently, the only supported parameters * are: - * * maxmemory-policy - * * notify-keyspace-events + * Redis 3.2 and above: + * * maxmemory-policy + * * notify-keyspace-events + * Redis 4.0 and above: + * * activedefrag + * * lfu-log-factor + * * lfu-decay-time * * * map<string, string> redis_configs = 16; @@ -412,8 +435,13 @@ public interface InstanceOrBuilder * Optional. Redis configuration parameters, according to * http://redis.io/topics/config. Currently, the only supported parameters * are: - * * maxmemory-policy - * * notify-keyspace-events + * Redis 3.2 and above: + * * maxmemory-policy + * * notify-keyspace-events + * Redis 4.0 and above: + * * activedefrag + * * lfu-log-factor + * * lfu-decay-time * * * map<string, string> redis_configs = 16; @@ -426,8 +454,13 @@ public interface InstanceOrBuilder * Optional. Redis configuration parameters, according to * http://redis.io/topics/config. Currently, the only supported parameters * are: - * * maxmemory-policy - * * notify-keyspace-events + * Redis 3.2 and above: + * * maxmemory-policy + * * notify-keyspace-events + * Redis 4.0 and above: + * * activedefrag + * * lfu-log-factor + * * lfu-decay-time * * * map<string, string> redis_configs = 16; @@ -459,7 +492,7 @@ public interface InstanceOrBuilder * * *
-   * Required. Redis memory size in GB.
+   * Required. Redis memory size in GiB.
    * 
* * int32 memory_size_gb = 18; diff --git a/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/ListInstancesResponse.java b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/ListInstancesResponse.java index e9e8e8b59839..fe02612b9e03 100644 --- a/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/ListInstancesResponse.java +++ b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/ListInstancesResponse.java @@ -26,6 +26,7 @@ private ListInstancesResponse(com.google.protobuf.GeneratedMessageV3.Builder private ListInstancesResponse() { instances_ = java.util.Collections.emptyList(); nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; } @java.lang.Override @@ -70,6 +71,16 @@ private ListInstancesResponse( nextPageToken_ = s; break; } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + unreachable_.add(s); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -87,6 +98,9 @@ private ListInstancesResponse( if (((mutable_bitField0_ & 0x00000001) != 0)) { instances_ = java.util.Collections.unmodifiableList(instances_); } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -257,6 +271,57 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { } } + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -277,6 +342,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!getNextPageTokenBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } unknownFields.writeTo(output); } @@ -292,6 +360,14 @@ public int getSerializedSize() { if (!getNextPageTokenBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -310,6 +386,7 @@ public boolean equals(final java.lang.Object obj) { if (!getInstancesList().equals(other.getInstancesList())) return false; if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -327,6 +404,10 @@ public int hashCode() { } hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -483,6 +564,8 @@ public Builder clear() { } nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); return this; } @@ -522,6 +605,11 @@ public com.google.cloud.redis.v1beta1.ListInstancesResponse buildPartial() { result.instances_ = instancesBuilder_.build(); } result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000004) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.unreachable_ = unreachable_; result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -604,6 +692,16 @@ public Builder mergeFrom(com.google.cloud.redis.v1beta1.ListInstancesResponse ot nextPageToken_ = other.nextPageToken_; onChanged(); } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1228,6 +1326,149 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { return this; } + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/ListInstancesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/ListInstancesResponseOrBuilder.java index d600941a4d09..069b669b23c8 100644 --- a/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/ListInstancesResponseOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/ListInstancesResponseOrBuilder.java @@ -122,4 +122,45 @@ public interface ListInstancesResponseOrBuilder * string next_page_token = 2; */ com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); } diff --git a/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/UpdateInstanceRequest.java b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/UpdateInstanceRequest.java index ecaec8aeada5..b6b091ab55d6 100644 --- a/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/UpdateInstanceRequest.java +++ b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/UpdateInstanceRequest.java @@ -122,11 +122,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { *
    * 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]:
-   * * `display_name`
-   * * `labels`
-   * * `memory_size_gb`
-   * * `redis_config`
+   * fields from [Instance][google.cloud.redis.v1beta1.Instance]:
+   *  *   `displayName`
+   *  *   `labels`
+   *  *   `memorySizeGb`
+   *  *   `redisConfig`
    * 
* * .google.protobuf.FieldMask update_mask = 1; @@ -140,11 +140,11 @@ public boolean hasUpdateMask() { *
    * 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]:
-   * * `display_name`
-   * * `labels`
-   * * `memory_size_gb`
-   * * `redis_config`
+   * fields from [Instance][google.cloud.redis.v1beta1.Instance]:
+   *  *   `displayName`
+   *  *   `labels`
+   *  *   `memorySizeGb`
+   *  *   `redisConfig`
    * 
* * .google.protobuf.FieldMask update_mask = 1; @@ -158,11 +158,11 @@ public com.google.protobuf.FieldMask getUpdateMask() { *
    * 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]:
-   * * `display_name`
-   * * `labels`
-   * * `memory_size_gb`
-   * * `redis_config`
+   * fields from [Instance][google.cloud.redis.v1beta1.Instance]:
+   *  *   `displayName`
+   *  *   `labels`
+   *  *   `memorySizeGb`
+   *  *   `redisConfig`
    * 
* * .google.protobuf.FieldMask update_mask = 1; @@ -586,11 +586,11 @@ public Builder mergeFrom( *
      * 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]:
-     * * `display_name`
-     * * `labels`
-     * * `memory_size_gb`
-     * * `redis_config`
+     * fields from [Instance][google.cloud.redis.v1beta1.Instance]:
+     *  *   `displayName`
+     *  *   `labels`
+     *  *   `memorySizeGb`
+     *  *   `redisConfig`
      * 
* * .google.protobuf.FieldMask update_mask = 1; @@ -604,11 +604,11 @@ public boolean hasUpdateMask() { *
      * 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]:
-     * * `display_name`
-     * * `labels`
-     * * `memory_size_gb`
-     * * `redis_config`
+     * fields from [Instance][google.cloud.redis.v1beta1.Instance]:
+     *  *   `displayName`
+     *  *   `labels`
+     *  *   `memorySizeGb`
+     *  *   `redisConfig`
      * 
* * .google.protobuf.FieldMask update_mask = 1; @@ -628,11 +628,11 @@ public com.google.protobuf.FieldMask getUpdateMask() { *
      * 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]:
-     * * `display_name`
-     * * `labels`
-     * * `memory_size_gb`
-     * * `redis_config`
+     * fields from [Instance][google.cloud.redis.v1beta1.Instance]:
+     *  *   `displayName`
+     *  *   `labels`
+     *  *   `memorySizeGb`
+     *  *   `redisConfig`
      * 
* * .google.protobuf.FieldMask update_mask = 1; @@ -656,11 +656,11 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { *
      * 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]:
-     * * `display_name`
-     * * `labels`
-     * * `memory_size_gb`
-     * * `redis_config`
+     * fields from [Instance][google.cloud.redis.v1beta1.Instance]:
+     *  *   `displayName`
+     *  *   `labels`
+     *  *   `memorySizeGb`
+     *  *   `redisConfig`
      * 
* * .google.protobuf.FieldMask update_mask = 1; @@ -681,11 +681,11 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForVal *
      * 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]:
-     * * `display_name`
-     * * `labels`
-     * * `memory_size_gb`
-     * * `redis_config`
+     * fields from [Instance][google.cloud.redis.v1beta1.Instance]:
+     *  *   `displayName`
+     *  *   `labels`
+     *  *   `memorySizeGb`
+     *  *   `redisConfig`
      * 
* * .google.protobuf.FieldMask update_mask = 1; @@ -711,11 +711,11 @@ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { *
      * 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]:
-     * * `display_name`
-     * * `labels`
-     * * `memory_size_gb`
-     * * `redis_config`
+     * fields from [Instance][google.cloud.redis.v1beta1.Instance]:
+     *  *   `displayName`
+     *  *   `labels`
+     *  *   `memorySizeGb`
+     *  *   `redisConfig`
      * 
* * .google.protobuf.FieldMask update_mask = 1; @@ -737,11 +737,11 @@ public Builder clearUpdateMask() { *
      * 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]:
-     * * `display_name`
-     * * `labels`
-     * * `memory_size_gb`
-     * * `redis_config`
+     * fields from [Instance][google.cloud.redis.v1beta1.Instance]:
+     *  *   `displayName`
+     *  *   `labels`
+     *  *   `memorySizeGb`
+     *  *   `redisConfig`
      * 
* * .google.protobuf.FieldMask update_mask = 1; @@ -757,11 +757,11 @@ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { *
      * 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]:
-     * * `display_name`
-     * * `labels`
-     * * `memory_size_gb`
-     * * `redis_config`
+     * fields from [Instance][google.cloud.redis.v1beta1.Instance]:
+     *  *   `displayName`
+     *  *   `labels`
+     *  *   `memorySizeGb`
+     *  *   `redisConfig`
      * 
* * .google.protobuf.FieldMask update_mask = 1; @@ -781,11 +781,11 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { *
      * 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]:
-     * * `display_name`
-     * * `labels`
-     * * `memory_size_gb`
-     * * `redis_config`
+     * fields from [Instance][google.cloud.redis.v1beta1.Instance]:
+     *  *   `displayName`
+     *  *   `labels`
+     *  *   `memorySizeGb`
+     *  *   `redisConfig`
      * 
* * .google.protobuf.FieldMask update_mask = 1; diff --git a/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/UpdateInstanceRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/UpdateInstanceRequestOrBuilder.java index 06d5b90b3b0b..bf2ba1877769 100644 --- a/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/UpdateInstanceRequestOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/java/com/google/cloud/redis/v1beta1/UpdateInstanceRequestOrBuilder.java @@ -14,11 +14,11 @@ public interface UpdateInstanceRequestOrBuilder *
    * 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]:
-   * * `display_name`
-   * * `labels`
-   * * `memory_size_gb`
-   * * `redis_config`
+   * fields from [Instance][google.cloud.redis.v1beta1.Instance]:
+   *  *   `displayName`
+   *  *   `labels`
+   *  *   `memorySizeGb`
+   *  *   `redisConfig`
    * 
* * .google.protobuf.FieldMask update_mask = 1; @@ -30,11 +30,11 @@ public interface UpdateInstanceRequestOrBuilder *
    * 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]:
-   * * `display_name`
-   * * `labels`
-   * * `memory_size_gb`
-   * * `redis_config`
+   * fields from [Instance][google.cloud.redis.v1beta1.Instance]:
+   *  *   `displayName`
+   *  *   `labels`
+   *  *   `memorySizeGb`
+   *  *   `redisConfig`
    * 
* * .google.protobuf.FieldMask update_mask = 1; @@ -46,11 +46,11 @@ public interface UpdateInstanceRequestOrBuilder *
    * 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]:
-   * * `display_name`
-   * * `labels`
-   * * `memory_size_gb`
-   * * `redis_config`
+   * fields from [Instance][google.cloud.redis.v1beta1.Instance]:
+   *  *   `displayName`
+   *  *   `labels`
+   *  *   `memorySizeGb`
+   *  *   `redisConfig`
    * 
* * .google.protobuf.FieldMask update_mask = 1; diff --git a/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/proto/google/cloud/redis/v1beta1/cloud_redis.proto b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/proto/google/cloud/redis/v1beta1/cloud_redis.proto index 778b2e4441a4..0335a002690c 100644 --- a/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/proto/google/cloud/redis/v1beta1/cloud_redis.proto +++ b/google-api-grpc/proto-google-cloud-redis-v1beta1/src/main/proto/google/cloud/redis/v1beta1/cloud_redis.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google Inc. +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,12 +11,14 @@ // 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. +// syntax = "proto3"; package google.cloud.redis.v1beta1; import "google/api/annotations.proto"; +import "google/api/resource.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -65,7 +67,7 @@ service CloudRedis { // Creates a Redis instance based on the specified tier and memory size. // - // By default, the instance is peered to the project's + // By default, the instance is accessible from the project's // [default network](/compute/docs/networks-and-firewalls#networks). // // The creation is executed asynchronously and callers may check the returned @@ -96,6 +98,16 @@ service CloudRedis { }; } + // Failover the master role to current replica node against a specific + // STANDARD tier redis instance. + rpc FailoverInstance(FailoverInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/instances/*}:failover" + body: "*" + }; + } + // Deletes a specific Redis instance. Instance stops serving and data is // deleted. rpc DeleteInstance(DeleteInstanceRequest) @@ -127,12 +139,17 @@ message Instance { // Redis instance is being deleted. DELETING = 4; - // Redis instance is being repaired and may be unusable. Details can be - // found in the `status_message` field. + // Redis instance is being repaired and may be unusable. REPAIRING = 5; // Maintenance is being performed on this Redis instance. MAINTENANCE = 6; + + // Redis instance is importing data (availability may be affected). + IMPORTING = 8; + + // Redis instance is failing over (availability may be affected). + FAILING_OVER = 10; } // Available service tiers to choose from @@ -152,7 +169,7 @@ message Instance { // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` // // Note: Redis instances are managed and addressed at regional level so - // location_id here refers to a GCP region; however, users get to choose which + // 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. @@ -167,7 +184,7 @@ 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 + // failures. If [alternative_location_id] is also provided, it must be // different from [location_id]. string location_id = 4; @@ -177,27 +194,32 @@ message Instance { string alternative_location_id = 5; // Optional. The version of Redis software. - // If not provided, latest supported version will be used. + // 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: + // + // * `REDIS_4_0` for Redis 4.0 compatibility + // * `REDIS_3_2` for Redis 3.2 compatibility (default) string redis_version = 7; // Optional. The CIDR range of internal addresses that are reserved for this // instance. If not provided, the service will choose an unused /29 block, // for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique - // and non-overlapping with existing subnets in a network. + // and non-overlapping with existing subnets in an authorized network. string reserved_ip_range = 9; - // Output only. Hostname or IP address of the exposed redis endpoint used by + // Output only. Hostname or IP address of the exposed Redis endpoint used by // clients to connect to the service. string host = 10; - // Output only. The port number of the exposed redis endpoint. + // Output only. The port number of the exposed Redis endpoint. int32 port = 11; - // Output only. The current zone where the Redis endpoint is placed. In - // single zone deployments, this will always be the same as [location_id] - // provided by the user at creation time. In cross-zone instances (only - // applicable in STANDARD_HA tier), this can be either [location_id] or - // [alternative_location_id] and can change on a failover event. + // 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] + // provided by the user at creation time. For Standard Tier instances, + // this can be either [location_id] or [alternative_location_id] and can + // change after a failover event. string current_location_id = 12; // Output only. The time the instance was created. @@ -213,14 +235,23 @@ message Instance { // Optional. Redis configuration parameters, according to // http://redis.io/topics/config. Currently, the only supported parameters // are: - // * maxmemory-policy - // * notify-keyspace-events + // + // Redis 3.2 and above: + // + // * maxmemory-policy + // * notify-keyspace-events + // + // Redis 4.0 and above: + // + // * activedefrag + // * lfu-log-factor + // * lfu-decay-time map redis_configs = 16; // Required. The service tier of the instance. Tier tier = 17; - // Required. Redis memory size in GB. + // Required. Redis memory size in GiB. int32 memory_size_gb = 18; // Optional. The full name of the Google Compute Engine @@ -270,6 +301,9 @@ message ListInstancesResponse { // Token to retrieve the next page of results, or empty if there are no more // results in the list. string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; } // Request for [GetInstance][google.cloud.redis.v1beta1.CloudRedis.GetInstance]. @@ -307,11 +341,12 @@ 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]: - // * `display_name` - // * `labels` - // * `memory_size_gb` - // * `redis_config` + // fields from [Instance][google.cloud.redis.v1beta1.Instance]: + // + // * `displayName` + // * `labels` + // * `memorySizeGb` + // * `redisConfig` google.protobuf.FieldMask update_mask = 1; // Required. Update description. @@ -328,6 +363,32 @@ message DeleteInstanceRequest { string name = 1; } +// Request for +// [Failover][google.cloud.redis.v1beta1.CloudRedis.FailoverInstance]. +message FailoverInstanceRequest { + enum DataProtectionMode { + DATA_PROTECTION_MODE_UNSPECIFIED = 0; + + // Instance failover will be protected with data loss control. More + // specifically, the failover will only be performed if the current + // replication offset diff between master and replica is under a certain + // threshold. + LIMITED_DATA_LOSS = 1; + + // Instance failover will be performed without data loss control. + FORCE_DATA_LOSS = 2; + } + + // 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; + + // Optional. Available data protection modes that the user can choose. If it's + // unspecified, data protection mode will be LIMITED_DATA_LOSS by default. + DataProtectionMode data_protection_mode = 2; +} + // This location metadata represents additional configuration options for a // given location where a Redis instance may be created. All fields are output // only. It is returned as content of the diff --git a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisClient.java b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisClient.java index 8104b79bb1a9..6c92a9c95ec9 100644 --- a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisClient.java +++ b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisClient.java @@ -448,7 +448,7 @@ public final UnaryCallable getInstanceCallable() { /** * Creates a Redis instance based on the specified tier and memory size. * - *

By default, the instance is peered to the project's [default + *

By default, the instance is accessible from the project's [default * network](/compute/docs/networks-and-firewalls#networks). * *

The creation is executed asynchronously and callers may check the returned operation to @@ -503,7 +503,7 @@ public final OperationFuture createInstanceAsync( /** * Creates a Redis instance based on the specified tier and memory size. * - *

By default, the instance is peered to the project's [default + *

By default, the instance is accessible from the project's [default * network](/compute/docs/networks-and-firewalls#networks). * *

The creation is executed asynchronously and callers may check the returned operation to @@ -558,7 +558,7 @@ public final OperationFuture createInstanceAsync( /** * Creates a Redis instance based on the specified tier and memory size. * - *

By default, the instance is peered to the project's [default + *

By default, the instance is accessible from the project's [default * network](/compute/docs/networks-and-firewalls#networks). * *

The creation is executed asynchronously and callers may check the returned operation to @@ -603,7 +603,7 @@ public final OperationFuture createInstanceAsync(CreateInstanceRe /** * Creates a Redis instance based on the specified tier and memory size. * - *

By default, the instance is peered to the project's [default + *

By default, the instance is accessible from the project's [default * network](/compute/docs/networks-and-firewalls#networks). * *

The creation is executed asynchronously and callers may check the returned operation to @@ -647,7 +647,7 @@ public final OperationFuture createInstanceAsync(CreateInstanceRe /** * Creates a Redis instance based on the specified tier and memory size. * - *

By default, the instance is peered to the project's [default + *

By default, the instance is accessible from the project's [default * network](/compute/docs/networks-and-firewalls#networks). * *

The creation is executed asynchronously and callers may check the returned operation to @@ -715,8 +715,8 @@ public final UnaryCallable createInstanceCalla * * @param updateMask 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]: * `display_name` * `labels` * `memory_size_gb` - * * `redis_config` + * [Instance][google.cloud.redis.v1beta1.Instance]: + *

* `displayName` * `labels` * `memorySizeGb` * `redisConfig` * @param instance Required. Update description. Only fields specified in update_mask are updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -973,6 +973,122 @@ public final UnaryCallable deleteInstanceCalla return stub.deleteInstanceCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Failover the master role to current replica node against a specific STANDARD tier redis + * instance. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   String formattedName = InstanceName.format("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   FailoverInstanceRequest.DataProtectionMode dataProtectionMode = FailoverInstanceRequest.DataProtectionMode.DATA_PROTECTION_MODE_UNSPECIFIED;
+   *   Instance response = cloudRedisClient.failoverInstanceAsync(formattedName, dataProtectionMode).get();
+   * }
+   * 
+ * + * @param name 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 + * @param dataProtectionMode Optional. Available data protection modes that the user can choose. + * If it's unspecified, data protection mode will be LIMITED_DATA_LOSS by default. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture failoverInstanceAsync( + String name, FailoverInstanceRequest.DataProtectionMode dataProtectionMode) { + + FailoverInstanceRequest request = + FailoverInstanceRequest.newBuilder() + .setName(name) + .setDataProtectionMode(dataProtectionMode) + .build(); + return failoverInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Failover the master role to current replica node against a specific STANDARD tier redis + * instance. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   String formattedName = InstanceName.format("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   FailoverInstanceRequest.DataProtectionMode dataProtectionMode = FailoverInstanceRequest.DataProtectionMode.DATA_PROTECTION_MODE_UNSPECIFIED;
+   *   FailoverInstanceRequest request = FailoverInstanceRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .setDataProtectionMode(dataProtectionMode)
+   *     .build();
+   *   Instance response = cloudRedisClient.failoverInstanceAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture failoverInstanceAsync( + FailoverInstanceRequest request) { + return failoverInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Failover the master role to current replica node against a specific STANDARD tier redis + * instance. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   String formattedName = InstanceName.format("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   FailoverInstanceRequest.DataProtectionMode dataProtectionMode = FailoverInstanceRequest.DataProtectionMode.DATA_PROTECTION_MODE_UNSPECIFIED;
+   *   FailoverInstanceRequest request = FailoverInstanceRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .setDataProtectionMode(dataProtectionMode)
+   *     .build();
+   *   OperationFuture<Instance, Any> future = cloudRedisClient.failoverInstanceOperationCallable().futureCall(request);
+   *   // Do something
+   *   Instance response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + failoverInstanceOperationCallable() { + return stub.failoverInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Failover the master role to current replica node against a specific STANDARD tier redis + * instance. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   String formattedName = InstanceName.format("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   FailoverInstanceRequest.DataProtectionMode dataProtectionMode = FailoverInstanceRequest.DataProtectionMode.DATA_PROTECTION_MODE_UNSPECIFIED;
+   *   FailoverInstanceRequest request = FailoverInstanceRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .setDataProtectionMode(dataProtectionMode)
+   *     .build();
+   *   ApiFuture<Operation> future = cloudRedisClient.failoverInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable failoverInstanceCallable() { + return stub.failoverInstanceCallable(); + } + @Override public final void close() { stub.close(); diff --git a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisSettings.java b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisSettings.java index d516a7e35f3b..828091747250 100644 --- a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisSettings.java +++ b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisSettings.java @@ -116,6 +116,19 @@ public UnaryCallSettings deleteInstanceSetting return ((CloudRedisStubSettings) getStubSettings()).deleteInstanceOperationSettings(); } + /** Returns the object with the settings used for calls to failoverInstance. */ + public UnaryCallSettings failoverInstanceSettings() { + return ((CloudRedisStubSettings) getStubSettings()).failoverInstanceSettings(); + } + + /** Returns the object with the settings used for calls to failoverInstance. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + failoverInstanceOperationSettings() { + return ((CloudRedisStubSettings) getStubSettings()).failoverInstanceOperationSettings(); + } + public static final CloudRedisSettings create(CloudRedisStubSettings stub) throws IOException { return new CloudRedisSettings.Builder(stub.toBuilder()).build(); } @@ -263,6 +276,20 @@ public UnaryCallSettings.Builder deleteInstanc return getStubSettingsBuilder().deleteInstanceOperationSettings(); } + /** Returns the builder for the settings used for calls to failoverInstance. */ + public UnaryCallSettings.Builder + failoverInstanceSettings() { + return getStubSettingsBuilder().failoverInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to failoverInstance. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + failoverInstanceOperationSettings() { + return getStubSettingsBuilder().failoverInstanceOperationSettings(); + } + @Override public CloudRedisSettings build() throws IOException { return new CloudRedisSettings(this); diff --git a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/stub/CloudRedisStub.java b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/stub/CloudRedisStub.java index 3f1f50012396..bed3a0ac0eee 100644 --- a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/stub/CloudRedisStub.java +++ b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/stub/CloudRedisStub.java @@ -23,6 +23,7 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.redis.v1beta1.CreateInstanceRequest; import com.google.cloud.redis.v1beta1.DeleteInstanceRequest; +import com.google.cloud.redis.v1beta1.FailoverInstanceRequest; import com.google.cloud.redis.v1beta1.GetInstanceRequest; import com.google.cloud.redis.v1beta1.Instance; import com.google.cloud.redis.v1beta1.ListInstancesRequest; @@ -89,6 +90,16 @@ public UnaryCallable deleteInstanceCallable() throw new UnsupportedOperationException("Not implemented: deleteInstanceCallable()"); } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + failoverInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: failoverInstanceOperationCallable()"); + } + + public UnaryCallable failoverInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: failoverInstanceCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java index fbfd30923346..d4cb52636de3 100644 --- a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java +++ b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java @@ -45,6 +45,7 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.redis.v1beta1.CreateInstanceRequest; import com.google.cloud.redis.v1beta1.DeleteInstanceRequest; +import com.google.cloud.redis.v1beta1.FailoverInstanceRequest; import com.google.cloud.redis.v1beta1.GetInstanceRequest; import com.google.cloud.redis.v1beta1.Instance; import com.google.cloud.redis.v1beta1.ListInstancesRequest; @@ -108,6 +109,9 @@ public class CloudRedisStubSettings extends StubSettings private final UnaryCallSettings deleteInstanceSettings; private final OperationCallSettings deleteInstanceOperationSettings; + private final UnaryCallSettings failoverInstanceSettings; + private final OperationCallSettings + failoverInstanceOperationSettings; /** Returns the object with the settings used for calls to listInstances. */ public PagedCallSettings @@ -156,6 +160,18 @@ public UnaryCallSettings deleteInstanceSetting return deleteInstanceOperationSettings; } + /** Returns the object with the settings used for calls to failoverInstance. */ + public UnaryCallSettings failoverInstanceSettings() { + return failoverInstanceSettings; + } + + /** Returns the object with the settings used for calls to failoverInstance. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + failoverInstanceOperationSettings() { + return failoverInstanceOperationSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public CloudRedisStub createStub() throws IOException { if (getTransportChannelProvider() @@ -232,6 +248,8 @@ protected CloudRedisStubSettings(Builder settingsBuilder) throws IOException { updateInstanceOperationSettings = settingsBuilder.updateInstanceOperationSettings().build(); deleteInstanceSettings = settingsBuilder.deleteInstanceSettings().build(); deleteInstanceOperationSettings = settingsBuilder.deleteInstanceOperationSettings().build(); + failoverInstanceSettings = settingsBuilder.failoverInstanceSettings().build(); + failoverInstanceOperationSettings = settingsBuilder.failoverInstanceOperationSettings().build(); } private static final PagedListDescriptor @@ -307,6 +325,10 @@ public static class Builder extends StubSettings.Builder deleteInstanceOperationSettings; + private final UnaryCallSettings.Builder + failoverInstanceSettings; + private final OperationCallSettings.Builder + failoverInstanceOperationSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -365,13 +387,18 @@ protected Builder(ClientContext clientContext) { deleteInstanceOperationSettings = OperationCallSettings.newBuilder(); + failoverInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + failoverInstanceOperationSettings = OperationCallSettings.newBuilder(); + unaryMethodSettingsBuilders = ImmutableList.>of( listInstancesSettings, getInstanceSettings, createInstanceSettings, updateInstanceSettings, - deleteInstanceSettings); + deleteInstanceSettings, + failoverInstanceSettings); initDefaults(this); } @@ -411,6 +438,11 @@ private static Builder initDefaults(Builder builder) { .deleteInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .failoverInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); builder .createInstanceOperationSettings() .setInitialCallSettings( @@ -453,7 +485,7 @@ private static Builder initDefaults(Builder builder) { .setInitialRpcTimeout(Duration.ZERO) // ignored .setRpcTimeoutMultiplier(1.0) // ignored .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(1200000L)) + .setTotalTimeout(Duration.ofMillis(7200000L)) .build())); builder .deleteInstanceOperationSettings() @@ -477,6 +509,28 @@ private static Builder initDefaults(Builder builder) { .setMaxRpcTimeout(Duration.ZERO) // ignored .setTotalTimeout(Duration.ofMillis(1200000L)) .build())); + builder + .failoverInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(Any.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(60000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(360000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(1200000L)) + .build())); return builder; } @@ -492,6 +546,8 @@ protected Builder(CloudRedisStubSettings settings) { updateInstanceOperationSettings = settings.updateInstanceOperationSettings.toBuilder(); deleteInstanceSettings = settings.deleteInstanceSettings.toBuilder(); deleteInstanceOperationSettings = settings.deleteInstanceOperationSettings.toBuilder(); + failoverInstanceSettings = settings.failoverInstanceSettings.toBuilder(); + failoverInstanceOperationSettings = settings.failoverInstanceOperationSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -499,7 +555,8 @@ protected Builder(CloudRedisStubSettings settings) { getInstanceSettings, createInstanceSettings, updateInstanceSettings, - deleteInstanceSettings); + deleteInstanceSettings, + failoverInstanceSettings); } // NEXT_MAJOR_VER: remove 'throws Exception' @@ -569,6 +626,20 @@ public UnaryCallSettings.Builder deleteInstanc return deleteInstanceOperationSettings; } + /** Returns the builder for the settings used for calls to failoverInstance. */ + public UnaryCallSettings.Builder + failoverInstanceSettings() { + return failoverInstanceSettings; + } + + /** Returns the builder for the settings used for calls to failoverInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + failoverInstanceOperationSettings() { + return failoverInstanceOperationSettings; + } + @Override public CloudRedisStubSettings build() throws IOException { return new CloudRedisStubSettings(this); diff --git a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisStub.java b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisStub.java index 5db310d4b001..c8efcebcc679 100644 --- a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisStub.java +++ b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisStub.java @@ -28,6 +28,7 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.redis.v1beta1.CreateInstanceRequest; import com.google.cloud.redis.v1beta1.DeleteInstanceRequest; +import com.google.cloud.redis.v1beta1.FailoverInstanceRequest; import com.google.cloud.redis.v1beta1.GetInstanceRequest; import com.google.cloud.redis.v1beta1.Instance; import com.google.cloud.redis.v1beta1.ListInstancesRequest; @@ -99,6 +100,15 @@ public class GrpcCloudRedisStub extends CloudRedisStub { ProtoUtils.marshaller(DeleteInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + failoverInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/FailoverInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(FailoverInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -116,6 +126,9 @@ public class GrpcCloudRedisStub extends CloudRedisStub { private final UnaryCallable deleteInstanceCallable; private final OperationCallable deleteInstanceOperationCallable; + private final UnaryCallable failoverInstanceCallable; + private final OperationCallable + failoverInstanceOperationCallable; private final GrpcStubCallableFactory callableFactory; @@ -222,6 +235,19 @@ public Map extract(DeleteInstanceRequest request) { } }) .build(); + GrpcCallSettings failoverInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(failoverInstanceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(FailoverInstanceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); this.listInstancesCallable = callableFactory.createUnaryCallable( @@ -259,6 +285,15 @@ public Map extract(DeleteInstanceRequest request) { settings.deleteInstanceOperationSettings(), clientContext, this.operationsStub); + this.failoverInstanceCallable = + callableFactory.createUnaryCallable( + failoverInstanceTransportSettings, settings.failoverInstanceSettings(), clientContext); + this.failoverInstanceOperationCallable = + callableFactory.createOperationCallable( + failoverInstanceTransportSettings, + settings.failoverInstanceOperationSettings(), + clientContext, + this.operationsStub); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -308,6 +343,16 @@ public UnaryCallable deleteInstanceCallable() return deleteInstanceCallable; } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + failoverInstanceOperationCallable() { + return failoverInstanceOperationCallable; + } + + public UnaryCallable failoverInstanceCallable() { + return failoverInstanceCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1beta1/CloudRedisClientTest.java b/google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1beta1/CloudRedisClientTest.java index 63d6b02fc22c..cfaef85fff89 100644 --- a/google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1beta1/CloudRedisClientTest.java +++ b/google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1beta1/CloudRedisClientTest.java @@ -407,4 +407,81 @@ public void deleteInstanceExceptionTest() throws Exception { Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } + + @Test + @SuppressWarnings("all") + public void failoverInstanceTest() throws Exception { + String name2 = "name2-1052831874"; + String displayName = "displayName1615086568"; + String locationId = "locationId552319461"; + String alternativeLocationId = "alternativeLocationId-718920621"; + String redisVersion = "redisVersion-685310444"; + String reservedIpRange = "reservedIpRange-1082940580"; + String host = "host3208616"; + int port = 3446913; + String currentLocationId = "currentLocationId1312712735"; + String statusMessage = "statusMessage-239442758"; + int memorySizeGb = 34199707; + String authorizedNetwork = "authorizedNetwork-1733809270"; + Instance expectedResponse = + Instance.newBuilder() + .setName(name2) + .setDisplayName(displayName) + .setLocationId(locationId) + .setAlternativeLocationId(alternativeLocationId) + .setRedisVersion(redisVersion) + .setReservedIpRange(reservedIpRange) + .setHost(host) + .setPort(port) + .setCurrentLocationId(currentLocationId) + .setStatusMessage(statusMessage) + .setMemorySizeGb(memorySizeGb) + .setAuthorizedNetwork(authorizedNetwork) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("failoverInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudRedis.addResponse(resultOperation); + + String formattedName = InstanceName.format("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + FailoverInstanceRequest.DataProtectionMode dataProtectionMode = + FailoverInstanceRequest.DataProtectionMode.DATA_PROTECTION_MODE_UNSPECIFIED; + + Instance actualResponse = client.failoverInstanceAsync(formattedName, dataProtectionMode).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudRedis.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FailoverInstanceRequest actualRequest = (FailoverInstanceRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertEquals(dataProtectionMode, actualRequest.getDataProtectionMode()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void failoverInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudRedis.addException(exception); + + try { + String formattedName = InstanceName.format("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + FailoverInstanceRequest.DataProtectionMode dataProtectionMode = + FailoverInstanceRequest.DataProtectionMode.DATA_PROTECTION_MODE_UNSPECIFIED; + + client.failoverInstanceAsync(formattedName, dataProtectionMode).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } } diff --git a/google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1beta1/MockCloudRedisImpl.java b/google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1beta1/MockCloudRedisImpl.java index c5c7fc62c011..c698b6673705 100644 --- a/google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1beta1/MockCloudRedisImpl.java +++ b/google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1beta1/MockCloudRedisImpl.java @@ -116,6 +116,21 @@ public void updateInstance( } } + @Override + public void failoverInstance( + FailoverInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + @Override public void deleteInstance( DeleteInstanceRequest request, StreamObserver responseObserver) { diff --git a/google-cloud-clients/google-cloud-redis/synth.metadata b/google-cloud-clients/google-cloud-redis/synth.metadata index 06ffc7f23a05..513735bfcf7c 100644 --- a/google-cloud-clients/google-cloud-redis/synth.metadata +++ b/google-cloud-clients/google-cloud-redis/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-04-02T07:52:37.474850Z", + "updateTime": "2019-04-05T07:52:20.765706Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.22", - "dockerImage": "googleapis/artman@sha256:e7f9554322a8aa1416c122c918fdc4cdec8cfe816f027fc948dec0be7edef320" + "version": "0.16.25", + "dockerImage": "googleapis/artman@sha256:d9597f983d1d4e61272c63cb97b7d8f8234da9999526c35d357de3d781f0ec1b" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6c48ab5aef47dc14e02e2dc718d232a28067129d", - "internalRef": "241437588" + "sha": "327ff9c09f4b2bcc9633f035a58ad348e45fb2a0", + "internalRef": "242045478" } } ],