Memorystore V1 API - Class Google::Cloud::Memorystore::V1::Memorystore::Rest::Client (v1.2.0)

Reference documentation and code samples for the Memorystore V1 API class Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.

REST client for the Memorystore service.

Service describing handlers for resources

Inherits

  • Object

Methods

.configure

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

Configure the Memorystore 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 Memorystore clients
::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#backup_instance

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

Backup Instance. 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 instance'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_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to backup_instance via a request object, either of type BackupInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Memorystore::V1::BackupInstanceRequest, ::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_instance(name: nil, ttl: nil, backup_id: nil) -> ::Gapic::Operation
Pass arguments to backup_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).
Parameters
  • name (::String) — Required. Instance resource name using the form: projects/{project_id}/locations/{location_id}/instances/{instance_id} where location_id refers to a Google Cloud 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 Instance 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/memorystore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Memorystore::V1::BackupInstanceRequest.new

# Call the backup_instance method.
result = client.backup_instance 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 Memorystore 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_instance

def create_instance(request, options = nil) -> ::Gapic::Operation
def create_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil) -> ::Gapic::Operation

Creates a new Instance in a given project and location.

Overloads
def create_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_instance via a request object, either of type CreateInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Memorystore::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, request_id: nil) -> ::Gapic::Operation
Pass arguments to 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).
Parameters
  • parent (::String) — Required. The parent resource where this instance will be created. Format: projects/{project}/locations/{location}
  • instance_id (::String) —

    Required. The ID to use for the instance, which will become the final component of the instance's resource name.

    This value is subject to the following restrictions:

    • Must be 4-63 characters in length
    • Must begin with a letter or digit
    • Must contain only lowercase letters, digits, and hyphens
    • Must not end with a hyphen
    • Must be unique within a location
  • instance (::Google::Cloud::Memorystore::V1::Instance, ::Hash) — Required. The instance to create.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

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/memorystore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Memorystore::V1::CreateInstanceRequest.new

# Call the create_instance method.
result = client.create_instance 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::Memorystore::V1::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. Instance 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/memorystore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Memorystore::V1::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_instance

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

Deletes a single Instance.

Overloads
def delete_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_instance via a request object, either of type DeleteInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Memorystore::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, request_id: nil) -> ::Gapic::Operation
Pass arguments to 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).
Parameters
  • name (::String) — Required. The name of the instance to delete. Format: projects/{project}/locations/{location}/instances/{instance}
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

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/memorystore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Memorystore::V1::DeleteInstanceRequest.new

# Call the delete_instance method.
result = client.delete_instance 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::Memorystore::V1::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. Instance 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/memorystore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Memorystore::V1::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::Memorystore::V1::Backup
def get_backup(name: nil) -> ::Google::Cloud::Memorystore::V1::Backup

Gets the details of a specific backup.

Overloads
def get_backup(request, options = nil) -> ::Google::Cloud::Memorystore::V1::Backup
Pass arguments to get_backup via a request object, either of type GetBackupRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Memorystore::V1::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::Memorystore::V1::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. Instance 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/memorystore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Memorystore::V1::GetBackupRequest.new

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

# The returned object is of type Google::Cloud::Memorystore::V1::Backup.
p result

#get_backup_collection

def get_backup_collection(request, options = nil) -> ::Google::Cloud::Memorystore::V1::BackupCollection
def get_backup_collection(name: nil) -> ::Google::Cloud::Memorystore::V1::BackupCollection

Get a backup collection.

Overloads
def get_backup_collection(request, options = nil) -> ::Google::Cloud::Memorystore::V1::BackupCollection
Pass arguments to get_backup_collection via a request object, either of type GetBackupCollectionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Memorystore::V1::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::Memorystore::V1::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. Instance backupCollection resource name using the form: projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id} where location_id refers to a Google Cloud 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/memorystore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Memorystore::V1::GetBackupCollectionRequest.new

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

# The returned object is of type Google::Cloud::Memorystore::V1::BackupCollection.
p result

#get_certificate_authority

def get_certificate_authority(request, options = nil) -> ::Google::Cloud::Memorystore::V1::CertificateAuthority
def get_certificate_authority(name: nil) -> ::Google::Cloud::Memorystore::V1::CertificateAuthority

Gets details about the certificate authority for an Instance.

