Search in sources :

Example 31 with CloudRedisClient

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

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

Example 33 with CloudRedisClient

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

the class SyncGetInstanceAuthString method syncGetInstanceAuthString.

public static void syncGetInstanceAuthString() 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();
        InstanceAuthString response = cloudRedisClient.getInstanceAuthString(request);
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) GetInstanceAuthStringRequest(com.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest) InstanceAuthString(com.google.cloud.redis.v1beta1.InstanceAuthString)

Example 34 with CloudRedisClient

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

the class SyncGetInstanceAuthStringString method syncGetInstanceAuthStringString.

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

Example 35 with CloudRedisClient

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

the class AsyncImportInstance method asyncImportInstance.

public static void asyncImportInstance() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        ImportInstanceRequest request = ImportInstanceRequest.newBuilder().setName("name3373707").setInputConfig(InputConfig.newBuilder().build()).build();
        ApiFuture<Operation> future = cloudRedisClient.importInstanceCallable().futureCall(request);
        // Do something.
        Operation response = future.get();
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) ImportInstanceRequest(com.google.cloud.redis.v1beta1.ImportInstanceRequest) Operation(com.google.longrunning.Operation)

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