Search in sources :

Example 1 with FailoverInstanceRequest

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();
    }
}
Also used : FailoverInstanceRequest(com.google.cloud.redis.v1beta1.FailoverInstanceRequest) CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Operation(com.google.longrunning.Operation)

Example 2 with FailoverInstanceRequest

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();
    }
}
Also used : FailoverInstanceRequest(com.google.cloud.redis.v1beta1.FailoverInstanceRequest) CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Instance(com.google.cloud.redis.v1beta1.Instance) Any(com.google.protobuf.Any)

Example 3 with FailoverInstanceRequest

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();
    }
}
Also used : FailoverInstanceRequest(com.google.cloud.redis.v1beta1.FailoverInstanceRequest) CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Instance(com.google.cloud.redis.v1beta1.Instance)

Aggregations

CloudRedisClient (com.google.cloud.redis.v1beta1.CloudRedisClient)3 FailoverInstanceRequest (com.google.cloud.redis.v1beta1.FailoverInstanceRequest)3 Instance (com.google.cloud.redis.v1beta1.Instance)2 Operation (com.google.longrunning.Operation)1 Any (com.google.protobuf.Any)1