use of com.google.cloud.redis.v1.Instance 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();
}
}
use of com.google.cloud.redis.v1.Instance in project gapic-generator-java by googleapis.
the class SyncFailoverInstanceInstancenameFailoverinstancerequestdataprotectionmode method syncFailoverInstanceInstancenameFailoverinstancerequestdataprotectionmode.
public static void syncFailoverInstanceInstancenameFailoverinstancerequestdataprotectionmode() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
FailoverInstanceRequest.DataProtectionMode dataProtectionMode = FailoverInstanceRequest.DataProtectionMode.forNumber(0);
Instance response = cloudRedisClient.failoverInstanceAsync(name, dataProtectionMode).get();
}
}
use of com.google.cloud.redis.v1.Instance in project gapic-generator-java by googleapis.
the class SyncFailoverInstanceStringFailoverinstancerequestdataprotectionmode method syncFailoverInstanceStringFailoverinstancerequestdataprotectionmode.
public static void syncFailoverInstanceStringFailoverinstancerequestdataprotectionmode() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
FailoverInstanceRequest.DataProtectionMode dataProtectionMode = FailoverInstanceRequest.DataProtectionMode.forNumber(0);
Instance response = cloudRedisClient.failoverInstanceAsync(name, dataProtectionMode).get();
}
}
use of com.google.cloud.redis.v1.Instance in project gapic-generator-java by googleapis.
the class SyncGetInstanceString method syncGetInstanceString.
public static void syncGetInstanceString() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
Instance response = cloudRedisClient.getInstance(name);
}
}
use of com.google.cloud.redis.v1.Instance in project gapic-generator-java by googleapis.
the class SyncCreateInstanceLocationnameStringInstance method syncCreateInstanceLocationnameStringInstance.
public static void syncCreateInstanceLocationnameStringInstance() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
String instanceId = "instanceId902024336";
Instance instance = Instance.newBuilder().build();
Instance response = cloudRedisClient.createInstanceAsync(parent, instanceId, instance).get();
}
}
Aggregations