Search in sources :

Example 81 with Instance

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

the class SyncRescheduleMaintenance method syncRescheduleMaintenance.

public static void syncRescheduleMaintenance() 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();
        Instance response = cloudRedisClient.rescheduleMaintenanceAsync(request).get();
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Instance(com.google.cloud.redis.v1beta1.Instance) RescheduleMaintenanceRequest(com.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest)

Example 82 with Instance

use of com.google.cloud.redis.v1.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 83 with Instance

use of com.google.cloud.redis.v1.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 84 with Instance

use of com.google.cloud.redis.v1.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 85 with Instance

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

Aggregations

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