Reference documentation and code samples for the Cloud SQL Admin V1 API class Google::Cloud::Sql::V1::SqlBackupsService::Rest::Client.
REST client for the SqlBackupsService service.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the SqlBackupsService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all SqlBackupsService clients ::Google::Cloud::Sql::V1::SqlBackupsService::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the SqlBackupsService 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_backup
def create_backup(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
def create_backup(parent: nil, backup: nil) -> ::Google::Cloud::Sql::V1::OperationCreates a backup for a Cloud SQL instance. This API can be used only to create on-demand backups.
def create_backup(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationcreate_backup via a request object, either of type
CreateBackupRequest or an equivalent Hash.
- request (::Google::Cloud::Sql::V1::CreateBackupRequest, ::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_backup(parent: nil, backup: nil) -> ::Google::Cloud::Sql::V1::Operationcreate_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).
- parent (::String) — Required. The parent resource where this backup is created. Format: projects/{project}
- backup (::Google::Cloud::Sql::V1::Backup, ::Hash) — Required. The Backup to create.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Sql::V1::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::SqlBackupsService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Sql::V1::CreateBackupRequest.new # Call the create_backup method. result = client.create_backup request # The returned object is of type Google::Cloud::Sql::V1::Operation. p result
#delete_backup
def delete_backup(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
def delete_backup(name: nil) -> ::Google::Cloud::Sql::V1::OperationDeletes the backup.
def delete_backup(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationdelete_backup via a request object, either of type
DeleteBackupRequest or an equivalent Hash.
- request (::Google::Cloud::Sql::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) -> ::Google::Cloud::Sql::V1::Operationdelete_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).
- name (::String) — Required. The name of the backup to delete. Format: projects/{project}/backups/{backup}
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Sql::V1::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::SqlBackupsService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Sql::V1::DeleteBackupRequest.new # Call the delete_backup method. result = client.delete_backup request # The returned object is of type Google::Cloud::Sql::V1::Operation. p result
#get_backup
def get_backup(request, options = nil) -> ::Google::Cloud::Sql::V1::Backup
def get_backup(name: nil) -> ::Google::Cloud::Sql::V1::BackupRetrieves a resource containing information about a backup.
def get_backup(request, options = nil) -> ::Google::Cloud::Sql::V1::Backupget_backup via a request object, either of type
GetBackupRequest or an equivalent Hash.
- request (::Google::Cloud::Sql::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::Sql::V1::Backupget_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).
- name (::String) — Required. The name of the backup to retrieve. Format: projects/{project}/backups/{backup}
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Sql::V1::Backup)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::SqlBackupsService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Sql::V1::GetBackupRequest.new # Call the get_backup method. result = client.get_backup request # The returned object is of type Google::Cloud::Sql::V1::Backup. p result
#initialize
def initialize() { |config| ... } -> ClientCreate a new SqlBackupsService REST client object.
- (config) — Configure the SqlBackupsService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Sql::V1::SqlBackupsService::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Sql::V1::SqlBackupsService::Rest::Client.new do |config| config.timeout = 10.0 end
#list_backups
def list_backups(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Sql::V1::Backup>
def list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Sql::V1::Backup>Lists all backups associated with the project.
def list_backups(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Sql::V1::Backup>list_backups via a request object, either of type
ListBackupsRequest or an equivalent Hash.
- request (::Google::Cloud::Sql::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, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Sql::V1::Backup>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).
- parent (::String) — Required. The parent that owns this collection of backups. Format: projects/{project}
- page_size (::Integer) — The maximum number of backups to return per response. The service might return fewer backups than this value. If a value for this parameter isn't specified, then, at most, 500 backups are returned. The maximum value is 2,000. Any values that you set, which are greater than 2,000, are changed to 2,000.
-
page_token (::String) — A page token, received from a previous
ListBackupscall. Provide this to retrieve the subsequent page.When paginating, all other parameters provided to
ListBackupsmust match the call that provided the page token. - filter (::String) — Multiple filter queries are separated by spaces. For example, 'instance:abc AND type:FINAL, 'location:us', 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by type, instance, backupInterval.startTime (creation time), or location.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Sql::V1::Backup>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Sql::V1::Backup>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::SqlBackupsService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Sql::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::Sql::V1::Backup. p item end
#location_client
def location_client() -> Google::Cloud::Location::Locations::Rest::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)
#update_backup
def update_backup(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
def update_backup(backup: nil, update_mask: nil) -> ::Google::Cloud::Sql::V1::OperationUpdates the retention period and description of the backup. You can use this API to update final backups only.
def update_backup(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationupdate_backup via a request object, either of type
UpdateBackupRequest or an equivalent Hash.
- request (::Google::Cloud::Sql::V1::UpdateBackupRequest, ::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_backup(backup: nil, update_mask: nil) -> ::Google::Cloud::Sql::V1::Operationupdate_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).
-
backup (::Google::Cloud::Sql::V1::Backup, ::Hash) — Required. The backup to update.
The backup’s
namefield is used to identify the backup to update. Format: projects/{project}/backups/{backup} - update_mask (::Google::Protobuf::FieldMask, ::Hash) — The list of fields that you can update. You can update only the description and retention period of the final backup.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Sql::V1::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::SqlBackupsService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Sql::V1::UpdateBackupRequest.new # Call the update_backup method. result = client.update_backup request # The returned object is of type Google::Cloud::Sql::V1::Operation. p result