Class CloudRedisClusterClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
Google Cloud Memorystore for Redis Cluster
The `redis.googleapis.com` service implements the Google Cloud Memorystore for Redis API and defines the following resource model for managing Redis clusters:
- The service works with a collection of cloud projects, named: `/projects/*`
- Each project has a collection of available locations, named: `/locations/*`
- Each location has a collection of Redis clusters, named: `/clusters/*`
- As such, Redis clusters are resources of the form: `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}`
Note that location_id must be a GCP `region`; for example:
- `projects/redpepper-1290/locations/us-central1/clusters/my-redis`
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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
Cluster response = cloudRedisClusterClient.getCluster(name);
}
Note: close() needs to be called on the CloudRedisClusterClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
ListClusters |
Lists all Redis clusters owned by a project in either the specified location (region) or all locations. The location should have the following format:
If `location_id` is specified as `-` (wildcard), then all regions available to the project are queried, and the results are aggregated. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetCluster |
Gets the details of a specific Redis cluster. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateCluster |
Updates the metadata and configuration of a specific Redis cluster. Completed longrunning.Operation will contain the new cluster object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteCluster |
Deletes a specific Redis cluster. Cluster stops serving and data is deleted. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateCluster |
Creates a Redis cluster based on the specified properties. The creation is executed asynchronously and callers may check the returned operation to track its progress. Once the operation is completed the Redis cluster will be fully functional. The completed longrunning.Operation will contain the new cluster object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetClusterCertificateAuthority |
Gets the details of certificate authority information for Redis cluster. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetSharedRegionalCertificateAuthority |
Gets the details of regional certificate authority information for Redis cluster. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RescheduleClusterMaintenance |
Reschedules upcoming maintenance event. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListBackupCollections |
Lists all backup collections owned by a consumer project in either the specified location (region) or all locations. If `location_id` is specified as `-` (wildcard), then all regions available to the project are queried, and the results are aggregated. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetBackupCollection |
Get a backup collection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListBackups |
Lists all backups owned by a backup collection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetBackup |
Gets the details of a specific backup. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteBackup |
Deletes a specific backup. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ExportBackup |
Exports a specific backup to a customer target Cloud Storage URI. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
BackupCluster |
Backup Redis Cluster. If this is the first time a backup is being created, a backup collection will be created at the backend, and this backup belongs to this collection. Both collection and backup will have a resource name. Backup will be executed for each shard. A replica (primary if nonHA) will be selected to perform the execution. Backup call will be rejected if there is an ongoing backup or update operation. Be aware that during preview, if the cluster's internal software version is too old, critical update will be performed before actual backup. Once the internal software version is updated to the minimum version required by the backup feature, subsequent backups will not require critical update. After preview, there will be no critical update needed for backup. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of CloudRedisClusterSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
CloudRedisClusterSettings cloudRedisClusterSettings =
CloudRedisClusterSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
CloudRedisClusterClient cloudRedisClusterClient =
CloudRedisClusterClient.create(cloudRedisClusterSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
CloudRedisClusterSettings cloudRedisClusterSettings =
CloudRedisClusterSettings.newBuilder().setEndpoint(myEndpoint).build();
CloudRedisClusterClient cloudRedisClusterClient =
CloudRedisClusterClient.create(cloudRedisClusterSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
CloudRedisClusterSettings cloudRedisClusterSettings =
CloudRedisClusterSettings.newHttpJsonBuilder().build();
CloudRedisClusterClient cloudRedisClusterClient =
CloudRedisClusterClient.create(cloudRedisClusterSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs an instance of CloudRedisClusterClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final OperationFuture<Cluster,com.google.protobuf.Any> backupClusterAsync(BackupClusterRequest request) Backup Redis Cluster.final OperationFuture<Cluster,com.google.protobuf.Any> Backup Redis Cluster.final OperationFuture<Cluster,com.google.protobuf.Any> backupClusterAsync(String name) Backup Redis Cluster.Backup Redis Cluster.final OperationCallable<BackupClusterRequest,Cluster, com.google.protobuf.Any> Backup Redis Cluster.final voidclose()static final CloudRedisClusterClientcreate()Constructs an instance of CloudRedisClusterClient with default settings.static final CloudRedisClusterClientcreate(CloudRedisClusterSettings settings) Constructs an instance of CloudRedisClusterClient, using the given settings.static final CloudRedisClusterClientcreate(CloudRedisClusterStub stub) Constructs an instance of CloudRedisClusterClient, using the given stub for making calls.final OperationFuture<Cluster,com.google.protobuf.Any> createClusterAsync(CreateClusterRequest request) Creates a Redis cluster based on the specified properties.final OperationFuture<Cluster,com.google.protobuf.Any> createClusterAsync(LocationName parent, Cluster cluster, String clusterId) Creates a Redis cluster based on the specified properties.final OperationFuture<Cluster,com.google.protobuf.Any> createClusterAsync(String parent, Cluster cluster, String clusterId) Creates a Redis cluster based on the specified properties.Creates a Redis cluster based on the specified properties.final OperationCallable<CreateClusterRequest,Cluster, com.google.protobuf.Any> Creates a Redis cluster based on the specified properties.final OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Any> deleteBackupAsync(BackupName name) Deletes a specific backup.final OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Any> deleteBackupAsync(DeleteBackupRequest request) Deletes a specific backup.final OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Any> deleteBackupAsync(String name) Deletes a specific backup.Deletes a specific backup.final OperationCallable<DeleteBackupRequest,com.google.protobuf.Empty, com.google.protobuf.Any> Deletes a specific backup.final OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Any> Deletes a specific Redis cluster.final OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Any> deleteClusterAsync(DeleteClusterRequest request) Deletes a specific Redis cluster.final OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Any> deleteClusterAsync(String name) Deletes a specific Redis cluster.Deletes a specific Redis cluster.final OperationCallable<DeleteClusterRequest,com.google.protobuf.Empty, com.google.protobuf.Any> Deletes a specific Redis cluster.final OperationFuture<Backup,com.google.protobuf.Any> exportBackupAsync(ExportBackupRequest request) Exports a specific backup to a customer target Cloud Storage URI.Exports a specific backup to a customer target Cloud Storage URI.final OperationCallable<ExportBackupRequest,Backup, com.google.protobuf.Any> Exports a specific backup to a customer target Cloud Storage URI.final BackupgetBackup(BackupName name) Gets the details of a specific backup.final BackupgetBackup(GetBackupRequest request) Gets the details of a specific backup.final BackupGets the details of a specific backup.final UnaryCallable<GetBackupRequest,Backup> Gets the details of a specific backup.final BackupCollectionGet a backup collection.final BackupCollectionGet a backup collection.final BackupCollectiongetBackupCollection(String name) Get a backup collection.Get a backup collection.final ClustergetCluster(ClusterName name) Gets the details of a specific Redis cluster.final ClustergetCluster(GetClusterRequest request) Gets the details of a specific Redis cluster.final ClustergetCluster(String name) Gets the details of a specific Redis cluster.Gets the details of a specific Redis cluster.final CertificateAuthorityGets the details of certificate authority information for Redis cluster.final CertificateAuthorityGets the details of certificate authority information for Redis cluster.final CertificateAuthorityGets the details of certificate authority information for Redis cluster.Gets the details of certificate authority information for Redis cluster.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.Gets the details of regional certificate authority information for Redis cluster.Gets the details of regional certificate authority information for Redis cluster.Gets the details of regional certificate authority information for Redis cluster.final UnaryCallable<GetSharedRegionalCertificateAuthorityRequest,SharedRegionalCertificateAuthority> Gets the details of regional certificate authority information for Redis cluster.getStub()booleanbooleanLists all backup collections owned by a consumer project in either the specified location (region) or all locations.listBackupCollections(LocationName parent) Lists all backup collections owned by a consumer project in either the specified location (region) or all locations.listBackupCollections(String parent) Lists all backup collections owned by a consumer project in either the specified location (region) or all locations.Lists all backup collections owned by a consumer project in either the specified location (region) or all locations.final UnaryCallable<ListBackupCollectionsRequest,CloudRedisClusterClient.ListBackupCollectionsPagedResponse> Lists all backup collections owned by a consumer project in either the specified location (region) or all locations.listBackups(BackupCollectionName parent) Lists all backups owned by a backup collection.listBackups(ListBackupsRequest request) Lists all backups owned by a backup collection.listBackups(String parent) Lists all backups owned by a backup collection.Lists all backups owned by a backup collection.Lists all backups owned by a backup collection.listClusters(ListClustersRequest request) Lists all Redis clusters owned by a project in either the specified location (region) or all locations.listClusters(LocationName parent) Lists all Redis clusters owned by a project in either the specified location (region) or all locations.listClusters(String parent) Lists all Redis clusters owned by a project in either the specified location (region) or all locations.Lists all Redis clusters owned by a project in either the specified location (region) or all locations.Lists all Redis clusters owned by a project in either the specified location (region) or all locations.listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists information about the supported locations for this service.final OperationFuture<Cluster,com.google.protobuf.Any> rescheduleClusterMaintenanceAsync(ClusterName name, RescheduleClusterMaintenanceRequest.RescheduleType rescheduleType, com.google.protobuf.Timestamp scheduleTime) Reschedules upcoming maintenance event.final OperationFuture<Cluster,com.google.protobuf.Any> Reschedules upcoming maintenance event.final OperationFuture<Cluster,com.google.protobuf.Any> rescheduleClusterMaintenanceAsync(String name, RescheduleClusterMaintenanceRequest.RescheduleType rescheduleType, com.google.protobuf.Timestamp scheduleTime) Reschedules upcoming maintenance event.Reschedules upcoming maintenance event.final OperationCallable<RescheduleClusterMaintenanceRequest,Cluster, com.google.protobuf.Any> Reschedules upcoming maintenance event.voidshutdown()voidfinal OperationFuture<Cluster,com.google.protobuf.Any> updateClusterAsync(Cluster cluster, com.google.protobuf.FieldMask updateMask) Updates the metadata and configuration of a specific Redis cluster.final OperationFuture<Cluster,com.google.protobuf.Any> updateClusterAsync(UpdateClusterRequest request) Updates the metadata and configuration of a specific Redis cluster.Updates the metadata and configuration of a specific Redis cluster.final OperationCallable<UpdateClusterRequest,Cluster, com.google.protobuf.Any> Updates the metadata and configuration of a specific Redis cluster.
-
Constructor Details
-
CloudRedisClusterClient
Constructs an instance of CloudRedisClusterClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
CloudRedisClusterClient
-
-
Method Details
-
create
Constructs an instance of CloudRedisClusterClient with default settings.- Throws:
IOException
-
create
public static final CloudRedisClusterClient create(CloudRedisClusterSettings settings) throws IOException Constructs an instance of CloudRedisClusterClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of CloudRedisClusterClient, using the given stub for making calls. This is for advanced usage - prefer using create(CloudRedisClusterSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
getHttpJsonOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
listClusters
Lists all Redis clusters owned by a project in either the specified location (region) or all locations.The location should have the following format:
- `projects/{project_id}/locations/{location_id}`
If `location_id` is specified as `-` (wildcard), then all regions available to the project are queried, and the results are aggregated.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Cluster element : cloudRedisClusterClient.listClusters(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the cluster location using the form: `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region.- Throws:
ApiException- if the remote call fails
-
listClusters
Lists all Redis clusters owned by a project in either the specified location (region) or all locations.The location should have the following format:
- `projects/{project_id}/locations/{location_id}`
If `location_id` is specified as `-` (wildcard), then all regions available to the project are queried, and the results are aggregated.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Cluster element : cloudRedisClusterClient.listClusters(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the cluster location using the form: `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region.- Throws:
ApiException- if the remote call fails
-
listClusters
public final CloudRedisClusterClient.ListClustersPagedResponse listClusters(ListClustersRequest request) Lists all Redis clusters owned by a project in either the specified location (region) or all locations.The location should have the following format:
- `projects/{project_id}/locations/{location_id}`
If `location_id` is specified as `-` (wildcard), then all regions available to the project are queried, and the results are aggregated.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ListClustersRequest request = ListClustersRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Cluster element : cloudRedisClusterClient.listClusters(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listClustersPagedCallable
public final UnaryCallable<ListClustersRequest,CloudRedisClusterClient.ListClustersPagedResponse> listClustersPagedCallable()Lists all Redis clusters owned by a project in either the specified location (region) or all locations.The location should have the following format:
- `projects/{project_id}/locations/{location_id}`
If `location_id` is specified as `-` (wildcard), then all regions available to the project are queried, and the results are aggregated.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ListClustersRequest request = ListClustersRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Cluster> future = cloudRedisClusterClient.listClustersPagedCallable().futureCall(request); // Do something. for (Cluster element : future.get().iterateAll()) { // doThingsWith(element); } } -
listClustersCallable
Lists all Redis clusters owned by a project in either the specified location (region) or all locations.The location should have the following format:
- `projects/{project_id}/locations/{location_id}`
If `location_id` is specified as `-` (wildcard), then all regions available to the project are queried, and the results are aggregated.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ListClustersRequest request = ListClustersRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListClustersResponse response = cloudRedisClusterClient.listClustersCallable().call(request); for (Cluster element : response.getClustersList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getCluster
Gets the details of a specific Redis cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); Cluster response = cloudRedisClusterClient.getCluster(name); }- Parameters:
name- Required. Redis cluster resource name using the form: `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id` refers to a GCP region.- Throws:
ApiException- if the remote call fails
-
getCluster
Gets the details of a specific Redis cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); Cluster response = cloudRedisClusterClient.getCluster(name); }- Parameters:
name- Required. Redis cluster resource name using the form: `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id` refers to a GCP region.- Throws:
ApiException- if the remote call fails
-
getCluster
Gets the details of a specific Redis cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { GetClusterRequest request = GetClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) .build(); Cluster response = cloudRedisClusterClient.getCluster(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getClusterCallable
Gets the details of a specific Redis cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { GetClusterRequest request = GetClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) .build(); ApiFuture<Cluster> future = cloudRedisClusterClient.getClusterCallable().futureCall(request); // Do something. Cluster response = future.get(); } -
updateClusterAsync
public final OperationFuture<Cluster,com.google.protobuf.Any> updateClusterAsync(Cluster cluster, com.google.protobuf.FieldMask updateMask) Updates the metadata and configuration of a specific Redis cluster.Completed longrunning.Operation will contain the new cluster object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { Cluster cluster = Cluster.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Cluster response = cloudRedisClusterClient.updateClusterAsync(cluster, updateMask).get(); }- Parameters:
cluster- Required. Update description. Only fields specified in update_mask are updated.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 [Cluster][google.cloud.redis.cluster.v1.Cluster]:* `size_gb` * `replica_count`
- Throws:
ApiException- if the remote call fails
-
updateClusterAsync
public final OperationFuture<Cluster,com.google.protobuf.Any> updateClusterAsync(UpdateClusterRequest request) Updates the metadata and configuration of a specific Redis cluster.Completed longrunning.Operation will contain the new cluster object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { UpdateClusterRequest request = UpdateClusterRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setCluster(Cluster.newBuilder().build()) .setRequestId("requestId693933066") .build(); Cluster response = cloudRedisClusterClient.updateClusterAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateClusterOperationCallable
public final OperationCallable<UpdateClusterRequest,Cluster, updateClusterOperationCallable()com.google.protobuf.Any> Updates the metadata and configuration of a specific Redis cluster.Completed longrunning.Operation will contain the new cluster object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { UpdateClusterRequest request = UpdateClusterRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setCluster(Cluster.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Cluster, Any> future = cloudRedisClusterClient.updateClusterOperationCallable().futureCall(request); // Do something. Cluster response = future.get(); } -
updateClusterCallable
Updates the metadata and configuration of a specific Redis cluster.Completed longrunning.Operation will contain the new cluster object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { UpdateClusterRequest request = UpdateClusterRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setCluster(Cluster.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = cloudRedisClusterClient.updateClusterCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteClusterAsync
public final OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Any> deleteClusterAsync(ClusterName name) Deletes a specific Redis cluster. Cluster stops serving and data is deleted.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); cloudRedisClusterClient.deleteClusterAsync(name).get(); }- Parameters:
name- Required. Redis cluster resource name using the form: `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id` refers to a GCP region.- Throws:
ApiException- if the remote call fails
-
deleteClusterAsync
public final OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Any> deleteClusterAsync(String name) Deletes a specific Redis cluster. Cluster stops serving and data is deleted.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); cloudRedisClusterClient.deleteClusterAsync(name).get(); }- Parameters:
name- Required. Redis cluster resource name using the form: `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id` refers to a GCP region.- Throws:
ApiException- if the remote call fails
-
deleteClusterAsync
public final OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Any> deleteClusterAsync(DeleteClusterRequest request) Deletes a specific Redis cluster. Cluster stops serving and data is deleted.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { DeleteClusterRequest request = DeleteClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) .setRequestId("requestId693933066") .build(); cloudRedisClusterClient.deleteClusterAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteClusterOperationCallable
public final OperationCallable<DeleteClusterRequest,com.google.protobuf.Empty, deleteClusterOperationCallable()com.google.protobuf.Any> Deletes a specific Redis cluster. Cluster stops serving and data is deleted.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { DeleteClusterRequest request = DeleteClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, Any> future = cloudRedisClusterClient.deleteClusterOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteClusterCallable
Deletes a specific Redis cluster. Cluster stops serving and data is deleted.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { DeleteClusterRequest request = DeleteClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = cloudRedisClusterClient.deleteClusterCallable().futureCall(request); // Do something. future.get(); } -
createClusterAsync
public final OperationFuture<Cluster,com.google.protobuf.Any> createClusterAsync(LocationName parent, Cluster cluster, String clusterId) Creates a Redis cluster based on the specified properties. The creation is executed asynchronously and callers may check the returned operation to track its progress. Once the operation is completed the Redis cluster will be fully functional. The completed longrunning.Operation will contain the new cluster object in the response field.The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Cluster cluster = Cluster.newBuilder().build(); String clusterId = "clusterId561939637"; Cluster response = cloudRedisClusterClient.createClusterAsync(parent, cluster, clusterId).get(); }- Parameters:
parent- Required. The resource name of the cluster location using the form: `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region.cluster- Required. The cluster that is to be created.clusterId- Required. The logical name of the Redis cluster in the customer project with the following restrictions:- Must contain only lowercase letters, numbers, and hyphens.
- Must start with a letter.
- Must be between 1-63 characters.
- Must end with a number or a letter.
- Must be unique within the customer project / location
- Throws:
ApiException- if the remote call fails
-
createClusterAsync
public final OperationFuture<Cluster,com.google.protobuf.Any> createClusterAsync(String parent, Cluster cluster, String clusterId) Creates a Redis cluster based on the specified properties. The creation is executed asynchronously and callers may check the returned operation to track its progress. Once the operation is completed the Redis cluster will be fully functional. The completed longrunning.Operation will contain the new cluster object in the response field.The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Cluster cluster = Cluster.newBuilder().build(); String clusterId = "clusterId561939637"; Cluster response = cloudRedisClusterClient.createClusterAsync(parent, cluster, clusterId).get(); }- Parameters:
parent- Required. The resource name of the cluster location using the form: `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region.cluster- Required. The cluster that is to be created.clusterId- Required. The logical name of the Redis cluster in the customer project with the following restrictions:- Must contain only lowercase letters, numbers, and hyphens.
- Must start with a letter.
- Must be between 1-63 characters.
- Must end with a number or a letter.
- Must be unique within the customer project / location
- Throws:
ApiException- if the remote call fails
-
createClusterAsync
public final OperationFuture<Cluster,com.google.protobuf.Any> createClusterAsync(CreateClusterRequest request) Creates a Redis cluster based on the specified properties. The creation is executed asynchronously and callers may check the returned operation to track its progress. Once the operation is completed the Redis cluster will be fully functional. The completed longrunning.Operation will contain the new cluster object in the response field.The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { CreateClusterRequest request = CreateClusterRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setClusterId("clusterId561939637") .setCluster(Cluster.newBuilder().build()) .setRequestId("requestId693933066") .build(); Cluster response = cloudRedisClusterClient.createClusterAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createClusterOperationCallable
public final OperationCallable<CreateClusterRequest,Cluster, createClusterOperationCallable()com.google.protobuf.Any> Creates a Redis cluster based on the specified properties. The creation is executed asynchronously and callers may check the returned operation to track its progress. Once the operation is completed the Redis cluster will be fully functional. The completed longrunning.Operation will contain the new cluster object in the response field.The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { CreateClusterRequest request = CreateClusterRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setClusterId("clusterId561939637") .setCluster(Cluster.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Cluster, Any> future = cloudRedisClusterClient.createClusterOperationCallable().futureCall(request); // Do something. Cluster response = future.get(); } -
createClusterCallable
Creates a Redis cluster based on the specified properties. The creation is executed asynchronously and callers may check the returned operation to track its progress. Once the operation is completed the Redis cluster will be fully functional. The completed longrunning.Operation will contain the new cluster object in the response field.The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { CreateClusterRequest request = CreateClusterRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setClusterId("clusterId561939637") .setCluster(Cluster.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = cloudRedisClusterClient.createClusterCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getClusterCertificateAuthority
Gets the details of certificate authority information for Redis cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { CertificateAuthorityName name = CertificateAuthorityName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); CertificateAuthority response = cloudRedisClusterClient.getClusterCertificateAuthority(name); }- Parameters:
name- Required. Redis cluster certificate authority resource name using the form: `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` where `location_id` refers to a GCP region.- Throws:
ApiException- if the remote call fails
-
getClusterCertificateAuthority
Gets the details of certificate authority information for Redis cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { String name = CertificateAuthorityName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); CertificateAuthority response = cloudRedisClusterClient.getClusterCertificateAuthority(name); }- Parameters:
name- Required. Redis cluster certificate authority resource name using the form: `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` where `location_id` refers to a GCP region.- Throws:
ApiException- if the remote call fails
-
getClusterCertificateAuthority
public final CertificateAuthority getClusterCertificateAuthority(GetClusterCertificateAuthorityRequest request) Gets the details of certificate authority information for Redis cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { GetClusterCertificateAuthorityRequest request = GetClusterCertificateAuthorityRequest.newBuilder() .setName( CertificateAuthorityName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) .build(); CertificateAuthority response = cloudRedisClusterClient.getClusterCertificateAuthority(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getClusterCertificateAuthorityCallable
public final UnaryCallable<GetClusterCertificateAuthorityRequest,CertificateAuthority> getClusterCertificateAuthorityCallable()Gets the details of certificate authority information for Redis cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { GetClusterCertificateAuthorityRequest request = GetClusterCertificateAuthorityRequest.newBuilder() .setName( CertificateAuthorityName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) .build(); ApiFuture<CertificateAuthority> future = cloudRedisClusterClient.getClusterCertificateAuthorityCallable().futureCall(request); // Do something. CertificateAuthority response = future.get(); } -
rescheduleClusterMaintenanceAsync
public final OperationFuture<Cluster,com.google.protobuf.Any> rescheduleClusterMaintenanceAsync(ClusterName name, RescheduleClusterMaintenanceRequest.RescheduleType rescheduleType, com.google.protobuf.Timestamp scheduleTime) Reschedules upcoming maintenance event.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); RescheduleClusterMaintenanceRequest.RescheduleType rescheduleType = RescheduleClusterMaintenanceRequest.RescheduleType.forNumber(0); Timestamp scheduleTime = Timestamp.newBuilder().build(); Cluster response = cloudRedisClusterClient .rescheduleClusterMaintenanceAsync(name, rescheduleType, scheduleTime) .get(); }- Parameters:
name- Required. Redis Cluster instance resource name using the form: `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id` refers to a GCP region.rescheduleType- Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well.scheduleTime- Optional. Timestamp when the maintenance shall be rescheduled to if reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example `2012-11-15T16:19:00.094Z`.- Throws:
ApiException- if the remote call fails
-
rescheduleClusterMaintenanceAsync
public final OperationFuture<Cluster,com.google.protobuf.Any> rescheduleClusterMaintenanceAsync(String name, RescheduleClusterMaintenanceRequest.RescheduleType rescheduleType, com.google.protobuf.Timestamp scheduleTime) Reschedules upcoming maintenance event.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); RescheduleClusterMaintenanceRequest.RescheduleType rescheduleType = RescheduleClusterMaintenanceRequest.RescheduleType.forNumber(0); Timestamp scheduleTime = Timestamp.newBuilder().build(); Cluster response = cloudRedisClusterClient .rescheduleClusterMaintenanceAsync(name, rescheduleType, scheduleTime) .get(); }- Parameters:
name- Required. Redis Cluster instance resource name using the form: `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id` refers to a GCP region.rescheduleType- Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well.scheduleTime- Optional. Timestamp when the maintenance shall be rescheduled to if reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example `2012-11-15T16:19:00.094Z`.- Throws:
ApiException- if the remote call fails
-
rescheduleClusterMaintenanceAsync
public final OperationFuture<Cluster,com.google.protobuf.Any> rescheduleClusterMaintenanceAsync(RescheduleClusterMaintenanceRequest request) Reschedules upcoming maintenance event.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { RescheduleClusterMaintenanceRequest request = RescheduleClusterMaintenanceRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) .setScheduleTime(Timestamp.newBuilder().build()) .build(); Cluster response = cloudRedisClusterClient.rescheduleClusterMaintenanceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
rescheduleClusterMaintenanceOperationCallable
public final OperationCallable<RescheduleClusterMaintenanceRequest,Cluster, rescheduleClusterMaintenanceOperationCallable()com.google.protobuf.Any> Reschedules upcoming maintenance event.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { RescheduleClusterMaintenanceRequest request = RescheduleClusterMaintenanceRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) .setScheduleTime(Timestamp.newBuilder().build()) .build(); OperationFuture<Cluster, Any> future = cloudRedisClusterClient .rescheduleClusterMaintenanceOperationCallable() .futureCall(request); // Do something. Cluster response = future.get(); } -
rescheduleClusterMaintenanceCallable
public final UnaryCallable<RescheduleClusterMaintenanceRequest,Operation> rescheduleClusterMaintenanceCallable()Reschedules upcoming maintenance event.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { RescheduleClusterMaintenanceRequest request = RescheduleClusterMaintenanceRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) .setScheduleTime(Timestamp.newBuilder().build()) .build(); ApiFuture<Operation> future = cloudRedisClusterClient.rescheduleClusterMaintenanceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
listBackupCollections
public final CloudRedisClusterClient.ListBackupCollectionsPagedResponse listBackupCollections(LocationName parent) Lists all backup collections owned by a consumer project in either the specified location (region) or all locations.If `location_id` is specified as `-` (wildcard), then all regions available to the project are queried, and the results are aggregated.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (BackupCollection element : cloudRedisClusterClient.listBackupCollections(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the backupCollection location using the form: `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region.- Throws:
ApiException- if the remote call fails
-
listBackupCollections
public final CloudRedisClusterClient.ListBackupCollectionsPagedResponse listBackupCollections(String parent) Lists all backup collections owned by a consumer project in either the specified location (region) or all locations.If `location_id` is specified as `-` (wildcard), then all regions available to the project are queried, and the results are aggregated.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (BackupCollection element : cloudRedisClusterClient.listBackupCollections(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the backupCollection location using the form: `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region.- Throws:
ApiException- if the remote call fails
-
listBackupCollections
public final CloudRedisClusterClient.ListBackupCollectionsPagedResponse listBackupCollections(ListBackupCollectionsRequest request) Lists all backup collections owned by a consumer project in either the specified location (region) or all locations.If `location_id` is specified as `-` (wildcard), then all regions available to the project are queried, and the results are aggregated.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ListBackupCollectionsRequest request = ListBackupCollectionsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (BackupCollection element : cloudRedisClusterClient.listBackupCollections(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listBackupCollectionsPagedCallable
public final UnaryCallable<ListBackupCollectionsRequest,CloudRedisClusterClient.ListBackupCollectionsPagedResponse> listBackupCollectionsPagedCallable()Lists all backup collections owned by a consumer project in either the specified location (region) or all locations.If `location_id` is specified as `-` (wildcard), then all regions available to the project are queried, and the results are aggregated.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ListBackupCollectionsRequest request = ListBackupCollectionsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<BackupCollection> future = cloudRedisClusterClient.listBackupCollectionsPagedCallable().futureCall(request); // Do something. for (BackupCollection element : future.get().iterateAll()) { // doThingsWith(element); } } -
listBackupCollectionsCallable
public final UnaryCallable<ListBackupCollectionsRequest,ListBackupCollectionsResponse> listBackupCollectionsCallable()Lists all backup collections owned by a consumer project in either the specified location (region) or all locations.If `location_id` is specified as `-` (wildcard), then all regions available to the project are queried, and the results are aggregated.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ListBackupCollectionsRequest request = ListBackupCollectionsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListBackupCollectionsResponse response = cloudRedisClusterClient.listBackupCollectionsCallable().call(request); for (BackupCollection element : response.getBackupCollectionsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getBackupCollection
Get a backup collection.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { BackupCollectionName name = BackupCollectionName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]"); BackupCollection response = cloudRedisClusterClient.getBackupCollection(name); }- Parameters:
name- Required. Redis backupCollection resource name using the form: `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` where `location_id` refers to a GCP region.- Throws:
ApiException- if the remote call fails
-
getBackupCollection
Get a backup collection.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { String name = BackupCollectionName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]").toString(); BackupCollection response = cloudRedisClusterClient.getBackupCollection(name); }- Parameters:
name- Required. Redis backupCollection resource name using the form: `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` where `location_id` refers to a GCP region.- Throws:
ApiException- if the remote call fails
-
getBackupCollection
Get a backup collection.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { GetBackupCollectionRequest request = GetBackupCollectionRequest.newBuilder() .setName( BackupCollectionName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]") .toString()) .build(); BackupCollection response = cloudRedisClusterClient.getBackupCollection(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getBackupCollectionCallable
public final UnaryCallable<GetBackupCollectionRequest,BackupCollection> getBackupCollectionCallable()Get a backup collection.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { GetBackupCollectionRequest request = GetBackupCollectionRequest.newBuilder() .setName( BackupCollectionName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]") .toString()) .build(); ApiFuture<BackupCollection> future = cloudRedisClusterClient.getBackupCollectionCallable().futureCall(request); // Do something. BackupCollection response = future.get(); } -
listBackups
public final CloudRedisClusterClient.ListBackupsPagedResponse listBackups(BackupCollectionName parent) Lists all backups owned by a backup collection.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { BackupCollectionName parent = BackupCollectionName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]"); for (Backup element : cloudRedisClusterClient.listBackups(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the backupCollection using the form: `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}`- Throws:
ApiException- if the remote call fails
-
listBackups
Lists all backups owned by a backup collection.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { String parent = BackupCollectionName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]").toString(); for (Backup element : cloudRedisClusterClient.listBackups(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the backupCollection using the form: `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}`- Throws:
ApiException- if the remote call fails
-
listBackups
public final CloudRedisClusterClient.ListBackupsPagedResponse listBackups(ListBackupsRequest request) Lists all backups owned by a backup collection.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ListBackupsRequest request = ListBackupsRequest.newBuilder() .setParent( BackupCollectionName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Backup element : cloudRedisClusterClient.listBackups(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listBackupsPagedCallable
public final UnaryCallable<ListBackupsRequest,CloudRedisClusterClient.ListBackupsPagedResponse> listBackupsPagedCallable()Lists all backups owned by a backup collection.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ListBackupsRequest request = ListBackupsRequest.newBuilder() .setParent( BackupCollectionName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Backup> future = cloudRedisClusterClient.listBackupsPagedCallable().futureCall(request); // Do something. for (Backup element : future.get().iterateAll()) { // doThingsWith(element); } } -
listBackupsCallable
Lists all backups owned by a backup collection.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ListBackupsRequest request = ListBackupsRequest.newBuilder() .setParent( BackupCollectionName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListBackupsResponse response = cloudRedisClusterClient.listBackupsCallable().call(request); for (Backup element : response.getBackupsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getBackup
Gets the details of a specific backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]", "[BACKUP]"); Backup response = cloudRedisClusterClient.getBackup(name); }- Parameters:
name- Required. Redis backup resource name using the form: `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}`- Throws:
ApiException- if the remote call fails
-
getBackup
Gets the details of a specific backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]", "[BACKUP]").toString(); Backup response = cloudRedisClusterClient.getBackup(name); }- Parameters:
name- Required. Redis backup resource name using the form: `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}`- Throws:
ApiException- if the remote call fails
-
getBackup
Gets the details of a specific backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { GetBackupRequest request = GetBackupRequest.newBuilder() .setName( BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]", "[BACKUP]") .toString()) .build(); Backup response = cloudRedisClusterClient.getBackup(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getBackupCallable
Gets the details of a specific backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { GetBackupRequest request = GetBackupRequest.newBuilder() .setName( BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]", "[BACKUP]") .toString()) .build(); ApiFuture<Backup> future = cloudRedisClusterClient.getBackupCallable().futureCall(request); // Do something. Backup response = future.get(); } -
deleteBackupAsync
public final OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Any> deleteBackupAsync(BackupName name) Deletes a specific backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]", "[BACKUP]"); cloudRedisClusterClient.deleteBackupAsync(name).get(); }- Parameters:
name- Required. Redis backup resource name using the form: `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}`- Throws:
ApiException- if the remote call fails
-
deleteBackupAsync
public final OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Any> deleteBackupAsync(String name) Deletes a specific backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]", "[BACKUP]").toString(); cloudRedisClusterClient.deleteBackupAsync(name).get(); }- Parameters:
name- Required. Redis backup resource name using the form: `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}`- Throws:
ApiException- if the remote call fails
-
deleteBackupAsync
public final OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Any> deleteBackupAsync(DeleteBackupRequest request) Deletes a specific backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { DeleteBackupRequest request = DeleteBackupRequest.newBuilder() .setName( BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]", "[BACKUP]") .toString()) .setRequestId("requestId693933066") .build(); cloudRedisClusterClient.deleteBackupAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteBackupOperationCallable
public final OperationCallable<DeleteBackupRequest,com.google.protobuf.Empty, deleteBackupOperationCallable()com.google.protobuf.Any> Deletes a specific backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { DeleteBackupRequest request = DeleteBackupRequest.newBuilder() .setName( BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]", "[BACKUP]") .toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, Any> future = cloudRedisClusterClient.deleteBackupOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteBackupCallable
Deletes a specific backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { DeleteBackupRequest request = DeleteBackupRequest.newBuilder() .setName( BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]", "[BACKUP]") .toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = cloudRedisClusterClient.deleteBackupCallable().futureCall(request); // Do something. future.get(); } -
exportBackupAsync
public final OperationFuture<Backup,com.google.protobuf.Any> exportBackupAsync(ExportBackupRequest request) Exports a specific backup to a customer target Cloud Storage URI.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ExportBackupRequest request = ExportBackupRequest.newBuilder() .setName( BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]", "[BACKUP]") .toString()) .build(); Backup response = cloudRedisClusterClient.exportBackupAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
exportBackupOperationCallable
public final OperationCallable<ExportBackupRequest,Backup, exportBackupOperationCallable()com.google.protobuf.Any> Exports a specific backup to a customer target Cloud Storage URI.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ExportBackupRequest request = ExportBackupRequest.newBuilder() .setName( BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]", "[BACKUP]") .toString()) .build(); OperationFuture<Backup, Any> future = cloudRedisClusterClient.exportBackupOperationCallable().futureCall(request); // Do something. Backup response = future.get(); } -
exportBackupCallable
Exports a specific backup to a customer target Cloud Storage URI.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ExportBackupRequest request = ExportBackupRequest.newBuilder() .setName( BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]", "[BACKUP]") .toString()) .build(); ApiFuture<Operation> future = cloudRedisClusterClient.exportBackupCallable().futureCall(request); // Do something. Operation response = future.get(); } -
backupClusterAsync
Backup Redis Cluster. If this is the first time a backup is being created, a backup collection will be created at the backend, and this backup belongs to this collection. Both collection and backup will have a resource name. Backup will be executed for each shard. A replica (primary if nonHA) will be selected to perform the execution. Backup call will be rejected if there is an ongoing backup or update operation. Be aware that during preview, if the cluster's internal software version is too old, critical update will be performed before actual backup. Once the internal software version is updated to the minimum version required by the backup feature, subsequent backups will not require critical update. After preview, there will be no critical update needed for backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); Cluster response = cloudRedisClusterClient.backupClusterAsync(name).get(); }- Parameters:
name- Required. Redis cluster resource name using the form: `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id` refers to a GCP region.- Throws:
ApiException- if the remote call fails
-
backupClusterAsync
Backup Redis Cluster. If this is the first time a backup is being created, a backup collection will be created at the backend, and this backup belongs to this collection. Both collection and backup will have a resource name. Backup will be executed for each shard. A replica (primary if nonHA) will be selected to perform the execution. Backup call will be rejected if there is an ongoing backup or update operation. Be aware that during preview, if the cluster's internal software version is too old, critical update will be performed before actual backup. Once the internal software version is updated to the minimum version required by the backup feature, subsequent backups will not require critical update. After preview, there will be no critical update needed for backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); Cluster response = cloudRedisClusterClient.backupClusterAsync(name).get(); }- Parameters:
name- Required. Redis cluster resource name using the form: `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id` refers to a GCP region.- Throws:
ApiException- if the remote call fails
-
backupClusterAsync
public final OperationFuture<Cluster,com.google.protobuf.Any> backupClusterAsync(BackupClusterRequest request) Backup Redis Cluster. If this is the first time a backup is being created, a backup collection will be created at the backend, and this backup belongs to this collection. Both collection and backup will have a resource name. Backup will be executed for each shard. A replica (primary if nonHA) will be selected to perform the execution. Backup call will be rejected if there is an ongoing backup or update operation. Be aware that during preview, if the cluster's internal software version is too old, critical update will be performed before actual backup. Once the internal software version is updated to the minimum version required by the backup feature, subsequent backups will not require critical update. After preview, there will be no critical update needed for backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { BackupClusterRequest request = BackupClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) .setTtl(Duration.newBuilder().build()) .setBackupId("backupId2121930365") .build(); Cluster response = cloudRedisClusterClient.backupClusterAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
backupClusterOperationCallable
public final OperationCallable<BackupClusterRequest,Cluster, backupClusterOperationCallable()com.google.protobuf.Any> Backup Redis Cluster. If this is the first time a backup is being created, a backup collection will be created at the backend, and this backup belongs to this collection. Both collection and backup will have a resource name. Backup will be executed for each shard. A replica (primary if nonHA) will be selected to perform the execution. Backup call will be rejected if there is an ongoing backup or update operation. Be aware that during preview, if the cluster's internal software version is too old, critical update will be performed before actual backup. Once the internal software version is updated to the minimum version required by the backup feature, subsequent backups will not require critical update. After preview, there will be no critical update needed for backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { BackupClusterRequest request = BackupClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) .setTtl(Duration.newBuilder().build()) .setBackupId("backupId2121930365") .build(); OperationFuture<Cluster, Any> future = cloudRedisClusterClient.backupClusterOperationCallable().futureCall(request); // Do something. Cluster response = future.get(); } -
backupClusterCallable
Backup Redis Cluster. If this is the first time a backup is being created, a backup collection will be created at the backend, and this backup belongs to this collection. Both collection and backup will have a resource name. Backup will be executed for each shard. A replica (primary if nonHA) will be selected to perform the execution. Backup call will be rejected if there is an ongoing backup or update operation. Be aware that during preview, if the cluster's internal software version is too old, critical update will be performed before actual backup. Once the internal software version is updated to the minimum version required by the backup feature, subsequent backups will not require critical update. After preview, there will be no critical update needed for backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { BackupClusterRequest request = BackupClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) .setTtl(Duration.newBuilder().build()) .setBackupId("backupId2121930365") .build(); ApiFuture<Operation> future = cloudRedisClusterClient.backupClusterCallable().futureCall(request); // Do something. Operation response = future.get(); } -
listLocations
public final CloudRedisClusterClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : cloudRedisClusterClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,CloudRedisClusterClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = cloudRedisClusterClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
listLocationsCallable
Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = cloudRedisClusterClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getLocation
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = cloudRedisClusterClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getLocationCallable
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = cloudRedisClusterClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-