Search in sources :

Example 86 with Instance

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

Example 87 with Instance

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

the class SyncImportInstanceStringInputconfig method syncImportInstanceStringInputconfig.

public static void syncImportInstanceStringInputconfig() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        String name = "name3373707";
        InputConfig inputConfig = InputConfig.newBuilder().build();
        Instance response = cloudRedisClient.importInstanceAsync(name, inputConfig).get();
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Instance(com.google.cloud.redis.v1beta1.Instance) InputConfig(com.google.cloud.redis.v1beta1.InputConfig)

Example 88 with Instance

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

the class AsyncListInstances method asyncListInstances.

public static void asyncListInstances() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").build();
        ApiFuture<Instance> future = cloudRedisClient.listInstancesPagedCallable().futureCall(request);
        // Do something.
        for (Instance element : future.get().iterateAll()) {
        // doThingsWith(element);
        }
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Instance(com.google.cloud.redis.v1beta1.Instance) ListInstancesRequest(com.google.cloud.redis.v1beta1.ListInstancesRequest)

Example 89 with Instance

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

the class SyncExportInstance method syncExportInstance.

public static void syncExportInstance() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        ExportInstanceRequest request = ExportInstanceRequest.newBuilder().setName("name3373707").setOutputConfig(OutputConfig.newBuilder().build()).build();
        Instance response = cloudRedisClient.exportInstanceAsync(request).get();
    }
}
Also used : ExportInstanceRequest(com.google.cloud.redis.v1beta1.ExportInstanceRequest) CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Instance(com.google.cloud.redis.v1beta1.Instance)

Example 90 with Instance

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

the class SyncExportInstanceStringOutputconfig method syncExportInstanceStringOutputconfig.

public static void syncExportInstanceStringOutputconfig() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        String name = "name3373707";
        OutputConfig outputConfig = OutputConfig.newBuilder().build();
        Instance response = cloudRedisClient.exportInstanceAsync(name, outputConfig).get();
    }
}
Also used : OutputConfig(com.google.cloud.redis.v1beta1.OutputConfig) CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) Instance(com.google.cloud.redis.v1beta1.Instance)

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