Cloud SQL Admin V1 API - Class Google::Cloud::Sql::V1::SqlBackupRunsService::Rest::Client (v0.1.0)

Reference documentation and code samples for the Cloud SQL Admin V1 API class Google::Cloud::Sql::V1::SqlBackupRunsService::Rest::Client.

REST client for the SqlBackupRunsService service.

Service for managing database backups.

Inherits

  • Object

Methods

.configure

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

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

#configure

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

Configure the SqlBackupRunsService 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

#delete

def delete(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
def delete(id: nil, instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::Operation

Deletes the backup taken by a backup run.

Overloads
def delete(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to delete via a request object, either of type Google::Cloud::Sql::V1::SqlBackupRunsDeleteRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlBackupRunsDeleteRequest, ::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(id: nil, instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to delete 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
  • id (::Integer) — The ID of the backup run to delete. To find a backup run ID, use the list method.
  • instance (::String) — Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — Project ID of the project that contains the 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/sql/v1"

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

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

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

# The returned object is of type Google::Cloud::Sql::V1::Operation.
p result

#get

def get(request, options = nil) -> ::Google::Cloud::Sql::V1::BackupRun
def get(id: nil, instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::BackupRun

Retrieves a resource containing information about a backup run.

Overloads
def get(request, options = nil) -> ::Google::Cloud::Sql::V1::BackupRun
Pass arguments to get via a request object, either of type Google::Cloud::Sql::V1::SqlBackupRunsGetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlBackupRunsGetRequest, ::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(id: nil, instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::BackupRun
Pass arguments to get 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
  • id (::Integer) — The ID of this backup run.
  • instance (::String) — Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — Project ID of the project that contains the 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/sql/v1"

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

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

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

# The returned object is of type Google::Cloud::Sql::V1::BackupRun.
p result

#initialize

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

Create a new SqlBackupRunsService REST client object.

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

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

#insert

def insert(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
def insert(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation

Creates a new backup run on demand.

Overloads
def insert(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to insert via a request object, either of type Google::Cloud::Sql::V1::SqlBackupRunsInsertRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlBackupRunsInsertRequest, ::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 insert(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to insert 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
  • instance (::String) — Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — Project ID of the project that contains the instance.
  • body (::Google::Cloud::Sql::V1::BackupRun, ::Hash)
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/sql/v1"

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

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

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

# The returned object is of type Google::Cloud::Sql::V1::Operation.
p result

#list

def list(request, options = nil) -> ::Google::Cloud::Sql::V1::BackupRunsListResponse
def list(instance: nil, max_results: nil, page_token: nil, project: nil) -> ::Google::Cloud::Sql::V1::BackupRunsListResponse

Lists all backup runs associated with the project or a given instance and configuration in the reverse chronological order of the backup initiation time.

Overloads
def list(request, options = nil) -> ::Google::Cloud::Sql::V1::BackupRunsListResponse
Pass arguments to list via a request object, either of type Google::Cloud::Sql::V1::SqlBackupRunsListRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlBackupRunsListRequest, ::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(instance: nil, max_results: nil, page_token: nil, project: nil) -> ::Google::Cloud::Sql::V1::BackupRunsListResponse
Pass arguments to list 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
  • instance (::String) — Cloud SQL instance ID, or "-" for all instances. This does not include the project ID.
  • max_results (::Integer) — Maximum number of backup runs per response.
  • page_token (::String) — A previously-returned page token representing part of the larger set of results to view.
  • project (::String) — Project ID of the project that contains the 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/sql/v1"

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

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

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

# The returned object is of type Google::Cloud::Sql::V1::BackupRunsListResponse.
p result

#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)

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)