pub struct CloudRedis { /* private fields */ }Expand description
Implements a client for the Google Cloud Memorystore for Redis API.
§Example
let client = CloudRedis::builder().build().await?;
// use `client` to make requests to the Google Cloud Memorystore for Redis API.§Service Description
Configures and manages Cloud Memorystore for Redis instances
Google Cloud Memorystore for Redis v1
The redis.googleapis.com service implements the Google Cloud Memorystore
for Redis API and defines the following resource model for managing Redis
instances:
- 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 instances, named:
/instances/* - As such, Redis instances are resources of the form:
/projects/{project_id}/locations/{location_id}/instances/{instance_id}
Note that location_id must be referring to a GCP region; for example:
projects/redpepper-1290/locations/us-central1/instances/my-redis
§Configuration
To configure CloudRedis use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://redis.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
CloudRedis holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap CloudRedis in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl CloudRedis
impl CloudRedis
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for CloudRedis.
let client = CloudRedis::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: CloudRedis + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: CloudRedis + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn list_instances(&self) -> ListInstances
pub fn list_instances(&self) -> ListInstances
Lists all Redis instances 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.
Sourcepub fn get_instance(&self) -> GetInstance
pub fn get_instance(&self) -> GetInstance
Gets the details of a specific Redis instance.
Sourcepub fn get_instance_auth_string(&self) -> GetInstanceAuthString
pub fn get_instance_auth_string(&self) -> GetInstanceAuthString
Gets the AUTH string for a Redis instance. If AUTH is not enabled for the instance the response will be empty. This information is not included in the details returned to GetInstance.
Sourcepub fn create_instance(&self) -> CreateInstance
pub fn create_instance(&self) -> CreateInstance
Creates a Redis instance based on the specified tier and memory size.
By default, the instance is accessible from the project’s default network.
The creation is executed asynchronously and callers may check the returned operation to track its progress. Once the operation is completed the Redis instance will be fully functional. Completed longrunning.Operation will contain the new instance object in the response field.
The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn update_instance(&self) -> UpdateInstance
pub fn update_instance(&self) -> UpdateInstance
Updates the metadata and configuration of a specific Redis instance.
Completed longrunning.Operation will contain the new instance object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn upgrade_instance(&self) -> UpgradeInstance
pub fn upgrade_instance(&self) -> UpgradeInstance
Upgrades Redis instance to the newer Redis version specified in the request.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn import_instance(&self) -> ImportInstance
pub fn import_instance(&self) -> ImportInstance
Import a Redis RDB snapshot file from Cloud Storage into a Redis instance.
Redis may stop serving during this operation. Instance state will be IMPORTING for entire operation. When complete, the instance will contain only data from the imported file.
The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn export_instance(&self) -> ExportInstance
pub fn export_instance(&self) -> ExportInstance
Export Redis instance data into a Redis RDB format file in Cloud Storage.
Redis will continue serving during this operation.
The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn failover_instance(&self) -> FailoverInstance
pub fn failover_instance(&self) -> FailoverInstance
Initiates a failover of the primary node to current replica node for a specific STANDARD tier Cloud Memorystore for Redis instance.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn delete_instance(&self) -> DeleteInstance
pub fn delete_instance(&self) -> DeleteInstance
Deletes a specific Redis instance. Instance stops serving and data is deleted.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn reschedule_maintenance(&self) -> RescheduleMaintenance
pub fn reschedule_maintenance(&self) -> RescheduleMaintenance
Reschedule maintenance for a given instance in a given project and location.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn list_locations(&self) -> ListLocations
pub fn list_locations(&self) -> ListLocations
Lists information about the supported locations for this service.
Sourcepub fn get_location(&self) -> GetLocation
pub fn get_location(&self) -> GetLocation
Gets information about a location.
Sourcepub fn list_operations(&self) -> ListOperations
pub fn list_operations(&self) -> ListOperations
Provides the Operations service functionality in this service.
Sourcepub fn get_operation(&self) -> GetOperation
pub fn get_operation(&self) -> GetOperation
Provides the Operations service functionality in this service.
Sourcepub fn delete_operation(&self) -> DeleteOperation
pub fn delete_operation(&self) -> DeleteOperation
Provides the Operations service functionality in this service.
Sourcepub fn cancel_operation(&self) -> CancelOperation
pub fn cancel_operation(&self) -> CancelOperation
Provides the Operations service functionality in this service.
Trait Implementations§
Source§impl Clone for CloudRedis
impl Clone for CloudRedis
Source§fn clone(&self) -> CloudRedis
fn clone(&self) -> CloudRedis
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more