use of com.google.cloud.redis.v1beta1.CloudRedisClient 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();
}
}
use of com.google.cloud.redis.v1beta1.CloudRedisClient 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();
}
}
use of com.google.cloud.redis.v1beta1.CloudRedisClient in project gapic-generator-java by googleapis.
the class SyncUpgradeInstanceInstancenameString method syncUpgradeInstanceInstancenameString.
public static void syncUpgradeInstanceInstancenameString() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
String redisVersion = "redisVersion-1972584739";
Instance response = cloudRedisClient.upgradeInstanceAsync(name, redisVersion).get();
}
}
use of com.google.cloud.redis.v1beta1.CloudRedisClient in project gapic-generator-java by googleapis.
the class SyncCreateSetCredentialsProvider method syncCreateSetCredentialsProvider.
public static void syncCreateSetCredentialsProvider() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
CloudRedisSettings cloudRedisSettings = CloudRedisSettings.newBuilder().setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)).build();
CloudRedisClient cloudRedisClient = CloudRedisClient.create(cloudRedisSettings);
}
use of com.google.cloud.redis.v1beta1.CloudRedisClient in project gapic-generator-java by googleapis.
the class AsyncCreateInstance method asyncCreateInstance.
public static void asyncCreateInstance() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
CreateInstanceRequest request = CreateInstanceRequest.newBuilder().setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()).setInstanceId("instanceId902024336").setInstance(Instance.newBuilder().build()).build();
ApiFuture<Operation> future = cloudRedisClient.createInstanceCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
}
Aggregations