Search in sources :

Example 91 with Instance

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

the class SyncRescheduleMaintenanceStringReschedulemaintenancerequestrescheduletypeTimestamp method syncRescheduleMaintenanceStringReschedulemaintenancerequestrescheduletypeTimestamp.

public static void syncRescheduleMaintenanceStringReschedulemaintenancerequestrescheduletypeTimestamp() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
        RescheduleMaintenanceRequest.RescheduleType rescheduleType = RescheduleMaintenanceRequest.RescheduleType.forNumber(0);
        Timestamp scheduleTime = Timestamp.newBuilder().build();
        Instance response = cloudRedisClient.rescheduleMaintenanceAsync(name, rescheduleType, scheduleTime).get();
    }
}
Also used : 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 92 with Instance

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

the class AsyncUpdateInstanceLRO method asyncUpdateInstanceLRO.

public static void asyncUpdateInstanceLRO() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        UpdateInstanceRequest request = UpdateInstanceRequest.newBuilder().setUpdateMask(FieldMask.newBuilder().build()).setInstance(Instance.newBuilder().build()).build();
        OperationFuture<Instance, Any> future = cloudRedisClient.updateInstanceOperationCallable().futureCall(request);
        // Do something.
        Instance response = future.get();
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) UpdateInstanceRequest(com.google.cloud.redis.v1beta1.UpdateInstanceRequest) Instance(com.google.cloud.redis.v1beta1.Instance) Any(com.google.protobuf.Any)

Example 93 with Instance

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

the class SyncUpdateInstance method syncUpdateInstance.

public static void syncUpdateInstance() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        UpdateInstanceRequest request = UpdateInstanceRequest.newBuilder().setUpdateMask(FieldMask.newBuilder().build()).setInstance(Instance.newBuilder().build()).build();
        Instance response = cloudRedisClient.updateInstanceAsync(request).get();
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) UpdateInstanceRequest(com.google.cloud.redis.v1beta1.UpdateInstanceRequest) Instance(com.google.cloud.redis.v1beta1.Instance)

Example 94 with Instance

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

the class SyncUpdateInstanceFieldmaskInstance method syncUpdateInstanceFieldmaskInstance.

public static void syncUpdateInstanceFieldmaskInstance() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        FieldMask updateMask = FieldMask.newBuilder().build();
        Instance instance = Instance.newBuilder().build();
        Instance response = cloudRedisClient.updateInstanceAsync(updateMask, instance).get();
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Instance(com.google.cloud.redis.v1beta1.Instance) FieldMask(com.google.protobuf.FieldMask)

Example 95 with Instance

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

the class SyncUpgradeInstanceStringString method syncUpgradeInstanceStringString.

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

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