Google Cloud Memorystore for Redis V1BETA1 API - Class Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client (v0.3.0)

Reference documentation and code samples for the Google Cloud Memorystore for Redis V1BETA1 API class Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.

REST client for the CloudRedisCluster service.

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

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the CloudRedisCluster Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all CloudRedisCluster clients
::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#backup_cluster

def backup_cluster(request, options = nil) -> ::Gapic::Operation
def backup_cluster(name: nil, ttl: nil, backup_id: nil) -> ::Gapic::Operation

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.

Overloads
def backup_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to backup_cluster via a request object, either of type BackupClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest, ::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 backup_cluster(name: nil, ttl: nil, backup_id: nil) -> ::Gapic::Operation
Pass arguments to backup_cluster 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).
Parameters
  • name (::String) — Required. Redis cluster resource name using the form: projects/{project_id}/locations/{location_id}/clusters/{cluster_id} where location_id refers to a GCP region.
  • ttl (::Google::Protobuf::Duration, ::Hash) — Optional. TTL for the backup to expire. Value range is 1 day to 100 years. If not specified, the default value is 100 years.
  • backup_id (::String) — Optional. The id of the backup to be created. If not specified, the default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/redis/cluster/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new

# Call the backup_cluster method.
result = client.backup_cluster request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the CloudRedisCluster 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.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_cluster

def create_cluster(request, options = nil) -> ::Gapic::Operation
def create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) -> ::Gapic::Operation

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.

Overloads
def create_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_cluster via a request object, either of type Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest, ::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_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to create_cluster 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).
Parameters
  • parent (::String) — Required. The resource name of the cluster location using the form: projects/{project_id}/locations/{location_id} where location_id refers to a GCP region.
  • cluster_id (::String) —

    Required. The logical name of the Redis cluster in the customer project with the following restrictions:

    • Must contain only lowercase letters, numbers, and hyphens.
    • Must start with a letter.
    • Must be between 1-63 characters.
    • Must end with a number or a letter.
    • Must be unique within the customer project / location
  • cluster (::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash) — Required. The cluster that is to be created.
  • request_id (::String) — Idempotent request UUID.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/redis/cluster/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new

# Call the create_cluster method.
result = client.create_cluster request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_backup

def delete_backup(request, options = nil) -> ::Gapic::Operation
def delete_backup(name: nil, request_id: nil) -> ::Gapic::Operation

Deletes a specific backup.

Overloads
def delete_backup(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_backup via a request object, either of type DeleteBackupRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest, ::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_backup(name: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to delete_backup 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).
Parameters
  • name (::String) — Required. Redis backup resource name using the form: projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}
  • request_id (::String) — Optional. Idempotent request UUID.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/redis/cluster/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new

# Call the delete_backup method.
result = client.delete_backup request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_cluster

def delete_cluster(request, options = nil) -> ::Gapic::Operation
def delete_cluster(name: nil, request_id: nil) -> ::Gapic::Operation

Deletes a specific Redis cluster. Cluster stops serving and data is deleted.

Overloads
def delete_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_cluster via a request object, either of type DeleteClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest, ::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_cluster(name: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to delete_cluster 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).
Parameters
  • name (::String) — Required. Redis cluster resource name using the form: projects/{project_id}/locations/{location_id}/clusters/{cluster_id} where location_id refers to a GCP region.
  • request_id (::String) — Idempotent request UUID.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/redis/cluster/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new

# Call the delete_cluster method.
result = client.delete_cluster request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#export_backup

def export_backup(request, options = nil) -> ::Gapic::Operation
def export_backup(gcs_bucket: nil, name: nil) -> ::Gapic::Operation

Exports a specific backup to a customer target Cloud Storage URI.

Overloads
def export_backup(request, options = nil) -> ::Gapic::Operation
Pass arguments to export_backup via a request object, either of type ExportBackupRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest, ::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_backup(gcs_bucket: nil, name: nil) -> ::Gapic::Operation
Pass arguments to export_backup 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).
Parameters
  • gcs_bucket (::String) — Google Cloud Storage bucket, like "my-bucket".
  • name (::String) — Required. Redis backup resource name using the form: projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/redis/cluster/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new

# Call the export_backup method.
result = client.export_backup request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#get_backup

