Search in sources :

Example 11 with Instance

use of com.google.cloud.compute.v1.Instance in project gapic-generator-java by googleapis.

the class SyncCreateInstanceStringStringInstance method syncCreateInstanceStringStringInstance.

public static void syncCreateInstanceStringStringInstance() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
        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)

Example 12 with Instance

use of com.google.cloud.compute.v1.Instance in project gapic-generator-java by googleapis.

the class AsyncExportInstanceLRO method asyncExportInstanceLRO.

public static void asyncExportInstanceLRO() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        ExportInstanceRequest request = ExportInstanceRequest.newBuilder().setName("name3373707").setOutputConfig(OutputConfig.newBuilder().build()).build();
        OperationFuture<Instance, Any> future = cloudRedisClient.exportInstanceOperationCallable().futureCall(request);
        // Do something.
        Instance response = future.get();
    }
}
Also used : ExportInstanceRequest(com.google.cloud.redis.v1beta1.ExportInstanceRequest) CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Instance(com.google.cloud.redis.v1beta1.Instance) Any(com.google.protobuf.Any)

Example 13 with Instance

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

Example 14 with Instance

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

Example 15 with Instance

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

Aggregations

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