Search in sources :

Example 1 with UpgradeInstanceRequest

use of com.google.cloud.redis.v1beta1.UpgradeInstanceRequest in project gapic-generator-java by googleapis.

the class AsyncUpgradeInstance method asyncUpgradeInstance.

public static void asyncUpgradeInstance() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder().setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()).setRedisVersion("redisVersion-1972584739").build();
        ApiFuture<Operation> future = cloudRedisClient.upgradeInstanceCallable().futureCall(request);
        // Do something.
        Operation response = future.get();
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Operation(com.google.longrunning.Operation) UpgradeInstanceRequest(com.google.cloud.redis.v1beta1.UpgradeInstanceRequest)

Example 2 with UpgradeInstanceRequest

use of com.google.cloud.redis.v1beta1.UpgradeInstanceRequest in project gapic-generator-java by googleapis.

the class AsyncUpgradeInstanceLRO method asyncUpgradeInstanceLRO.

public static void asyncUpgradeInstanceLRO() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder().setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()).setRedisVersion("redisVersion-1972584739").build();
        OperationFuture<Instance, Any> future = cloudRedisClient.upgradeInstanceOperationCallable().futureCall(request);
        // Do something.
        Instance response = future.get();
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Instance(com.google.cloud.redis.v1beta1.Instance) Any(com.google.protobuf.Any) UpgradeInstanceRequest(com.google.cloud.redis.v1beta1.UpgradeInstanceRequest)

Example 3 with UpgradeInstanceRequest

use of com.google.cloud.redis.v1beta1.UpgradeInstanceRequest in project gapic-generator-java by googleapis.

the class SyncUpgradeInstance method syncUpgradeInstance.

public static void syncUpgradeInstance() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder().setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()).setRedisVersion("redisVersion-1972584739").build();
        Instance response = cloudRedisClient.upgradeInstanceAsync(request).get();
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Instance(com.google.cloud.redis.v1beta1.Instance) UpgradeInstanceRequest(com.google.cloud.redis.v1beta1.UpgradeInstanceRequest)

Aggregations

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