Search in sources :

Example 6 with CloudRedisClient

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

the class AsyncFailoverInstance method asyncFailoverInstance.

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

Example 7 with CloudRedisClient

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

the class AsyncFailoverInstanceLRO method asyncFailoverInstanceLRO.

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

Example 8 with CloudRedisClient

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

the class AsyncGetInstance method asyncGetInstance.

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

Example 9 with CloudRedisClient

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

the class SyncGetInstanceInstancename method syncGetInstanceInstancename.

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

Example 10 with CloudRedisClient

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

the class AsyncGetInstanceAuthString method asyncGetInstanceAuthString.

public static void asyncGetInstanceAuthString() 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();
        ApiFuture<InstanceAuthString> future = cloudRedisClient.getInstanceAuthStringCallable().futureCall(request);
        // Do something.
        InstanceAuthString response = future.get();
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) GetInstanceAuthStringRequest(com.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest) InstanceAuthString(com.google.cloud.redis.v1beta1.InstanceAuthString)

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