Search in sources :

Example 91 with Instance

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

Example 92 with Instance

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

Example 93 with Instance

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

Example 94 with Instance

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

Example 95 with Instance

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

Aggregations

Test (org.junit.Test)41 Instance (com.google.cloud.redis.v1beta1.Instance)34 CloudRedisClient (com.google.cloud.redis.v1beta1.CloudRedisClient)30 Instance (com.google.cloud.compute.v1.Instance)25 InstancesClient (com.google.cloud.compute.v1.InstancesClient)19 ByteString (com.google.protobuf.ByteString)17 AbstractMessage (com.google.protobuf.AbstractMessage)15 Operation (com.google.cloud.compute.v1.Operation)13 Instance (com.google.spanner.admin.instance.v1.Instance)11 Instance (com.google.bigtable.admin.v2.Instance)10 InsertInstanceRequest (com.google.cloud.compute.v1.InsertInstanceRequest)10 AttachedDisk (com.google.cloud.compute.v1.AttachedDisk)9 Instance (com.google.cloud.notebooks.v1beta1.Instance)9 InvalidArgumentException (com.google.api.gax.rpc.InvalidArgumentException)7 Any (com.google.protobuf.Any)7 FieldMask (com.google.protobuf.FieldMask)7 StatusRuntimeException (io.grpc.StatusRuntimeException)7 ArrayList (java.util.ArrayList)7 NetworkInterface (com.google.cloud.compute.v1.NetworkInterface)6 Operation (com.google.longrunning.Operation)6