Reference documentation and code samples for the Google Cloud Memorystore for Redis V1 API class Google::Cloud::Redis::V1::CloudRedis::Rest::Client.
REST client for the CloudRedis service.
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
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the CloudRedis Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all CloudRedis clients ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the CloudRedis Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_instance
def create_instance(request, options = nil) -> ::Gapic::Operation
def create_instance(parent: nil, instance_id: nil, instance: nil) -> ::Gapic::Operation
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.
def create_instance(request, options = nil) -> ::Gapic::Operation
create_instance
via a request object, either of type
Google::Cloud::Redis::V1::CreateInstanceRequest or an equivalent Hash.
- request (::Google::Cloud::Redis::V1::CreateInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_instance(parent: nil, instance_id: nil, instance: nil) -> ::Gapic::Operation
create_instance
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the instance location using the form:
projects/{project_id}/locations/{location_id}
wherelocation_id
refers to a GCP region. -
instance_id (::String) —
Required. The logical name of the Redis instance in the customer project with the following restrictions:
- Must contain only lowercase letters, numbers, and hyphens.
- Must start with a letter.
- Must be between 1-40 characters.
- Must end with a number or a letter.
- Must be unique within the customer project / location
- instance (::Google::Cloud::Redis::V1::Instance, ::Hash) — Required. A Redis [Instance] resource
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#delete_instance
def delete_instance(request, options = nil) -> ::Gapic::Operation
def delete_instance(name: nil) -> ::Gapic::Operation
Deletes a specific Redis instance. Instance stops serving and data is deleted.
def delete_instance(request, options = nil) -> ::Gapic::Operation
delete_instance
via a request object, either of type
DeleteInstanceRequest or an equivalent Hash.
- request (::Google::Cloud::Redis::V1::DeleteInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_instance(name: nil) -> ::Gapic::Operation
delete_instance
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Redis instance resource name using the form:
projects/{project_id}/locations/{location_id}/instances/{instance_id}
wherelocation_id
refers to a GCP region.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#export_instance
def export_instance(request, options = nil) -> ::Gapic::Operation
def export_instance(name: nil, output_config: nil) -> ::Gapic::Operation
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.
def export_instance(request, options = nil) -> ::Gapic::Operation
export_instance
via a request object, either of type
ExportInstanceRequest or an equivalent Hash.
- request (::Google::Cloud::Redis::V1::ExportInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def export_instance(name: nil, output_config: nil) -> ::Gapic::Operation
export_instance
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Redis instance resource name using the form:
projects/{project_id}/locations/{location_id}/instances/{instance_id}
wherelocation_id
refers to a GCP region. - output_config (::Google::Cloud::Redis::V1::OutputConfig, ::Hash) — Required. Specify data to be exported.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#failover_instance
def failover_instance(request, options = nil) -> ::Gapic::Operation
def failover_instance(name: nil, data_protection_mode: nil) -> ::Gapic::Operation
Initiates a failover of the primary node to current replica node for a specific STANDARD tier Cloud Memorystore for Redis instance.
def failover_instance(request, options = nil) -> ::Gapic::Operation
failover_instance
via a request object, either of type
FailoverInstanceRequest or an equivalent Hash.
- request (::Google::Cloud::Redis::V1::FailoverInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def failover_instance(name: nil, data_protection_mode: nil) -> ::Gapic::Operation
failover_instance
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Redis instance resource name using the form:
projects/{project_id}/locations/{location_id}/instances/{instance_id}
wherelocation_id
refers to a GCP region. - data_protection_mode (::Google::Cloud::Redis::V1::FailoverInstanceRequest::DataProtectionMode) — Optional. Available data protection modes that the user can choose. If it's unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#get_instance
def get_instance(request, options = nil) -> ::Google::Cloud::Redis::V1::Instance
def get_instance(name: nil) -> ::Google::Cloud::Redis::V1::Instance
Gets the details of a specific Redis instance.
def get_instance(request, options = nil) -> ::Google::Cloud::Redis::V1::Instance
get_instance
via a request object, either of type
GetInstanceRequest or an equivalent Hash.
- request (::Google::Cloud::Redis::V1::GetInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_instance(name: nil) -> ::Google::Cloud::Redis::V1::Instance
get_instance
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Redis instance resource name using the form:
projects/{project_id}/locations/{location_id}/instances/{instance_id}
wherelocation_id
refers to a GCP region.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Redis::V1::Instance)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#get_instance_auth_string
def get_instance_auth_string(request, options = nil) -> ::Google::Cloud::Redis::V1::InstanceAuthString
def get_instance_auth_string(name: nil) -> ::Google::Cloud::Redis::V1::InstanceAuthString
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.
def get_instance_auth_string(request, options = nil) -> ::Google::Cloud::Redis::V1::InstanceAuthString
get_instance_auth_string
via a request object, either of type
GetInstanceAuthStringRequest or an equivalent Hash.
- request (::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_instance_auth_string(name: nil) -> ::Google::Cloud::Redis::V1::InstanceAuthString
get_instance_auth_string
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Redis instance resource name using the form:
projects/{project_id}/locations/{location_id}/instances/{instance_id}
wherelocation_id
refers to a GCP region.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Redis::V1::InstanceAuthString)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#import_instance
def import_instance(request, options = nil) -> ::Gapic::Operation
def import_instance(name: nil, input_config: nil) -> ::Gapic::Operation
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.
def import_instance(request, options = nil) -> ::Gapic::Operation
import_instance
via a request object, either of type
ImportInstanceRequest or an equivalent Hash.
- request (::Google::Cloud::Redis::V1::ImportInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def import_instance(name: nil, input_config: nil) -> ::Gapic::Operation
import_instance
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Redis instance resource name using the form:
projects/{project_id}/locations/{location_id}/instances/{instance_id}
wherelocation_id
refers to a GCP region. - input_config (::Google::Cloud::Redis::V1::InputConfig, ::Hash) — Required. Specify data to be imported.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#initialize
def initialize() { |config| ... } -> Client
Create a new CloudRedis REST client object.
- (config) — Configure the CloudRedis client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| config.timeout = 10.0 end
#list_instances
def list_instances(request, options = nil) -> ::Google::Cloud::Redis::V1::ListInstancesResponse
def list_instances(parent: nil, page_size: nil, page_token: nil) -> ::Google::Cloud::Redis::V1::ListInstancesResponse
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.
def list_instances(request, options = nil) -> ::Google::Cloud::Redis::V1::ListInstancesResponse
list_instances
via a request object, either of type
ListInstancesRequest or an equivalent Hash.
- request (::Google::Cloud::Redis::V1::ListInstancesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_instances(parent: nil, page_size: nil, page_token: nil) -> ::Google::Cloud::Redis::V1::ListInstancesResponse
list_instances
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the instance location using the form:
projects/{project_id}/locations/{location_id}
wherelocation_id
refers to a GCP region. -
page_size (::Integer) — The maximum number of items to return.
If not specified, a default value of 1000 will be used by the service. Regardless of the page_size value, the response may include a partial list and a caller should only rely on response's
next_page_token
to determine if there are more instances left to be queried. -
page_token (::String) — The
next_page_token
value returned from a previous ListInstances request, if any.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Redis::V1::ListInstancesResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#location_client
def location_client() -> Google::Cloud::Location::Locations::Rest::Client
Get the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#operations_client
def operations_client() -> ::Google::Cloud::Redis::V1::CloudRedis::Rest::Operations
Get the associated client for long-running operations.
#reschedule_maintenance
def reschedule_maintenance(request, options = nil) -> ::Gapic::Operation
def reschedule_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) -> ::Gapic::Operation
Reschedule maintenance for a given instance in a given project and location.
def reschedule_maintenance(request, options = nil) -> ::Gapic::Operation
reschedule_maintenance
via a request object, either of type
RescheduleMaintenanceRequest or an equivalent Hash.
- request (::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def reschedule_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) -> ::Gapic::Operation
reschedule_maintenance
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Redis instance resource name using the form:
projects/{project_id}/locations/{location_id}/instances/{instance_id}
wherelocation_id
refers to a GCP region. - reschedule_type (::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest::RescheduleType) — Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well.
-
schedule_time (::Google::Protobuf::Timestamp, ::Hash) — Optional. Timestamp when the maintenance shall be rescheduled to if
reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for
example
2012-11-15T16:19:00.094Z
.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#update_instance
def update_instance(request, options = nil) -> ::Gapic::Operation
def update_instance(update_mask: nil, instance: nil) -> ::Gapic::Operation
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.
def update_instance(request, options = nil) -> ::Gapic::Operation
update_instance
via a request object, either of type
UpdateInstanceRequest or an equivalent Hash.
- request (::Google::Cloud::Redis::V1::UpdateInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_instance(update_mask: nil, instance: nil) -> ::Gapic::Operation
update_instance
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) —
Required. Mask of fields to update. At least one path must be supplied in this field. The elements of the repeated paths field may only include these fields from Instance:
-
displayName
-
labels
-
memorySizeGb
-
redisConfig
-
replica_count
-
- instance (::Google::Cloud::Redis::V1::Instance, ::Hash) — Required. Update description. Only fields specified in update_mask are updated.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#upgrade_instance
def upgrade_instance(request, options = nil) -> ::Gapic::Operation
def upgrade_instance(name: nil, redis_version: nil) -> ::Gapic::Operation
Upgrades Redis instance to the newer Redis version specified in the request.
def upgrade_instance(request, options = nil) -> ::Gapic::Operation
upgrade_instance
via a request object, either of type
UpgradeInstanceRequest or an equivalent Hash.
- request (::Google::Cloud::Redis::V1::UpgradeInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def upgrade_instance(name: nil, redis_version: nil) -> ::Gapic::Operation
upgrade_instance
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Redis instance resource name using the form:
projects/{project_id}/locations/{location_id}/instances/{instance_id}
wherelocation_id
refers to a GCP region. - redis_version (::String) — Required. Specifies the target version of Redis software to upgrade to.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.