Search in sources :

Example 36 with CloudRedisClient

use of com.google.cloud.redis.v1beta1.CloudRedisClient 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 37 with CloudRedisClient

use of com.google.cloud.redis.v1beta1.CloudRedisClient 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 38 with CloudRedisClient

use of com.google.cloud.redis.v1beta1.CloudRedisClient 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)

Example 39 with CloudRedisClient

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

the class AsyncDeleteInstanceLRO method asyncDeleteInstanceLRO.

public static void asyncDeleteInstanceLRO() 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();
        OperationFuture<Empty, Any> future = cloudRedisClient.deleteInstanceOperationCallable().futureCall(request);
        // Do something.
        future.get();
    }
}
Also used : Empty(com.google.protobuf.Empty) CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) DeleteInstanceRequest(com.google.cloud.redis.v1beta1.DeleteInstanceRequest) Any(com.google.protobuf.Any)

Example 40 with CloudRedisClient

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

the class SyncDeleteInstance method syncDeleteInstance.

public static void syncDeleteInstance() 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();
        cloudRedisClient.deleteInstanceAsync(request).get();
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) DeleteInstanceRequest(com.google.cloud.redis.v1beta1.DeleteInstanceRequest)

Aggregations

CloudRedisClient (com.google.cloud.redis.v1beta1.CloudRedisClient)48 Instance (com.google.cloud.redis.v1beta1.Instance)30 Operation (com.google.longrunning.Operation)8 Any (com.google.protobuf.Any)8 InstanceName (com.google.cloud.redis.v1beta1.InstanceName)6 FailoverInstanceRequest (com.google.cloud.redis.v1beta1.FailoverInstanceRequest)5 RescheduleMaintenanceRequest (com.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest)5 InstanceAuthString (com.google.cloud.redis.v1beta1.InstanceAuthString)4 CreateInstanceRequest (com.google.cloud.redis.v1beta1.CreateInstanceRequest)3 DeleteInstanceRequest (com.google.cloud.redis.v1beta1.DeleteInstanceRequest)3 ExportInstanceRequest (com.google.cloud.redis.v1beta1.ExportInstanceRequest)3 ImportInstanceRequest (com.google.cloud.redis.v1beta1.ImportInstanceRequest)3 UpdateInstanceRequest (com.google.cloud.redis.v1beta1.UpdateInstanceRequest)3 UpgradeInstanceRequest (com.google.cloud.redis.v1beta1.UpgradeInstanceRequest)3 CloudRedisSettings (com.google.cloud.redis.v1beta1.CloudRedisSettings)2 GetInstanceAuthStringRequest (com.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest)2 ListInstancesRequest (com.google.cloud.redis.v1beta1.ListInstancesRequest)2 Timestamp (com.google.protobuf.Timestamp)2 GetInstanceRequest (com.google.cloud.redis.v1beta1.GetInstanceRequest)1 InputConfig (com.google.cloud.redis.v1beta1.InputConfig)1