Constructor
new CloudRedisClient(optionsopt)
Construct an instance of CloudRedisClient.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
The configuration object. See the subsequent parameters for more details. Properties
|
- Source:
Members
(static) apiEndpoint
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
- Source:
(static) port
The port for this API service.
- Source:
(static) scopes
The scopes needed to make gRPC calls for every method defined in this service.
- Source:
(static) servicePath
The DNS address for this API service.
- Source:
Methods
close()
Terminate the GRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
- Source:
createInstance(request, optionsopt) → {Promise}
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.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
- Source:
deleteInstance(request, optionsopt) → {Promise}
Deletes a specific Redis instance. Instance stops serving and data is deleted.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
- Source:
exportInstance(request, optionsopt) → {Promise}
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.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
- Source:
failoverInstance(request, optionsopt) → {Promise}
Initiates a failover of the master node to current replica node for a specific STANDARD tier Cloud Memorystore for Redis instance.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
- Source:
getInstance(request, optionsopt) → {Promise}
Gets the details of a specific Redis instance.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
- Source:
getProjectId(callback)
Return the project ID used by this class.
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
the callback to be called with the current project Id. |
- Source:
importInstance(request, optionsopt) → {Promise}
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.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
- Source:
instancePath(project, location, instance) → {string}
Return a fully-qualified instance resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
project |
string | |
location |
string | |
instance |
string |
- Source:
listInstances(request, optionsopt) → {Promise}
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.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
- Source:
listInstancesStream(request, optionsopt) → {Stream}
Equivalent to listInstances, but returns a NodeJS Stream object.
This fetches the paged responses for listInstances continuously and invokes the callback registered for 'data' event for each element in the responses.
The returned object has 'end' method when no more elements are required.
autoPaginate option will be ignored.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
locationPath(project, location) → {string}
Return a fully-qualified location resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
project |
string | |
location |
string |
- Source:
matchInstanceFromInstanceName(instanceName) → {string}
Parse the instance from Instance resource.
Parameters:
| Name | Type | Description |
|---|---|---|
instanceName |
string |
A fully-qualified path representing Instance resource. |
- Source:
matchLocationFromInstanceName(instanceName) → {string}
Parse the location from Instance resource.
Parameters:
| Name | Type | Description |
|---|---|---|
instanceName |
string |
A fully-qualified path representing Instance resource. |
- Source:
matchLocationFromLocationName(locationName) → {string}
Parse the location from Location resource.
Parameters:
| Name | Type | Description |
|---|---|---|
locationName |
string |
A fully-qualified path representing Location resource. |
- Source:
matchProjectFromInstanceName(instanceName) → {string}
Parse the project from Instance resource.
Parameters:
| Name | Type | Description |
|---|---|---|
instanceName |
string |
A fully-qualified path representing Instance resource. |
- Source:
matchProjectFromLocationName(locationName) → {string}
Parse the project from Location resource.
Parameters:
| Name | Type | Description |
|---|---|---|
locationName |
string |
A fully-qualified path representing Location resource. |
- Source:
updateInstance(request, optionsopt) → {Promise}
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.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
- Source: