GitHub Repository | Product Reference |
Service Description: Configures and manages Cloud Memorystore for Redis clusters
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 |
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
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
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
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.
|
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
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 |
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
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
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.
Static Methods
create()
public static final CloudRedisClusterClient create()
Constructs an instance of CloudRedisClusterClient with default settings.
Returns | |
---|---|
Type | Description |
CloudRedisClusterClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(CloudRedisClusterSettings settings)
public static final CloudRedisClusterClient create(CloudRedisClusterSettings settings)
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.
Parameter | |
---|---|
Name | Description |
settings |
CloudRedisClusterSettings |
Returns | |
---|---|
Type | Description |
CloudRedisClusterClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(CloudRedisClusterStub stub)
public static final CloudRedisClusterClient create(CloudRedisClusterStub stub)
Constructs an instance of CloudRedisClusterClient, using the given stub for making calls. This is for advanced usage - prefer using create(CloudRedisClusterSettings).
Parameter | |
---|---|
Name | Description |
stub |
CloudRedisClusterStub |
Returns | |
---|---|
Type | Description |
CloudRedisClusterClient |
Constructors
CloudRedisClusterClient(CloudRedisClusterSettings settings)
protected CloudRedisClusterClient(CloudRedisClusterSettings settings)
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.
Parameter | |
---|---|
Name | Description |
settings |
CloudRedisClusterSettings |
CloudRedisClusterClient(CloudRedisClusterStub stub)
protected CloudRedisClusterClient(CloudRedisClusterStub stub)
Parameter | |
---|---|
Name | Description |
stub |
CloudRedisClusterStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Parameters | |
---|---|
Name | Description |
duration |
long |
unit |
TimeUnit |
Returns | |
---|---|
Type | Description |
boolean |
Exceptions | |
---|---|
Type | Description |
InterruptedException |
backupClusterAsync(BackupClusterRequest request)
public final OperationFuture<Cluster,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();
}
Parameter | |
---|---|
Name | Description |
request |
BackupClusterRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Cluster,Any> |
backupClusterAsync(ClusterName name)
public final OperationFuture<Cluster,Any> backupClusterAsync(ClusterName name)
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();
}
Parameter | |
---|---|
Name | Description |
name |
ClusterName Required. Redis cluster resource name using the form:
|
Returns | |
---|---|
Type | Description |
OperationFuture<Cluster,Any> |
backupClusterAsync(String name)
public final OperationFuture<Cluster,Any> backupClusterAsync(String name)
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();
}
Parameter | |
---|---|
Name | Description |
name |
String Required. Redis cluster resource name using the form:
|
Returns | |
---|---|
Type | Description |
OperationFuture<Cluster,Any> |
backupClusterCallable()
public final UnaryCallable<BackupClusterRequest,Operation> 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<BackupClusterRequest,Operation> |
backupClusterOperationCallable()
public final OperationCallable<BackupClusterRequest,Cluster,Any> backupClusterOperationCallable()
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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<BackupClusterRequest,Cluster,Any> |
close()
public final void close()
createClusterAsync(CreateClusterRequest request)
public final OperationFuture<Cluster,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();
}
Parameter | |
---|---|
Name | Description |
request |
CreateClusterRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Cluster,Any> |
createClusterAsync(LocationName parent, Cluster cluster, String clusterId)
public final OperationFuture<Cluster,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 | |
---|---|
Name | Description |
parent |
LocationName Required. The resource name of the cluster location using the form:
|
cluster |
Cluster Required. The cluster that is to be created. |
clusterId |
String Required. The logical name of the Redis cluster in the customer project with the following restrictions:
|
Returns | |
---|---|
Type | Description |
OperationFuture<Cluster,Any> |
createClusterAsync(String parent, Cluster cluster, String clusterId)
public final OperationFuture<Cluster,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 | |
---|---|
Name | Description |
parent |
String Required. The resource name of the cluster location using the form:
|
cluster |
Cluster Required. The cluster that is to be created. |
clusterId |
String Required. The logical name of the Redis cluster in the customer project with the following restrictions:
|
Returns | |
---|---|
Type | Description |
OperationFuture<Cluster,Any> |
createClusterCallable()
public final UnaryCallable<CreateClusterRequest,Operation> 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<CreateClusterRequest,Operation> |
createClusterOperationCallable()
public final OperationCallable<CreateClusterRequest,Cluster,Any> createClusterOperationCallable()
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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<CreateClusterRequest,Cluster,Any> |
deleteBackupAsync(BackupName name)
public final OperationFuture<Empty,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();
}
Parameter | |
---|---|
Name | Description |
name |
BackupName Required. Redis backup resource name using the form:
|
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,Any> |
deleteBackupAsync(DeleteBackupRequest request)
public final OperationFuture<Empty,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();
}
Parameter | |
---|---|
Name | Description |
request |
DeleteBackupRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,Any> |
deleteBackupAsync(String name)
public final OperationFuture<Empty,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();
}
Parameter | |
---|---|
Name | Description |
name |
String Required. Redis backup resource name using the form:
|
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,Any> |
deleteBackupCallable()
public final UnaryCallable<DeleteBackupRequest,Operation> 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DeleteBackupRequest,Operation> |
deleteBackupOperationCallable()
public final OperationCallable<DeleteBackupRequest,Empty,Any> deleteBackupOperationCallable()
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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<DeleteBackupRequest,Empty,Any> |
deleteClusterAsync(ClusterName name)
public final OperationFuture<Empty,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();
}
Parameter | |
---|---|
Name | Description |
name |
ClusterName Required. Redis cluster resource name using the form:
|
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,Any> |
deleteClusterAsync(DeleteClusterRequest request)
public final OperationFuture<Empty,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();
}
Parameter | |
---|---|
Name | Description |
request |
DeleteClusterRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,Any> |
deleteClusterAsync(String name)
public final OperationFuture<Empty,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();
}
Parameter | |
---|---|
Name | Description |
name |
String Required. Redis cluster resource name using the form:
|
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,Any> |
deleteClusterCallable()
public final UnaryCallable<DeleteClusterRequest,Operation> 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DeleteClusterRequest,Operation> |
deleteClusterOperationCallable()
public final OperationCallable<DeleteClusterRequest,Empty,Any> deleteClusterOperationCallable()
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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<DeleteClusterRequest,Empty,Any> |
exportBackupAsync(ExportBackupRequest request)
public final OperationFuture<Backup,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();
}
Parameter | |
---|---|
Name | Description |
request |
ExportBackupRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Backup,Any> |
exportBackupCallable()
public final UnaryCallable<ExportBackupRequest,Operation> 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ExportBackupRequest,Operation> |
exportBackupOperationCallable()
public final OperationCallable<ExportBackupRequest,Backup,Any> exportBackupOperationCallable()
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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<ExportBackupRequest,Backup,Any> |
getBackup(BackupName name)
public final Backup getBackup(BackupName name)
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);
}
Parameter | |
---|---|
Name | Description |
name |
BackupName Required. Redis backup resource name using the form:
|
Returns | |
---|---|
Type | Description |
Backup |
getBackup(GetBackupRequest request)
public final Backup getBackup(GetBackupRequest request)
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);
}
Parameter | |
---|---|
Name | Description |
request |
GetBackupRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Backup |
getBackup(String name)
public final Backup getBackup(String name)
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);
}
Parameter | |
---|---|
Name | Description |
name |
String Required. Redis backup resource name using the form:
|
Returns | |
---|---|
Type | Description |
Backup |
getBackupCallable()
public final UnaryCallable<GetBackupRequest,Backup> 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetBackupRequest,Backup> |
getBackupCollection(BackupCollectionName name)
public final BackupCollection getBackupCollection(BackupCollectionName name)
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);
}
Parameter | |
---|---|
Name | Description |
name |
BackupCollectionName Required. Redis backupCollection resource name using the form:
|
Returns | |
---|---|
Type | Description |
BackupCollection |
getBackupCollection(GetBackupCollectionRequest request)
public final BackupCollection getBackupCollection(GetBackupCollectionRequest request)
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);
}
Parameter | |
---|---|
Name | Description |
request |
GetBackupCollectionRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
BackupCollection |
getBackupCollection(String name)
public final BackupCollection getBackupCollection(String name)
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);
}
Parameter | |
---|---|
Name | Description |
name |
String Required. Redis backupCollection resource name using the form:
|
Returns | |
---|---|
Type | Description |
BackupCollection |
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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetBackupCollectionRequest,BackupCollection> |
getCluster(ClusterName name)
public final Cluster getCluster(ClusterName name)
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);
}
Parameter | |
---|---|
Name | Description |
name |
ClusterName Required. Redis cluster resource name using the form:
|
Returns | |
---|---|
Type | Description |
Cluster |
getCluster(GetClusterRequest request)
public final Cluster getCluster(GetClusterRequest request)
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);
}
Parameter | |
---|---|
Name | Description |
request |
GetClusterRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Cluster |
getCluster(String name)
public final Cluster getCluster(String name)
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);
}
Parameter | |
---|---|
Name | Description |
name |
String Required. Redis cluster resource name using the form:
|
Returns | |
---|---|
Type | Description |
Cluster |
getClusterCallable()
public final UnaryCallable<GetClusterRequest,Cluster> 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetClusterRequest,Cluster> |
getClusterCertificateAuthority(CertificateAuthorityName name)
public final CertificateAuthority getClusterCertificateAuthority(CertificateAuthorityName name)
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);
}
Parameter | |
---|---|
Name | Description |
name |
CertificateAuthorityName Required. Redis cluster certificate authority resource name using the form:
|
Returns | |
---|---|
Type | Description |
CertificateAuthority |
getClusterCertificateAuthority(GetClusterCertificateAuthorityRequest request)
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);
}
Parameter | |
---|---|
Name | Description |
request |
GetClusterCertificateAuthorityRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
CertificateAuthority |
getClusterCertificateAuthority(String name)
public final CertificateAuthority getClusterCertificateAuthority(String name)
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);
}
Parameter | |
---|---|
Name | Description |
name |
String Required. Redis cluster certificate authority resource name using the form:
|
Returns | |
---|---|
Type | Description |
CertificateAuthority |
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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetClusterCertificateAuthorityRequest,CertificateAuthority> |
getHttpJsonOperationsClient()
public final OperationsClient getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Returns | |
---|---|
Type | Description |
OperationsClient |
getLocation(GetLocationRequest request)
public final Location getLocation(GetLocationRequest request)
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);
}
Parameter | |
---|---|
Name | Description |
request |
com.google.cloud.location.GetLocationRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
com.google.cloud.location.Location |
getLocationCallable()
public final UnaryCallable<GetLocationRequest,Location> 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
getOperationsClient()
public final OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Returns | |
---|---|
Type | Description |
OperationsClient |
getSettings()
public final CloudRedisClusterSettings getSettings()
Returns | |
---|---|
Type | Description |
CloudRedisClusterSettings |
getStub()
public CloudRedisClusterStub getStub()
Returns | |
---|---|
Type | Description |
CloudRedisClusterStub |
isShutdown()
public boolean isShutdown()
Returns | |
---|---|
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Returns | |
---|---|
Type | Description |
boolean |
listBackupCollections(ListBackupCollectionsRequest request)
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);
}
}
Parameter | |
---|---|
Name | Description |
request |
ListBackupCollectionsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
CloudRedisClusterClient.ListBackupCollectionsPagedResponse |
listBackupCollections(LocationName parent)
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);
}
}
Parameter | |
---|---|
Name | Description |
parent |
LocationName Required. The resource name of the backupCollection location using the form:
|
Returns | |
---|---|
Type | Description |
CloudRedisClusterClient.ListBackupCollectionsPagedResponse |
listBackupCollections(String parent)
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);
}
}
Parameter | |
---|---|
Name | Description |
parent |
String Required. The resource name of the backupCollection location using the form:
|
Returns | |
---|---|
Type | Description |
CloudRedisClusterClient.ListBackupCollectionsPagedResponse |
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;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListBackupCollectionsRequest,ListBackupCollectionsResponse> |
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);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListBackupCollectionsRequest,ListBackupCollectionsPagedResponse> |
listBackups(BackupCollectionName parent)
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);
}
}
Parameter | |
---|---|
Name | Description |
parent |
BackupCollectionName Required. The resource name of the backupCollection using the form:
|
Returns | |
---|---|
Type | Description |
CloudRedisClusterClient.ListBackupsPagedResponse |
listBackups(ListBackupsRequest request)
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);
}
}
Parameter | |
---|---|
Name | Description |
request |
ListBackupsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
CloudRedisClusterClient.ListBackupsPagedResponse |
listBackups(String parent)
public final CloudRedisClusterClient.ListBackupsPagedResponse listBackups(String 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()) {
String parent =
BackupCollectionName.of("[PROJECT]", "[LOCATION]", "[BACKUP_COLLECTION]").toString();
for (Backup element : cloudRedisClusterClient.listBackups(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent |
String Required. The resource name of the backupCollection using the form:
|
Returns | |
---|---|
Type | Description |
CloudRedisClusterClient.ListBackupsPagedResponse |
listBackupsCallable()
public final UnaryCallable<ListBackupsRequest,ListBackupsResponse> 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;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListBackupsRequest,ListBackupsResponse> |
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);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListBackupsRequest,ListBackupsPagedResponse> |
listClusters(ListClustersRequest request)
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);
}
}
Parameter | |
---|---|
Name | Description |
request |
ListClustersRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
CloudRedisClusterClient.ListClustersPagedResponse |
listClusters(LocationName parent)
public final CloudRedisClusterClient.ListClustersPagedResponse listClusters(LocationName parent)
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);
}
}
Parameter | |
---|---|
Name | Description |
parent |
LocationName Required. The resource name of the cluster location using the form:
|
Returns | |
---|---|
Type | Description |
CloudRedisClusterClient.ListClustersPagedResponse |
listClusters(String parent)
public final CloudRedisClusterClient.ListClustersPagedResponse listClusters(String parent)
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);
}
}
Parameter | |
---|---|
Name | Description |
parent |
String Required. The resource name of the cluster location using the form:
|
Returns | |
---|---|
Type | Description |
CloudRedisClusterClient.ListClustersPagedResponse |
listClustersCallable()
public final UnaryCallable<ListClustersRequest,ListClustersResponse> 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;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListClustersRequest,ListClustersResponse> |
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);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListClustersRequest,ListClustersPagedResponse> |
listLocations(ListLocationsRequest request)
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);
}
}
Parameter | |
---|---|
Name | Description |
request |
com.google.cloud.location.ListLocationsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
CloudRedisClusterClient.ListLocationsPagedResponse |
listLocationsCallable()
public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> 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;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
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);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse> |
rescheduleClusterMaintenanceAsync(ClusterName name, RescheduleClusterMaintenanceRequest.RescheduleType rescheduleType, Timestamp scheduleTime)
public final OperationFuture<Cluster,Any> rescheduleClusterMaintenanceAsync(ClusterName name, RescheduleClusterMaintenanceRequest.RescheduleType rescheduleType, 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 | Description |
name |
ClusterName Required. Redis Cluster instance resource name using the form:
|
rescheduleType |
RescheduleClusterMaintenanceRequest.RescheduleType Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. |
scheduleTime |
Timestamp Optional. Timestamp when the maintenance shall be rescheduled to if
reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example |
Returns | |
---|---|
Type | Description |
OperationFuture<Cluster,Any> |
rescheduleClusterMaintenanceAsync(RescheduleClusterMaintenanceRequest request)
public final OperationFuture<Cluster,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();
}
Parameter | |
---|---|
Name | Description |
request |
RescheduleClusterMaintenanceRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Cluster,Any> |
rescheduleClusterMaintenanceAsync(String name, RescheduleClusterMaintenanceRequest.RescheduleType rescheduleType, Timestamp scheduleTime)
public final OperationFuture<Cluster,Any> rescheduleClusterMaintenanceAsync(String name, RescheduleClusterMaintenanceRequest.RescheduleType rescheduleType, 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 | Description |
name |
String Required. Redis Cluster instance resource name using the form:
|
rescheduleType |
RescheduleClusterMaintenanceRequest.RescheduleType Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. |
scheduleTime |
Timestamp Optional. Timestamp when the maintenance shall be rescheduled to if
reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example |
Returns | |
---|---|
Type | Description |
OperationFuture<Cluster,Any> |
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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<RescheduleClusterMaintenanceRequest,Operation> |
rescheduleClusterMaintenanceOperationCallable()
public final OperationCallable<RescheduleClusterMaintenanceRequest,Cluster,Any> rescheduleClusterMaintenanceOperationCallable()
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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<RescheduleClusterMaintenanceRequest,Cluster,Any> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
updateClusterAsync(Cluster cluster, FieldMask updateMask)
public final OperationFuture<Cluster,Any> updateClusterAsync(Cluster cluster, 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 | |
---|---|
Name | Description |
cluster |
Cluster Required. Update description. Only fields specified in update_mask are updated. |
updateMask |
FieldMask 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: * |
Returns | |
---|---|
Type | Description |
OperationFuture<Cluster,Any> |
updateClusterAsync(UpdateClusterRequest request)
public final OperationFuture<Cluster,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();
}
Parameter | |
---|---|
Name | Description |
request |
UpdateClusterRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Cluster,Any> |
updateClusterCallable()
public final UnaryCallable<UpdateClusterRequest,Operation> 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<UpdateClusterRequest,Operation> |
updateClusterOperationCallable()
public final OperationCallable<UpdateClusterRequest,Cluster,Any> updateClusterOperationCallable()
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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<UpdateClusterRequest,Cluster,Any> |