Search in sources :

Example 96 with Instance

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

the class SyncGetInstanceAuthString method syncGetInstanceAuthString.

public static void syncGetInstanceAuthString() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        GetInstanceAuthStringRequest request = GetInstanceAuthStringRequest.newBuilder().setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()).build();
        InstanceAuthString response = cloudRedisClient.getInstanceAuthString(request);
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) GetInstanceAuthStringRequest(com.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest) InstanceAuthString(com.google.cloud.redis.v1beta1.InstanceAuthString)

Example 97 with Instance

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

the class SyncGetInstanceAuthStringString method syncGetInstanceAuthStringString.

public static void syncGetInstanceAuthStringString() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
        InstanceAuthString response = cloudRedisClient.getInstanceAuthString(name);
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) InstanceAuthString(com.google.cloud.redis.v1beta1.InstanceAuthString) InstanceAuthString(com.google.cloud.redis.v1beta1.InstanceAuthString)

Example 98 with Instance

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

the class SyncImportInstanceStringInputconfig method syncImportInstanceStringInputconfig.

public static void syncImportInstanceStringInputconfig() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        String name = "name3373707";
        InputConfig inputConfig = InputConfig.newBuilder().build();
        Instance response = cloudRedisClient.importInstanceAsync(name, inputConfig).get();
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Instance(com.google.cloud.redis.v1beta1.Instance) InputConfig(com.google.cloud.redis.v1beta1.InputConfig)

Example 99 with Instance

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

the class AsyncListInstances method asyncListInstances.

public static void asyncListInstances() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").build();
        ApiFuture<Instance> future = cloudRedisClient.listInstancesPagedCallable().futureCall(request);
        // Do something.
        for (Instance element : future.get().iterateAll()) {
        // doThingsWith(element);
        }
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Instance(com.google.cloud.redis.v1beta1.Instance) ListInstancesRequest(com.google.cloud.redis.v1beta1.ListInstancesRequest)

Example 100 with Instance

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

the class AsyncDeleteInstance method asyncDeleteInstance.

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

Aggregations

Test (org.junit.Test)43 CloudRedisClient (com.google.cloud.redis.v1beta1.CloudRedisClient)42 Instance (com.google.cloud.redis.v1beta1.Instance)34 Instance (com.google.cloud.compute.v1.Instance)25 InstancesClient (com.google.cloud.compute.v1.InstancesClient)19 AbstractMessage (com.google.protobuf.AbstractMessage)17 ByteString (com.google.protobuf.ByteString)17 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 Operation (com.google.longrunning.Operation)10 AttachedDisk (com.google.cloud.compute.v1.AttachedDisk)9 Instance (com.google.cloud.notebooks.v1beta1.Instance)9 Any (com.google.protobuf.Any)8 InvalidArgumentException (com.google.api.gax.rpc.InvalidArgumentException)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