class Google::Apis::SqladminV1beta4::SQLAdminService

Cloud SQL Admin API

API for Cloud SQL database instance management

@example

require 'google/apis/sqladmin_v1beta4'

Sqladmin = Google::Apis::SqladminV1beta4 # Alias the module
service = Sqladmin::SQLAdminService.new

@see developers.google.com/cloud-sql/

Attributes

key[RW]

@return [String]

API key. Your API key identifies your project and provides you with API access,
quota, and reports. Required unless you provide an OAuth 2.0 token.
quota_user[RW]

@return [String]

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/google/apis/sqladmin_v1beta4/service.rb, line 45
def initialize
  super('https://sqladmin.googleapis.com/', '',
        client_name: 'google-apis-sqladmin_v1beta4',
        client_version: Google::Apis::SqladminV1beta4::GEM_VERSION)
  @batch_path = 'batch'
end

Public Instance Methods

add_instance_server_ca(project, instance, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Add a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 557
def add_instance_server_ca(project, instance, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/addServerCa', options)
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
clone_instance(project, instance, clone_instances_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart. @param [String] project

Project ID of the source as well as the clone Cloud SQL instance.

@param [String] instance

The ID of the Cloud SQL instance to be cloned (source). This does not include
the project ID.

@param [Google::Apis::SqladminV1beta4::CloneInstancesRequest] clone_instances_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 593
def clone_instance(project, instance, clone_instances_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/clone', options)
  command.request_representation = Google::Apis::SqladminV1beta4::CloneInstancesRequest::Representation
  command.request_object = clone_instances_request_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
create_ssl_cert_ephemeral(project, instance, ssl_certs_create_ephemeral_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database. @param [String] project

Project ID of the Cloud SQL project.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [Google::Apis::SqladminV1beta4::SslCertsCreateEphemeralRequest] ssl_certs_create_ephemeral_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::SslCert] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::SslCert]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1497
def create_ssl_cert_ephemeral(project, instance, ssl_certs_create_ephemeral_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral', options)
  command.request_representation = Google::Apis::SqladminV1beta4::SslCertsCreateEphemeralRequest::Representation
  command.request_object = ssl_certs_create_ephemeral_request_object
  command.response_representation = Google::Apis::SqladminV1beta4::SslCert::Representation
  command.response_class = Google::Apis::SqladminV1beta4::SslCert
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
delete_backup_run(project, instance, id, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Deletes the backup taken by a backup run. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [Fixnum] id

The ID of the backup run to delete. To find a backup run ID, use the list
method.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 77
def delete_backup_run(project, instance, id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}', options)
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
delete_database(project, instance, database, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Deletes a database from a Cloud SQL instance. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Database instance ID. This does not include the project ID.

@param [String] database

Name of the database to be deleted in the instance.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 301
def delete_database(project, instance, database, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}', options)
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.params['database'] = database unless database.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
delete_instance(project, instance, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Deletes a Cloud SQL instance. @param [String] project

Project ID of the project that contains the instance to be deleted.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 628
def delete_instance(project, instance, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
delete_ssl_cert(project, instance, sha1_fingerprint, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [String] sha1_fingerprint

Sha1 FingerPrint.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1535
def delete_ssl_cert(project, instance, sha1_fingerprint, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}', options)
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.params['sha1Fingerprint'] = sha1_fingerprint unless sha1_fingerprint.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
delete_user(project, instance, host: nil, name: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Deletes a user from a Cloud SQL instance. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Database instance ID. This does not include the project ID.

@param [String] host

Host of the user in the instance.

@param [String] name

Name of the user in the instance.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1713
def delete_user(project, instance, host: nil, name: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'sql/v1beta4/projects/{project}/instances/{instance}/users', options)
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['host'] = host unless host.nil?
  command.query['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
demote_instance_master(project, instance, instances_demote_master_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server. @param [String] project

ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance name.

@param [Google::Apis::SqladminV1beta4::InstancesDemoteMasterRequest] instances_demote_master_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 663
def demote_instance_master(project, instance, instances_demote_master_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster', options)
  command.request_representation = Google::Apis::SqladminV1beta4::InstancesDemoteMasterRequest::Representation
  command.request_object = instances_demote_master_request_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
export_instance(project, instance, export_instances_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file. @param [String] project

Project ID of the project that contains the instance to be exported.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [Google::Apis::SqladminV1beta4::ExportInstancesRequest] export_instances_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 700
def export_instance(project, instance, export_instances_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/export', options)
  command.request_representation = Google::Apis::SqladminV1beta4::ExportInstancesRequest::Representation
  command.request_object = export_instances_request_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
failover_instance(project, instance, instances_failover_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Initiates a manual failover of a high availability (HA) primary instance to a standby instance, which becomes the primary instance. Users are then rerouted to the new primary. For more information, see the Overview of high availability page in the Cloud SQL documentation. If using Legacy HA (MySQL only), this causes the instance to failover to its failover replica instance. @param [String] project

ID of the project that contains the read replica.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [Google::Apis::SqladminV1beta4::InstancesFailoverRequest] instances_failover_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 740
def failover_instance(project, instance, instances_failover_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/failover', options)
  command.request_representation = Google::Apis::SqladminV1beta4::InstancesFailoverRequest::Representation
  command.request_object = instances_failover_request_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
generate_connect_ephemeral_cert(project, instance, generate_ephemeral_cert_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [Google::Apis::SqladminV1beta4::GenerateEphemeralCertRequest] generate_ephemeral_cert_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::GenerateEphemeralCertResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::GenerateEphemeralCertResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 228
def generate_connect_ephemeral_cert(project, instance, generate_ephemeral_cert_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}:generateEphemeralCert', options)
  command.request_representation = Google::Apis::SqladminV1beta4::GenerateEphemeralCertRequest::Representation
  command.request_object = generate_ephemeral_cert_request_object
  command.response_representation = Google::Apis::SqladminV1beta4::GenerateEphemeralCertResponse::Representation
  command.response_class = Google::Apis::SqladminV1beta4::GenerateEphemeralCertResponse
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
get_backup_run(project, instance, id, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Retrieves a resource containing information about a backup run. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [Fixnum] id

The ID of this backup run.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::BackupRun] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::BackupRun]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 113
def get_backup_run(project, instance, id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}', options)
  command.response_representation = Google::Apis::SqladminV1beta4::BackupRun::Representation
  command.response_class = Google::Apis::SqladminV1beta4::BackupRun
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
get_connect(project, instance, read_time: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Retrieves connect settings about a Cloud SQL instance. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [String] read_time

Optional. Optional snapshot read timestamp to trade freshness for performance.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::ConnectSettings] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::ConnectSettings]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 265
def get_connect(project, instance, read_time: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/connectSettings', options)
  command.response_representation = Google::Apis::SqladminV1beta4::ConnectSettings::Representation
  command.response_class = Google::Apis::SqladminV1beta4::ConnectSettings
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['readTime'] = read_time unless read_time.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
get_database(project, instance, database, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Retrieves a resource containing information about a database inside a Cloud SQL instance. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Database instance ID. This does not include the project ID.

@param [String] database

Name of the database in the instance.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Database] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Database]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 338
def get_database(project, instance, database, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}', options)
  command.response_representation = Google::Apis::SqladminV1beta4::Database::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Database
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.params['database'] = database unless database.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
get_instance(project, instance, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Retrieves a resource containing information about a Cloud SQL instance. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Database instance ID. This does not include the project ID.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::DatabaseInstance] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::DatabaseInstance]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 775
def get_instance(project, instance, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
  command.response_representation = Google::Apis::SqladminV1beta4::DatabaseInstance::Representation
  command.response_class = Google::Apis::SqladminV1beta4::DatabaseInstance
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
get_operation(project, operation, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Retrieves an instance operation that has been performed on an instance. @param [String] project

Project ID of the project that contains the instance.

@param [String] operation

Instance operation ID.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1312
def get_operation(project, operation, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/operations/{operation}', options)
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['operation'] = operation unless operation.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
get_ssl_cert(project, instance, sha1_fingerprint, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Retrieves a particular SSL certificate. Does not include the private key ( required for usage). The private key must be saved from the response to initial creation. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [String] sha1_fingerprint

Sha1 FingerPrint.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::SslCert] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::SslCert]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1573
def get_ssl_cert(project, instance, sha1_fingerprint, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}', options)
  command.response_representation = Google::Apis::SqladminV1beta4::SslCert::Representation
  command.response_class = Google::Apis::SqladminV1beta4::SslCert
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.params['sha1Fingerprint'] = sha1_fingerprint unless sha1_fingerprint.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
import_instance(project, instance, import_instances_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [Google::Apis::SqladminV1beta4::ImportInstancesRequest] import_instances_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 810
def import_instance(project, instance, import_instances_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/import', options)
  command.request_representation = Google::Apis::SqladminV1beta4::ImportInstancesRequest::Representation
  command.request_object = import_instances_request_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
insert_backup_run(project, instance, backup_run_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Creates a new backup run on demand. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [Google::Apis::SqladminV1beta4::BackupRun] backup_run_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 148
def insert_backup_run(project, instance, backup_run_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/backupRuns', options)
  command.request_representation = Google::Apis::SqladminV1beta4::BackupRun::Representation
  command.request_object = backup_run_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
insert_database(project, instance, database_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Inserts a resource containing information about a database inside a Cloud SQL instance. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Database instance ID. This does not include the project ID.

@param [Google::Apis::SqladminV1beta4::Database] database_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 374
def insert_database(project, instance, database_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/databases', options)
  command.request_representation = Google::Apis::SqladminV1beta4::Database::Representation
  command.request_object = database_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
insert_instance(project, database_instance_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Creates a new Cloud SQL instance. @param [String] project

Project ID of the project to which the newly created Cloud SQL instances
should belong.

@param [Google::Apis::SqladminV1beta4::DatabaseInstance] database_instance_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 845
def insert_instance(project, database_instance_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances', options)
  command.request_representation = Google::Apis::SqladminV1beta4::DatabaseInstance::Representation
  command.request_object = database_instance_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
insert_ssl_cert(project, instance, insert_ssl_certs_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Creates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [Google::Apis::SqladminV1beta4::InsertSslCertsRequest] insert_ssl_certs_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::InsertSslCertsResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::InsertSslCertsResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1610
def insert_ssl_cert(project, instance, insert_ssl_certs_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/sslCerts', options)
  command.request_representation = Google::Apis::SqladminV1beta4::InsertSslCertsRequest::Representation
  command.request_object = insert_ssl_certs_request_object
  command.response_representation = Google::Apis::SqladminV1beta4::InsertSslCertsResponse::Representation
  command.response_class = Google::Apis::SqladminV1beta4::InsertSslCertsResponse
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
insert_user(project, instance, user_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Creates a new user in a Cloud SQL instance. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Database instance ID. This does not include the project ID.

@param [Google::Apis::SqladminV1beta4::User] user_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1749
def insert_user(project, instance, user_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/users', options)
  command.request_representation = Google::Apis::SqladminV1beta4::User::Representation
  command.request_object = user_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
list_backup_runs(project, instance, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

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

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID, or "-" for all instances. This does not include the
project ID.

@param [Fixnum] max_results

Maximum number of backup runs per response.

@param [String] page_token

A previously-returned page token representing part of the larger set of
results to view.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::ListBackupRunsResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::ListBackupRunsResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 190
def list_backup_runs(project, instance, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/backupRuns', options)
  command.response_representation = Google::Apis::SqladminV1beta4::ListBackupRunsResponse::Representation
  command.response_class = Google::Apis::SqladminV1beta4::ListBackupRunsResponse
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
list_databases(project, instance, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Lists databases in the specified Cloud SQL instance. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::ListDatabasesResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::ListDatabasesResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 409
def list_databases(project, instance, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/databases', options)
  command.response_representation = Google::Apis::SqladminV1beta4::ListDatabasesResponse::Representation
  command.response_class = Google::Apis::SqladminV1beta4::ListDatabasesResponse
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
list_flags(database_version: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Lists all available database flags for Cloud SQL instances. @param [String] database_version

Database type and version you want to retrieve flags for. By default, this
method returns flags for all database types and versions.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::ListFlagsResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::ListFlagsResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 521
def list_flags(database_version: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/flags', options)
  command.response_representation = Google::Apis::SqladminV1beta4::ListFlagsResponse::Representation
  command.response_class = Google::Apis::SqladminV1beta4::ListFlagsResponse
  command.query['databaseVersion'] = database_version unless database_version.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
list_instance_server_cas(project, instance, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::InstancesListServerCasResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::InstancesListServerCasResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 929
def list_instance_server_cas(project, instance, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/listServerCas', options)
  command.response_representation = Google::Apis::SqladminV1beta4::InstancesListServerCasResponse::Representation
  command.response_class = Google::Apis::SqladminV1beta4::InstancesListServerCasResponse
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
list_instances(project, filter: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Lists instances under a given project. @param [String] project

Project ID of the project for which to list Cloud SQL instances.

@param [String] filter

A filter expression that filters resources listed in the response. The
expression is in the form of field:value. For example, 'instanceType:
CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per their JSON
representation, such as 'settings.userLabels.auto_start:true'. Multiple filter
queries are space-separated. For example. 'state:RUNNABLE instanceType:
CLOUD_SQL_INSTANCE'. By default, each expression is an AND expression. However,
you can include AND and OR expressions explicitly.

@param [Fixnum] max_results

The maximum number of results to return per response.

@param [String] page_token

A previously-returned page token representing part of the larger set of
results to view.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::ListInstancesResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::ListInstancesResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 890
def list_instances(project, filter: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances', options)
  command.response_representation = Google::Apis::SqladminV1beta4::ListInstancesResponse::Representation
  command.response_class = Google::Apis::SqladminV1beta4::ListInstancesResponse
  command.params['project'] = project unless project.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
list_operations(project, instance: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [Fixnum] max_results

Maximum number of operations per response.

@param [String] page_token

A previously-returned page token representing part of the larger set of
results to view.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::ListOperationsResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::ListOperationsResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1351
def list_operations(project, instance: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/operations', options)
  command.response_representation = Google::Apis::SqladminV1beta4::ListOperationsResponse::Representation
  command.response_class = Google::Apis::SqladminV1beta4::ListOperationsResponse
  command.params['project'] = project unless project.nil?
  command.query['instance'] = instance unless instance.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
list_ssl_certs(project, instance, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Lists all of the current SSL certificates for the instance. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::ListSslCertsResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::ListSslCertsResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1645
def list_ssl_certs(project, instance, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/sslCerts', options)
  command.response_representation = Google::Apis::SqladminV1beta4::ListSslCertsResponse::Representation
  command.response_class = Google::Apis::SqladminV1beta4::ListSslCertsResponse
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
list_tiers(project, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Lists all available machine types (tiers) for Cloud SQL, for example, db- custom-1-3840. For related information, see Pricing. @param [String] project

Project ID of the project for which to list tiers.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::ListTiersResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::ListTiersResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1677
def list_tiers(project, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/tiers', options)
  command.response_representation = Google::Apis::SqladminV1beta4::ListTiersResponse::Representation
  command.response_class = Google::Apis::SqladminV1beta4::ListTiersResponse
  command.params['project'] = project unless project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
list_users(project, instance, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Lists users in the specified Cloud SQL instance. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Database instance ID. This does not include the project ID.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::ListUsersResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::ListUsersResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1784
def list_users(project, instance, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/users', options)
  command.response_representation = Google::Apis::SqladminV1beta4::ListUsersResponse::Representation
  command.response_class = Google::Apis::SqladminV1beta4::ListUsersResponse
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
patch_database(project, instance, database, database_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Database instance ID. This does not include the project ID.

@param [String] database

Name of the database to be updated in the instance.

@param [Google::Apis::SqladminV1beta4::Database] database_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 446
def patch_database(project, instance, database, database_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}', options)
  command.request_representation = Google::Apis::SqladminV1beta4::Database::Representation
  command.request_object = database_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.params['database'] = database unless database.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
patch_instance(project, instance, database_instance_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Updates settings of a Cloud SQL instance. This method supports patch semantics. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [Google::Apis::SqladminV1beta4::DatabaseInstance] database_instance_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 963
def patch_instance(project, instance, database_instance_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
  command.request_representation = Google::Apis::SqladminV1beta4::DatabaseInstance::Representation
  command.request_object = database_instance_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
promote_instance_replica(project, instance, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Promotes the read replica instance to be a stand-alone Cloud SQL instance. Using this operation might cause your instance to restart. @param [String] project

ID of the project that contains the read replica.

@param [String] instance

Cloud SQL read replica instance name.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 999
def promote_instance_replica(project, instance, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica', options)
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
reschedule_project_instance_maintenance(project, instance, sql_instances_reschedule_maintenance_request_body_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Reschedules the maintenance on the given instance. @param [String] project

ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [Google::Apis::SqladminV1beta4::SqlInstancesRescheduleMaintenanceRequestBody] sql_instances_reschedule_maintenance_request_body_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1387
def reschedule_project_instance_maintenance(project, instance, sql_instances_reschedule_maintenance_request_body_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance', options)
  command.request_representation = Google::Apis::SqladminV1beta4::SqlInstancesRescheduleMaintenanceRequestBody::Representation
  command.request_object = sql_instances_reschedule_maintenance_request_body_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
reset_instance_ssl_config(project, instance, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Deletes all client certificates and generates a new server SSL certificate for the instance. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1033
def reset_instance_ssl_config(project, instance, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig', options)
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
restart_instance(project, instance, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Restarts a Cloud SQL instance. @param [String] project

Project ID of the project that contains the instance to be restarted.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1066
def restart_instance(project, instance, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/restart', options)
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
restore_instance_backup(project, instance, restore_instances_backup_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [Google::Apis::SqladminV1beta4::RestoreInstancesBackupRequest] restore_instances_backup_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1101
def restore_instance_backup(project, instance, restore_instances_backup_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup', options)
  command.request_representation = Google::Apis::SqladminV1beta4::RestoreInstancesBackupRequest::Representation
  command.request_object = restore_instances_backup_request_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
rotate_instance_server_ca(project, instance, instances_rotate_server_ca_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [Google::Apis::SqladminV1beta4::InstancesRotateServerCaRequest] instances_rotate_server_ca_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1138
def rotate_instance_server_ca(project, instance, instances_rotate_server_ca_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa', options)
  command.request_representation = Google::Apis::SqladminV1beta4::InstancesRotateServerCaRequest::Representation
  command.request_object = instances_rotate_server_ca_request_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
start_instance_replica(project, instance, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Starts the replication in the read replica instance. @param [String] project

ID of the project that contains the read replica.

@param [String] instance

Cloud SQL read replica instance name.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1173
def start_instance_replica(project, instance, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/startReplica', options)
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
start_project_instance_external_sync(project, instance, sql_instances_start_external_sync_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Start External primary instance migration. @param [String] project

ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [Google::Apis::SqladminV1beta4::SqlInstancesStartExternalSyncRequest] sql_instances_start_external_sync_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1423
def start_project_instance_external_sync(project, instance, sql_instances_start_external_sync_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync', options)
  command.request_representation = Google::Apis::SqladminV1beta4::SqlInstancesStartExternalSyncRequest::Representation
  command.request_object = sql_instances_start_external_sync_request_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
stop_instance_replica(project, instance, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Stops the replication in the read replica instance. @param [String] project

ID of the project that contains the read replica.

@param [String] instance

Cloud SQL read replica instance name.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1206
def stop_instance_replica(project, instance, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/stopReplica', options)
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
truncate_instance_log(project, instance, instances_truncate_log_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Truncate MySQL general and slow query log tables MySQL only. @param [String] project

Project ID of the Cloud SQL project.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [Google::Apis::SqladminV1beta4::InstancesTruncateLogRequest] instances_truncate_log_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1240
def truncate_instance_log(project, instance, instances_truncate_log_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/truncateLog', options)
  command.request_representation = Google::Apis::SqladminV1beta4::InstancesTruncateLogRequest::Representation
  command.request_object = instances_truncate_log_request_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
update_database(project, instance, database, database_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Updates a resource containing information about a database inside a Cloud SQL instance. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Database instance ID. This does not include the project ID.

@param [String] database

Name of the database to be updated in the instance.

@param [Google::Apis::SqladminV1beta4::Database] database_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 486
def update_database(project, instance, database, database_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:put, 'sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}', options)
  command.request_representation = Google::Apis::SqladminV1beta4::Database::Representation
  command.request_object = database_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.params['database'] = database unless database.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
update_instance(project, instance, database_instance_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [Google::Apis::SqladminV1beta4::DatabaseInstance] database_instance_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1277
def update_instance(project, instance, database_instance_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:put, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
  command.request_representation = Google::Apis::SqladminV1beta4::DatabaseInstance::Representation
  command.request_object = database_instance_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
update_user(project, instance, user_object = nil, host: nil, name: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Updates an existing user in a Cloud SQL instance. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Database instance ID. This does not include the project ID.

@param [Google::Apis::SqladminV1beta4::User] user_object @param [String] host

Optional. Host of the user in the instance.

@param [String] name

Name of the user in the instance.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1822
def update_user(project, instance, user_object = nil, host: nil, name: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:put, 'sql/v1beta4/projects/{project}/instances/{instance}/users', options)
  command.request_representation = Google::Apis::SqladminV1beta4::User::Representation
  command.request_object = user_object
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqladminV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['host'] = host unless host.nil?
  command.query['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
verify_project_instance_external_sync_settings(project, instance, sql_instances_verify_external_sync_settings_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Verify External primary instance external sync settings. @param [String] project

Project ID of the project that contains the instance.

@param [String] instance

Cloud SQL instance ID. This does not include the project ID.

@param [Google::Apis::SqladminV1beta4::SqlInstancesVerifyExternalSyncSettingsRequest] sql_instances_verify_external_sync_settings_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::SqladminV1beta4::SqlInstancesVerifyExternalSyncSettingsResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::SqladminV1beta4::SqlInstancesVerifyExternalSyncSettingsResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1459
def verify_project_instance_external_sync_settings(project, instance, sql_instances_verify_external_sync_settings_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings', options)
  command.request_representation = Google::Apis::SqladminV1beta4::SqlInstancesVerifyExternalSyncSettingsRequest::Representation
  command.request_object = sql_instances_verify_external_sync_settings_request_object
  command.response_representation = Google::Apis::SqladminV1beta4::SqlInstancesVerifyExternalSyncSettingsResponse::Representation
  command.response_class = Google::Apis::SqladminV1beta4::SqlInstancesVerifyExternalSyncSettingsResponse
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

Protected Instance Methods

apply_command_defaults(command) click to toggle source
# File lib/google/apis/sqladmin_v1beta4/service.rb, line 1839
def apply_command_defaults(command)
  command.query['key'] = key unless key.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
end