diff --git a/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/CloudRedisClient.java b/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/CloudRedisClient.java index a9bd0a72..2537cd56 100644 --- a/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/CloudRedisClient.java +++ b/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/CloudRedisClient.java @@ -66,6 +66,13 @@ *
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + * Instance response = cloudRedisClient.getInstance(name); + * } + * }+ * *
Note: close() needs to be called on the CloudRedisClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * @@ -188,6 +195,17 @@ public final OperationsClient getOperationsClient() { *
If `location_id` is specified as `-` (wildcard), then all regions available to the project * are queried, and the results are aggregated. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (Instance element : cloudRedisClient.listInstances(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the instance location using the form: * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -214,6 +232,17 @@ public final ListInstancesPagedResponse listInstances(LocationName parent) { *
If `location_id` is specified as `-` (wildcard), then all regions available to the project * are queried, and the results are aggregated. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (Instance element : cloudRedisClient.listInstances(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the instance location using the form: * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -237,6 +266,22 @@ public final ListInstancesPagedResponse listInstances(String parent) { *
If `location_id` is specified as `-` (wildcard), then all regions available to the project * are queried, and the results are aggregated. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * ListInstancesRequest request = + * ListInstancesRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Instance element : cloudRedisClient.listInstances(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -259,6 +304,23 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque * are queried, and the results are aggregated. * *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * ListInstancesRequest request = + * ListInstancesRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * cloudRedisClient.listInstancesPagedCallable().futureCall(request); + * // Do something. + * for (Instance element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * while (true) { + * ListInstancesResponse response = cloudRedisClient.listInstancesCallable().call(request); + * for (Instance element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + * Instance response = cloudRedisClient.getInstance(name); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -304,6 +392,15 @@ public final Instance getInstance(InstanceName name) { /** * Gets the details of a specific Redis instance. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + * Instance response = cloudRedisClient.getInstance(name); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -318,6 +415,18 @@ public final Instance getInstance(String name) { /** * Gets the details of a specific Redis instance. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * GetInstanceRequest request = + * GetInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .build(); + * Instance response = cloudRedisClient.getInstance(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -330,6 +439,18 @@ public final Instance getInstance(GetInstanceRequest request) { * Gets the details of a specific Redis instance. * *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * GetInstanceRequest request = + * GetInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = cloudRedisClient.getInstanceCallable().futureCall(request); + * // Do something. + * Instance response = future.get(); + * } + * }
The returned operation is automatically deleted after a few hours, so there is no need to * call DeleteOperation. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * String instanceId = "instanceId902024336"; + * Instance instance = Instance.newBuilder().build(); + * Instance response = cloudRedisClient.createInstanceAsync(parent, instanceId, instance).get(); + * } + * }+ * * @param parent Required. The resource name of the instance location using the form: * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region. * @param instanceId Required. The logical name of the Redis instance in the customer project with @@ -391,6 +523,17 @@ public final OperationFuture
The returned operation is automatically deleted after a few hours, so there is no need to * call DeleteOperation. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * String instanceId = "instanceId902024336"; + * Instance instance = Instance.newBuilder().build(); + * Instance response = cloudRedisClient.createInstanceAsync(parent, instanceId, instance).get(); + * } + * }+ * * @param parent Required. The resource name of the instance location using the form: * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region. * @param instanceId Required. The logical name of the Redis instance in the customer project with @@ -432,6 +575,20 @@ public final OperationFuture
The returned operation is automatically deleted after a few hours, so there is no need to * call DeleteOperation. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * CreateInstanceRequest request = + * CreateInstanceRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setInstanceId("instanceId902024336") + * .setInstance(Instance.newBuilder().build()) + * .build(); + * Instance response = cloudRedisClient.createInstanceAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -456,6 +613,21 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * CreateInstanceRequest request = + * CreateInstanceRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setInstanceId("instanceId902024336") + * .setInstance(Instance.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * cloudRedisClient.createInstanceOperationCallable().futureCall(request); + * // Do something. + * Instance response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * CreateInstanceRequest request = + * CreateInstanceRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setInstanceId("instanceId902024336") + * .setInstance(Instance.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = cloudRedisClient.createInstanceCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Instance instance = Instance.newBuilder().build(); + * Instance response = cloudRedisClient.updateInstanceAsync(updateMask, instance).get(); + * } + * }+ * * @param updateMask Required. Mask of fields to update. At least one path must be supplied in * this field. The elements of the repeated paths field may only include these fields from * [Instance][google.cloud.redis.v1.Instance]: @@ -513,6 +709,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * UpdateInstanceRequest request = + * UpdateInstanceRequest.newBuilder() + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setInstance(Instance.newBuilder().build()) + * .build(); + * Instance response = cloudRedisClient.updateInstanceAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -530,6 +739,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * UpdateInstanceRequest request = + * UpdateInstanceRequest.newBuilder() + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setInstance(Instance.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * cloudRedisClient.updateInstanceOperationCallable().futureCall(request); + * // Do something. + * Instance response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * UpdateInstanceRequest request = + * UpdateInstanceRequest.newBuilder() + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setInstance(Instance.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = cloudRedisClient.updateInstanceCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + * String redisVersion = "redisVersion-1972584739"; + * Instance response = cloudRedisClient.upgradeInstanceAsync(name, redisVersion).get(); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -574,6 +820,16 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + * String redisVersion = "redisVersion-1972584739"; + * Instance response = cloudRedisClient.upgradeInstanceAsync(name, redisVersion).get(); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -591,6 +847,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * UpgradeInstanceRequest request = + * UpgradeInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .setRedisVersion("redisVersion-1972584739") + * .build(); + * Instance response = cloudRedisClient.upgradeInstanceAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -604,6 +873,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * UpgradeInstanceRequest request = + * UpgradeInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .setRedisVersion("redisVersion-1972584739") + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * cloudRedisClient.upgradeInstanceOperationCallable().futureCall(request); + * // Do something. + * Instance response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * UpgradeInstanceRequest request = + * UpgradeInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .setRedisVersion("redisVersion-1972584739") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = cloudRedisClient.upgradeInstanceCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
The returned operation is automatically deleted after a few hours, so there is no need to * call DeleteOperation. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * String name = "name3373707"; + * InputConfig inputConfig = InputConfig.newBuilder().build(); + * Instance response = cloudRedisClient.importInstanceAsync(name, inputConfig).get(); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -653,6 +959,19 @@ public final OperationFuture
The returned operation is automatically deleted after a few hours, so there is no need to * call DeleteOperation. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * ImportInstanceRequest request = + * ImportInstanceRequest.newBuilder() + * .setName("name3373707") + * .setInputConfig(InputConfig.newBuilder().build()) + * .build(); + * Instance response = cloudRedisClient.importInstanceAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -672,6 +991,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * ImportInstanceRequest request = + * ImportInstanceRequest.newBuilder() + * .setName("name3373707") + * .setInputConfig(InputConfig.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * cloudRedisClient.importInstanceOperationCallable().futureCall(request); + * // Do something. + * Instance response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * ImportInstanceRequest request = + * ImportInstanceRequest.newBuilder() + * .setName("name3373707") + * .setInputConfig(InputConfig.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = cloudRedisClient.importInstanceCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
The returned operation is automatically deleted after a few hours, so there is no need to * call DeleteOperation. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * String name = "name3373707"; + * OutputConfig outputConfig = OutputConfig.newBuilder().build(); + * Instance response = cloudRedisClient.exportInstanceAsync(name, outputConfig).get(); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -725,6 +1081,19 @@ public final OperationFuture
The returned operation is automatically deleted after a few hours, so there is no need to * call DeleteOperation. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * ExportInstanceRequest request = + * ExportInstanceRequest.newBuilder() + * .setName("name3373707") + * .setOutputConfig(OutputConfig.newBuilder().build()) + * .build(); + * Instance response = cloudRedisClient.exportInstanceAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -743,6 +1112,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * ExportInstanceRequest request = + * ExportInstanceRequest.newBuilder() + * .setName("name3373707") + * .setOutputConfig(OutputConfig.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * cloudRedisClient.exportInstanceOperationCallable().futureCall(request); + * // Do something. + * Instance response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * ExportInstanceRequest request = + * ExportInstanceRequest.newBuilder() + * .setName("name3373707") + * .setOutputConfig(OutputConfig.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = cloudRedisClient.exportInstanceCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + * FailoverInstanceRequest.DataProtectionMode dataProtectionMode = + * FailoverInstanceRequest.DataProtectionMode.forNumber(0); + * Instance response = cloudRedisClient.failoverInstanceAsync(name, dataProtectionMode).get(); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -791,6 +1198,17 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + * FailoverInstanceRequest.DataProtectionMode dataProtectionMode = + * FailoverInstanceRequest.DataProtectionMode.forNumber(0); + * Instance response = cloudRedisClient.failoverInstanceAsync(name, dataProtectionMode).get(); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -813,6 +1231,18 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * FailoverInstanceRequest request = + * FailoverInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .build(); + * Instance response = cloudRedisClient.failoverInstanceAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -827,6 +1257,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * FailoverInstanceRequest request = + * FailoverInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * cloudRedisClient.failoverInstanceOperationCallable().futureCall(request); + * // Do something. + * Instance response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * FailoverInstanceRequest request = + * FailoverInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = cloudRedisClient.failoverInstanceCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + * cloudRedisClient.deleteInstanceAsync(name).get(); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -863,6 +1327,15 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + * cloudRedisClient.deleteInstanceAsync(name).get(); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -877,6 +1350,18 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * DeleteInstanceRequest request = + * DeleteInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .build(); + * cloudRedisClient.deleteInstanceAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -890,6 +1375,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * DeleteInstanceRequest request = + * DeleteInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * cloudRedisClient.deleteInstanceOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * DeleteInstanceRequest request = + * DeleteInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = cloudRedisClient.deleteInstanceCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample for CloudRedisClient: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + * Instance response = cloudRedisClient.getInstance(name); + * } + * }*/ @Generated("by gapic-generator-java") package com.google.cloud.redis.v1; diff --git a/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisClient.java b/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisClient.java index 75fa4eeb..4411ff29 100644 --- a/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisClient.java +++ b/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/CloudRedisClient.java @@ -67,6 +67,13 @@ *
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + * Instance response = cloudRedisClient.getInstance(name); + * } + * }+ * *
Note: close() needs to be called on the CloudRedisClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * @@ -190,6 +197,17 @@ public final OperationsClient getOperationsClient() { *
If `location_id` is specified as `-` (wildcard), then all regions available to the project * are queried, and the results are aggregated. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (Instance element : cloudRedisClient.listInstances(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the instance location using the form: * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -216,6 +234,17 @@ public final ListInstancesPagedResponse listInstances(LocationName parent) { *
If `location_id` is specified as `-` (wildcard), then all regions available to the project * are queried, and the results are aggregated. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (Instance element : cloudRedisClient.listInstances(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the instance location using the form: * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -239,6 +268,22 @@ public final ListInstancesPagedResponse listInstances(String parent) { *
If `location_id` is specified as `-` (wildcard), then all regions available to the project * are queried, and the results are aggregated. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * ListInstancesRequest request = + * ListInstancesRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Instance element : cloudRedisClient.listInstances(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -261,6 +306,23 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque * are queried, and the results are aggregated. * *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * ListInstancesRequest request = + * ListInstancesRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * cloudRedisClient.listInstancesPagedCallable().futureCall(request); + * // Do something. + * for (Instance element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * while (true) { + * ListInstancesResponse response = cloudRedisClient.listInstancesCallable().call(request); + * for (Instance element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + * Instance response = cloudRedisClient.getInstance(name); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -306,6 +394,15 @@ public final Instance getInstance(InstanceName name) { /** * Gets the details of a specific Redis instance. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + * Instance response = cloudRedisClient.getInstance(name); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -320,6 +417,18 @@ public final Instance getInstance(String name) { /** * Gets the details of a specific Redis instance. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * GetInstanceRequest request = + * GetInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .build(); + * Instance response = cloudRedisClient.getInstance(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -332,6 +441,18 @@ public final Instance getInstance(GetInstanceRequest request) { * Gets the details of a specific Redis instance. * *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * GetInstanceRequest request = + * GetInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = cloudRedisClient.getInstanceCallable().futureCall(request); + * // Do something. + * Instance response = future.get(); + * } + * }
The returned operation is automatically deleted after a few hours, so there is no need to * call DeleteOperation. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * String instanceId = "instanceId902024336"; + * Instance instance = Instance.newBuilder().build(); + * Instance response = cloudRedisClient.createInstanceAsync(parent, instanceId, instance).get(); + * } + * }+ * * @param parent Required. The resource name of the instance location using the form: * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region. * @param instanceId Required. The logical name of the Redis instance in the customer project with @@ -393,6 +525,17 @@ public final OperationFuture
The returned operation is automatically deleted after a few hours, so there is no need to * call DeleteOperation. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * String instanceId = "instanceId902024336"; + * Instance instance = Instance.newBuilder().build(); + * Instance response = cloudRedisClient.createInstanceAsync(parent, instanceId, instance).get(); + * } + * }+ * * @param parent Required. The resource name of the instance location using the form: * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region. * @param instanceId Required. The logical name of the Redis instance in the customer project with @@ -434,6 +577,20 @@ public final OperationFuture
The returned operation is automatically deleted after a few hours, so there is no need to * call DeleteOperation. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * CreateInstanceRequest request = + * CreateInstanceRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setInstanceId("instanceId902024336") + * .setInstance(Instance.newBuilder().build()) + * .build(); + * Instance response = cloudRedisClient.createInstanceAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -457,6 +614,21 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * CreateInstanceRequest request = + * CreateInstanceRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setInstanceId("instanceId902024336") + * .setInstance(Instance.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * cloudRedisClient.createInstanceOperationCallable().futureCall(request); + * // Do something. + * Instance response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * CreateInstanceRequest request = + * CreateInstanceRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setInstanceId("instanceId902024336") + * .setInstance(Instance.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = cloudRedisClient.createInstanceCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Instance instance = Instance.newBuilder().build(); + * Instance response = cloudRedisClient.updateInstanceAsync(updateMask, instance).get(); + * } + * }+ * * @param updateMask Required. Mask of fields to update. At least one path must be supplied in * this field. The elements of the repeated paths field may only include these fields from * [Instance][google.cloud.redis.v1beta1.Instance]: @@ -514,6 +710,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * UpdateInstanceRequest request = + * UpdateInstanceRequest.newBuilder() + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setInstance(Instance.newBuilder().build()) + * .build(); + * Instance response = cloudRedisClient.updateInstanceAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -530,6 +739,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * UpdateInstanceRequest request = + * UpdateInstanceRequest.newBuilder() + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setInstance(Instance.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * cloudRedisClient.updateInstanceOperationCallable().futureCall(request); + * // Do something. + * Instance response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * UpdateInstanceRequest request = + * UpdateInstanceRequest.newBuilder() + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setInstance(Instance.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = cloudRedisClient.updateInstanceCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + * String redisVersion = "redisVersion-1972584739"; + * Instance response = cloudRedisClient.upgradeInstanceAsync(name, redisVersion).get(); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -574,6 +820,16 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + * String redisVersion = "redisVersion-1972584739"; + * Instance response = cloudRedisClient.upgradeInstanceAsync(name, redisVersion).get(); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -591,6 +847,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * UpgradeInstanceRequest request = + * UpgradeInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .setRedisVersion("redisVersion-1972584739") + * .build(); + * Instance response = cloudRedisClient.upgradeInstanceAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -603,6 +872,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * UpgradeInstanceRequest request = + * UpgradeInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .setRedisVersion("redisVersion-1972584739") + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * cloudRedisClient.upgradeInstanceOperationCallable().futureCall(request); + * // Do something. + * Instance response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * UpgradeInstanceRequest request = + * UpgradeInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .setRedisVersion("redisVersion-1972584739") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = cloudRedisClient.upgradeInstanceCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
The returned operation is automatically deleted after a few hours, so there is no need to * call DeleteOperation. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * String name = "name3373707"; + * InputConfig inputConfig = InputConfig.newBuilder().build(); + * Instance response = cloudRedisClient.importInstanceAsync(name, inputConfig).get(); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -652,6 +958,19 @@ public final OperationFuture
The returned operation is automatically deleted after a few hours, so there is no need to * call DeleteOperation. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * ImportInstanceRequest request = + * ImportInstanceRequest.newBuilder() + * .setName("name3373707") + * .setInputConfig(InputConfig.newBuilder().build()) + * .build(); + * Instance response = cloudRedisClient.importInstanceAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -670,6 +989,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * ImportInstanceRequest request = + * ImportInstanceRequest.newBuilder() + * .setName("name3373707") + * .setInputConfig(InputConfig.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * cloudRedisClient.importInstanceOperationCallable().futureCall(request); + * // Do something. + * Instance response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * ImportInstanceRequest request = + * ImportInstanceRequest.newBuilder() + * .setName("name3373707") + * .setInputConfig(InputConfig.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = cloudRedisClient.importInstanceCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
The returned operation is automatically deleted after a few hours, so there is no need to * call DeleteOperation. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * String name = "name3373707"; + * OutputConfig outputConfig = OutputConfig.newBuilder().build(); + * Instance response = cloudRedisClient.exportInstanceAsync(name, outputConfig).get(); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -723,6 +1079,19 @@ public final OperationFuture
The returned operation is automatically deleted after a few hours, so there is no need to * call DeleteOperation. * + *
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * ExportInstanceRequest request = + * ExportInstanceRequest.newBuilder() + * .setName("name3373707") + * .setOutputConfig(OutputConfig.newBuilder().build()) + * .build(); + * Instance response = cloudRedisClient.exportInstanceAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -740,6 +1109,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * ExportInstanceRequest request = + * ExportInstanceRequest.newBuilder() + * .setName("name3373707") + * .setOutputConfig(OutputConfig.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * cloudRedisClient.exportInstanceOperationCallable().futureCall(request); + * // Do something. + * Instance response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * ExportInstanceRequest request = + * ExportInstanceRequest.newBuilder() + * .setName("name3373707") + * .setOutputConfig(OutputConfig.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = cloudRedisClient.exportInstanceCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + * FailoverInstanceRequest.DataProtectionMode dataProtectionMode = + * FailoverInstanceRequest.DataProtectionMode.forNumber(0); + * Instance response = cloudRedisClient.failoverInstanceAsync(name, dataProtectionMode).get(); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -788,6 +1195,17 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + * FailoverInstanceRequest.DataProtectionMode dataProtectionMode = + * FailoverInstanceRequest.DataProtectionMode.forNumber(0); + * Instance response = cloudRedisClient.failoverInstanceAsync(name, dataProtectionMode).get(); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -810,6 +1228,18 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * FailoverInstanceRequest request = + * FailoverInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .build(); + * Instance response = cloudRedisClient.failoverInstanceAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -824,6 +1254,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * FailoverInstanceRequest request = + * FailoverInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * cloudRedisClient.failoverInstanceOperationCallable().futureCall(request); + * // Do something. + * Instance response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * FailoverInstanceRequest request = + * FailoverInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = cloudRedisClient.failoverInstanceCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + * cloudRedisClient.deleteInstanceAsync(name).get(); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -860,6 +1324,15 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + * cloudRedisClient.deleteInstanceAsync(name).get(); + * } + * }+ * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. @@ -874,6 +1347,18 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * DeleteInstanceRequest request = + * DeleteInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .build(); + * cloudRedisClient.deleteInstanceAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -886,6 +1371,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * DeleteInstanceRequest request = + * DeleteInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * cloudRedisClient.deleteInstanceOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * DeleteInstanceRequest request = + * DeleteInstanceRequest.newBuilder() + * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = cloudRedisClient.deleteInstanceCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample for CloudRedisClient: + * + *
{@code + * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + * Instance response = cloudRedisClient.getInstance(name); + * } + * }*/ @Generated("by gapic-generator-java") package com.google.cloud.redis.v1beta1; diff --git a/synth.metadata b/synth.metadata index 92035cdb..9ddc82ca 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,23 +4,23 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-redis.git", - "sha": "3f5ee0488e741618e8ac4624c7cfda6c90094448" + "sha": "0413200359471b00169914ba28fe5391e4a671c6" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, {