def get_backup(request, options = nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::Backup
def get_backup(name: nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::Backup

Gets the details of a specific backup.

Overloads
def get_backup(request, options = nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::Backup
Pass arguments to get_backup via a request object, either of type GetBackupRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest, ::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_backup(name: nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::Backup
Pass arguments to get_backup 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).
Parameter
  • name (::String) — Required. Redis backup resource name using the form: projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/redis/cluster/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new

# Call the get_backup method.
result = client.get_backup request

# The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Backup.
p result

#get_backup_collection

def get_backup_collection(request, options = nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection
def get_backup_collection(name: nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection

Get a backup collection.

Overloads
def get_backup_collection(request, options = nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection
Pass arguments to get_backup_collection via a request object, either of type GetBackupCollectionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest, ::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_backup_collection(name: nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection
Pass arguments to get_backup_collection 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).
Parameter
  • name (::String) — Required. Redis backupCollection resource name using the form: projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id} where location_id refers to a GCP region.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/redis/cluster/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new

# Call the get_backup_collection method.
result = client.get_backup_collection request

# The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::BackupCollection.
p result

#get_cluster

def get_cluster(request, options = nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::Cluster
def get_cluster(name: nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::Cluster

Gets the details of a specific Redis cluster.

Overloads
def get_cluster(request, options = nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::Cluster
Pass arguments to get_cluster via a request object, either of type GetClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest, ::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_cluster(name: nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::Cluster
Pass arguments to get_cluster 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).
Parameter
  • name (::String) — Required. Redis cluster resource name using the form: projects/{project_id}/locations/{location_id}/clusters/{cluster_id} where location_id refers to a GCP region.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/redis/cluster/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new

# Call the get_cluster method.
result = client.get_cluster request

# The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Cluster.
p result

#get_cluster_certificate_authority

def get_cluster_certificate_authority(request, options = nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority
def get_cluster_certificate_authority(name: nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority

Gets the details of certificate authority information for Redis cluster.

Overloads
def get_cluster_certificate_authority(request, options = nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority
Pass arguments to get_cluster_certificate_authority via a request object, either of type GetClusterCertificateAuthorityRequest or an equivalent Hash.
Parameters
def get_cluster_certificate_authority(name: nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority
Pass arguments to get_cluster_certificate_authority 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).
Parameter
  • name (::String) — Required. Redis cluster certificate authority resource name using the form: projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority where location_id refers to a GCP region.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/redis/cluster/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new

# Call the get_cluster_certificate_authority method.
result = client.get_cluster_certificate_authority request

# The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new CloudRedisCluster REST client object.

Yields
  • (config) — Configure the CloudRedisCluster client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config|
  config.timeout = 10.0
end

#list_backup_collections

def list_backup_collections(request, options = nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse
def list_backup_collections(parent: nil, page_size: nil, page_token: nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse

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.

Overloads
def list_backup_collections(request, options = nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse
Pass arguments to list_backup_collections via a request object, either of type ListBackupCollectionsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest, ::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_backup_collections(parent: nil, page_size: nil, page_token: nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse
Pass arguments to list_backup_collections 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).
Parameters
  • parent (::String) — Required. The resource name of the backupCollection location using the form: projects/{project_id}/locations/{location_id} where location_id refers to a GCP region.
  • page_size (::Integer) — Optional. 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 clusters left to be queried.

  • page_token (::String) — Optional. The next_page_token value returned from a previous [ListBackupCollections] request, if any.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/redis/cluster/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new

# Call the list_backup_collections method.
result = client.list_backup_collections request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection.
  p item
end

#list_backups

def list_backups(request, options = nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse
def list_backups(parent: nil, page_size: nil, page_token: nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse

Lists all backups owned by a backup collection.

Overloads
def list_backups(request, options = nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse
Pass arguments to list_backups via a request object, either of type ListBackupsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest, ::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_backups(parent: nil, page_size: nil, page_token: nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse
Pass arguments to list_backups 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).
Parameters
  • parent (::String) — Required. The resource name of the backupCollection using the form: projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}
  • page_size (::Integer) — Optional. 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 clusters left to be queried.

  • page_token (::String) — Optional. The next_page_token value returned from a previous [ListBackupCollections] request, if any.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/redis/cluster/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new

# Call the list_backups method.
result = client.list_backups request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Backup.
  p item
end

#list_clusters

def list_clusters(request, options = nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse
def list_clusters(parent: nil, page_size: nil, page_token: nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse

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.

Overloads
def list_clusters(request, options = nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse
Pass arguments to list_clusters via a request object, either of type ListClustersRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest, ::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_clusters(parent: nil, page_size: nil, page_token: nil) -> ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse
Pass arguments to list_clusters 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).
Parameters
  • parent (::String) — Required. The resource name of the cluster location using the form: projects/{project_id}/locations/{location_id} where location_id refers to a GCP region.
  • 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 clusters left to be queried.

  • page_token (::String) — The next_page_token value returned from a previous [ListClusters][CloudRedis.ListClusters] request, if any.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/redis/cluster/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new

# Call the list_clusters method.
result = client.list_clusters request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Cluster.
  p item
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Rest::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Rest::Client)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#operations_client

def operations_client() -> ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Operations

Get the associated client for long-running operations.

#reschedule_cluster_maintenance

def reschedule_cluster_maintenance(request, options = nil) -> ::Gapic::Operation
def reschedule_cluster_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) -> ::Gapic::Operation

Reschedules upcoming maintenance event.

Overloads
def reschedule_cluster_maintenance(request, options = nil) -> ::Gapic::Operation
Pass arguments to reschedule_cluster_maintenance via a request object, either of type RescheduleClusterMaintenanceRequest or an equivalent Hash.
Parameters
def reschedule_cluster_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) -> ::Gapic::Operation
Pass arguments to reschedule_cluster_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).
Parameters
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/redis/cluster/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new

# Call the reschedule_cluster_maintenance method.
result = client.reschedule_cluster_maintenance request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_cluster

def update_cluster(request, options = nil) -> ::Gapic::Operation
def update_cluster(update_mask: nil, cluster: nil, request_id: nil) -> ::Gapic::Operation

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.

Overloads
def update_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_cluster via a request object, either of type UpdateClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest, ::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_cluster(update_mask: nil, cluster: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to update_cluster 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).
Parameters
  • 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 Cluster:

    • size_gb
    • replica_count
  • cluster (::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash) — Required. Update description. Only fields specified in update_mask are updated.
  • request_id (::String) — Idempotent request UUID.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/redis/cluster/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new

# Call the update_cluster method.
result = client.update_cluster request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end