Search in sources :

Example 21 with CloudRedisClient

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

the class AsyncCreateInstanceLRO method asyncCreateInstanceLRO.

public static void asyncCreateInstanceLRO() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        CreateInstanceRequest request = CreateInstanceRequest.newBuilder().setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()).setInstanceId("instanceId902024336").setInstance(Instance.newBuilder().build()).build();
        OperationFuture<Instance, Any> future = cloudRedisClient.createInstanceOperationCallable().futureCall(request);
        // Do something.
        Instance response = future.get();
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Instance(com.google.cloud.redis.v1beta1.Instance) CreateInstanceRequest(com.google.cloud.redis.v1beta1.CreateInstanceRequest) Any(com.google.protobuf.Any)

Example 22 with CloudRedisClient

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

the class SyncCreateInstance method syncCreateInstance.

public static void syncCreateInstance() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        CreateInstanceRequest request = CreateInstanceRequest.newBuilder().setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()).setInstanceId("instanceId902024336").setInstance(Instance.newBuilder().build()).build();
        Instance response = cloudRedisClient.createInstanceAsync(request).get();
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Instance(com.google.cloud.redis.v1beta1.Instance) CreateInstanceRequest(com.google.cloud.redis.v1beta1.CreateInstanceRequest)

Example 23 with CloudRedisClient

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

the class SyncRescheduleMaintenanceInstancenameReschedulemaintenancerequestrescheduletypeTimestamp method syncRescheduleMaintenanceInstancenameReschedulemaintenancerequestrescheduletypeTimestamp.

public static void syncRescheduleMaintenanceInstancenameReschedulemaintenancerequestrescheduletypeTimestamp() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
        RescheduleMaintenanceRequest.RescheduleType rescheduleType = RescheduleMaintenanceRequest.RescheduleType.forNumber(0);
        Timestamp scheduleTime = Timestamp.newBuilder().build();
        Instance response = cloudRedisClient.rescheduleMaintenanceAsync(name, rescheduleType, scheduleTime).get();
    }
}
Also used : InstanceName(com.google.cloud.redis.v1beta1.InstanceName) CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Instance(com.google.cloud.redis.v1beta1.Instance) RescheduleMaintenanceRequest(com.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest) Timestamp(com.google.protobuf.Timestamp)

Example 24 with CloudRedisClient

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

the class AsyncRescheduleMaintenance method asyncRescheduleMaintenance.

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

Example 25 with CloudRedisClient

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

the class AsyncRescheduleMaintenanceLRO method asyncRescheduleMaintenanceLRO.

public static void asyncRescheduleMaintenanceLRO() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        RescheduleMaintenanceRequest request = RescheduleMaintenanceRequest.newBuilder().setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()).setScheduleTime(Timestamp.newBuilder().build()).build();
        OperationFuture<Instance, Any> future = cloudRedisClient.rescheduleMaintenanceOperationCallable().futureCall(request);
        // Do something.
        Instance response = future.get();
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Instance(com.google.cloud.redis.v1beta1.Instance) RescheduleMaintenanceRequest(com.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest) Any(com.google.protobuf.Any)

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