use of com.google.cloud.redis.v1beta1.FailoverInstanceRequest in project gapic-generator-java by googleapis.
the class AsyncFailoverInstance method asyncFailoverInstance.
public static void asyncFailoverInstance() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
FailoverInstanceRequest request = FailoverInstanceRequest.newBuilder().setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()).build();
ApiFuture<Operation> future = cloudRedisClient.failoverInstanceCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
}
use of com.google.cloud.redis.v1beta1.FailoverInstanceRequest in project gapic-generator-java by googleapis.
the class AsyncFailoverInstanceLRO method asyncFailoverInstanceLRO.
public static void asyncFailoverInstanceLRO() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
FailoverInstanceRequest request = FailoverInstanceRequest.newBuilder().setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()).build();
OperationFuture<Instance, Any> future = cloudRedisClient.failoverInstanceOperationCallable().futureCall(request);
// Do something.
Instance response = future.get();
}
}
use of com.google.cloud.redis.v1beta1.FailoverInstanceRequest in project gapic-generator-java by googleapis.
the class SyncFailoverInstance method syncFailoverInstance.
public static void syncFailoverInstance() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
FailoverInstanceRequest request = FailoverInstanceRequest.newBuilder().setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()).build();
Instance response = cloudRedisClient.failoverInstanceAsync(request).get();
}
}
Aggregations