Overloads
def get_certificate_authority(request, options = nil) -> ::Google::Cloud::Memorystore::V1::CertificateAuthority
Pass arguments to get_certificate_authority via a request object, either of type GetCertificateAuthorityRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Memorystore::V1::GetCertificateAuthorityRequest, ::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_certificate_authority(name: nil) -> ::Google::Cloud::Memorystore::V1::CertificateAuthority
Pass arguments to get_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. The name of the certificate authority. Format: projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
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/memorystore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Memorystore::V1::GetCertificateAuthorityRequest.new

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

# The returned object is of type Google::Cloud::Memorystore::V1::CertificateAuthority.
p result

#get_instance

def get_instance(request, options = nil) -> ::Google::Cloud::Memorystore::V1::Instance
def get_instance(name: nil) -> ::Google::Cloud::Memorystore::V1::Instance

Gets details of a single Instance.

Overloads
def get_instance(request, options = nil) -> ::Google::Cloud::Memorystore::V1::Instance
Pass arguments to get_instance via a request object, either of type GetInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Memorystore::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::Memorystore::V1::Instance
Pass arguments to 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).
Parameter
  • name (::String) — Required. The name of the instance to retrieve. Format: projects/{project}/locations/{location}/instances/{instance}
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/memorystore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Memorystore::V1::GetInstanceRequest.new

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

# The returned object is of type Google::Cloud::Memorystore::V1::Instance.
p result

#initialize

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

Create a new Memorystore REST client object.

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

# Create a client using a custom configuration
client = ::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new do |config|
  config.timeout = 10.0
end

#list_backup_collections

def list_backup_collections(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::BackupCollection>
def list_backup_collections(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::BackupCollection>

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) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::BackupCollection>
Pass arguments to list_backup_collections via a request object, either of type ListBackupCollectionsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Memorystore::V1::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) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::BackupCollection>
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 Google Cloud 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
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/memorystore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Memorystore::V1::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::Memorystore::V1::BackupCollection.
  p item
end

#list_backups

def list_backups(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::Backup>
def list_backups(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::Backup>

Lists all backups owned by a backup collection.

Overloads
def list_backups(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::Backup>
Pass arguments to list_backups via a request object, either of type ListBackupsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Memorystore::V1::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) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::Backup>
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
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/memorystore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Memorystore::V1::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::Memorystore::V1::Backup.
  p item
end

#list_instances

def list_instances(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::Instance>
def list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::Instance>

Lists Instances in a given project and location.

Overloads
def list_instances(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::Instance>
Pass arguments to list_instances via a request object, either of type ListInstancesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Memorystore::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, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::Instance>
Pass arguments to 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).
Parameters
  • parent (::String) — Required. The parent to list instances from. Format: projects/{project}/locations/{location}
  • page_size (::Integer) — Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.
  • page_token (::String) — Optional. A token identifying a page of results the server should return.
  • filter (::String) — Optional. Expression for filtering results.
  • order_by (::String) — Optional. Sort results by a defined order. Supported values: "name", "create_time".
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/memorystore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Memorystore::V1::ListInstancesRequest.new

# Call the list_instances method.
result = client.list_instances 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::Memorystore::V1::Instance.
  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::Memorystore::V1::Memorystore::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

Reschedules upcoming maintenance event.

Overloads
def reschedule_maintenance(request, options = nil) -> ::Gapic::Operation
Pass arguments to reschedule_maintenance via a request object, either of type RescheduleMaintenanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Memorystore::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
Pass arguments to 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).
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/memorystore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest.new

# Call the reschedule_maintenance method.
result = client.reschedule_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_instance

def update_instance(request, options = nil) -> ::Gapic::Operation
def update_instance(update_mask: nil, instance: nil, request_id: nil) -> ::Gapic::Operation

Updates the parameters of a single Instance.

Overloads
def update_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_instance via a request object, either of type UpdateInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Memorystore::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, request_id: nil) -> ::Gapic::Operation
Pass arguments to 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).
Parameters
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. The list of fields to be updated on the instance. At least one field must be specified.
  • instance (::Google::Cloud::Memorystore::V1::Instance, ::Hash) — Required. The instance to update.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

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/memorystore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Memorystore::V1::UpdateInstanceRequest.new

# Call the update_instance method.
result = client.update_instance 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