use of com.google.cloud.redis.v1beta1.CloudRedisClient 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.CloudRedisClient 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.CloudRedisClient in project gapic-generator-java by googleapis.
the class AsyncGetInstance method asyncGetInstance.
public static void asyncGetInstance() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
GetInstanceRequest request = GetInstanceRequest.newBuilder().setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()).build();
ApiFuture<Instance> future = cloudRedisClient.getInstanceCallable().futureCall(request);
// Do something.
Instance response = future.get();
}
}
use of com.google.cloud.redis.v1beta1.CloudRedisClient in project gapic-generator-java by googleapis.
the class SyncGetInstanceInstancename method syncGetInstanceInstancename.
public static void syncGetInstanceInstancename() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
Instance response = cloudRedisClient.getInstance(name);
}
}
use of com.google.cloud.redis.v1beta1.CloudRedisClient in project gapic-generator-java by googleapis.
the class AsyncGetInstanceAuthString method asyncGetInstanceAuthString.
public static void asyncGetInstanceAuthString() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
GetInstanceAuthStringRequest request = GetInstanceAuthStringRequest.newBuilder().setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()).build();
ApiFuture<InstanceAuthString> future = cloudRedisClient.getInstanceAuthStringCallable().futureCall(request);
// Do something.
InstanceAuthString response = future.get();
}
}
Aggregations