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

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

Client for the SqlInstancesService service.

Inherits

  • Object

Methods

.configure

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

Configure the SqlInstancesService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all SqlInstancesService clients
::Google::Cloud::Sql::V1::SqlInstancesService::Client.configure do |config|
  config.timeout = 10.0
end

#acquire_ssrs_lease

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

Acquire a lease for the setup of SQL Server Reporting Services (SSRS).

Overloads
def acquire_ssrs_lease(request, options = nil) -> ::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseResponse
Pass arguments to acquire_ssrs_lease via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def acquire_ssrs_lease(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseResponse
Pass arguments to acquire_ssrs_lease via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Required. Cloud SQL instance ID. This doesn't include the project ID. It's composed of lowercase letters, numbers, and hyphens, and it must start with a letter. The total length must be 98 characters or less (Example: instance-id).
  • project (::String) — Required. Project ID of the project that contains the instance (Example: project-id).
  • body (::Google::Cloud::Sql::V1::InstancesAcquireSsrsLeaseRequest, ::Hash) — Required. The request body.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#add_entra_id_certificate

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

Adds a new Entra ID certificate for the specified instance. If an Entra ID certificate was previously added but never used in a certificate rotation, this operation replaces that version.

Overloads
def add_entra_id_certificate(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to add_entra_id_certificate via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesAddEntraIdCertificateRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesAddEntraIdCertificateRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def add_entra_id_certificate(instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to add_entra_id_certificate via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Required. Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — Required. Project ID of the project that contains the instance.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#add_server_ca

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

Adds 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. For instances that have enabled Certificate Authority Service (CAS) based server CA, use AddServerCertificate to add a new server certificate.

Overloads
def add_server_ca(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to add_server_ca via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesAddServerCaRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesAddServerCaRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def add_server_ca(instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to add_server_ca via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — Project ID of the project that contains the instance.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#add_server_certificate

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

Add a new trusted server certificate version for the specified instance using Certificate Authority Service (CAS) server CA. Required to prepare for a certificate rotation. If a server certificate version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one certificate version waiting to be rotated in. For instances not using CAS server CA, use AddServerCa instead.

Overloads
def add_server_certificate(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to add_server_certificate via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesAddServerCertificateRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesAddServerCertificateRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def add_server_certificate(instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to add_server_certificate via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — Project ID of the project that contains the instance.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#call_clone

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

Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.

Overloads
def call_clone(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to call_clone via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesCloneRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesCloneRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def call_clone(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to call_clone via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Required. The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID.
  • project (::String) — Required. Project ID of the source Cloud SQL instance.
  • body (::Google::Cloud::Sql::V1::InstancesCloneRequest, ::Hash)
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#configure

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

Configure the SqlInstancesService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

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

#create_ephemeral

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

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.

Overloads
def create_ephemeral(request, options = nil) -> ::Google::Cloud::Sql::V1::SslCert
Pass arguments to create_ephemeral via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesCreateEphemeralCertRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesCreateEphemeralCertRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_ephemeral(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::SslCert
Pass arguments to create_ephemeral via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#delete

def delete(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
def delete(instance: nil, project: nil, enable_final_backup: nil, final_backup_ttl_days: nil, final_backup_expiry_time: nil, final_backup_description: nil) -> ::Google::Cloud::Sql::V1::Operation

Deletes a Cloud SQL instance.

Overloads
def delete(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to delete via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesDeleteRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesDeleteRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete(instance: nil, project: nil, enable_final_backup: nil, final_backup_ttl_days: nil, final_backup_expiry_time: nil, final_backup_description: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to delete via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — Project ID of the project that contains the instance to be deleted.
  • enable_final_backup (::Boolean) — Flag to opt-in for final backup. By default, it is turned off.
  • final_backup_ttl_days (::Integer) — Optional. Retention period of the final backup.

    Note: The following parameters are mutually exclusive: final_backup_ttl_days, final_backup_expiry_time. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

  • final_backup_expiry_time (::Google::Protobuf::Timestamp, ::Hash) — Optional. Final Backup expiration time. Timestamp in UTC of when this resource is considered expired.

    Note: The following parameters are mutually exclusive: final_backup_expiry_time, final_backup_ttl_days. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

  • final_backup_description (::String) — Optional. The description of the final backup.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#demote

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

Demotes an existing standalone instance to be a Cloud SQL read replica for an external database server.

Overloads
def demote(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to demote via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesDemoteRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesDemoteRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def demote(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to demote via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#demote_master

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

Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.

Overloads
def demote_master(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to demote_master via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesDemoteMasterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesDemoteMasterRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def demote_master(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to demote_master via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#execute_sql

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

Execute SQL statements.

Overloads
def execute_sql(request, options = nil) -> ::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlResponse
Pass arguments to execute_sql via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesExecuteSqlRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def execute_sql(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlResponse
Pass arguments to execute_sql via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Required. Database instance ID. This does not include the project ID.
  • project (::String) — Required. Project ID of the project that contains the instance.
  • body (::Google::Cloud::Sql::V1::ExecuteSqlPayload, ::Hash) — The request body.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#export

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

Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.

Overloads
def export(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to export via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesExportRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesExportRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def export(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to export via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — Project ID of the project that contains the instance to be exported.
  • body (::Google::Cloud::Sql::V1::InstancesExportRequest, ::Hash)
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#failover

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

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.

Overloads
def failover(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to failover via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesFailoverRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesFailoverRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def failover(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to failover via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#get

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

Retrieves a resource containing information about a Cloud SQL instance.

Overloads
def get(request, options = nil) -> ::Google::Cloud::Sql::V1::DatabaseInstance
Pass arguments to get via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesGetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesGetRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get(instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::DatabaseInstance
Pass arguments to get via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Required. Database instance ID. This does not include the project ID.
  • project (::String) — Required. Project ID of the project that contains the instance.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#get_disk_shrink_config

def get_disk_shrink_config(request, options = nil) -> ::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigResponse
def get_disk_shrink_config(instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigResponse

Get Disk Shrink Config for a given instance.

Overloads
def get_disk_shrink_config(request, options = nil) -> ::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigResponse
Pass arguments to get_disk_shrink_config via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_disk_shrink_config(instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigResponse
Pass arguments to get_disk_shrink_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — Project ID of the project that contains the instance.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#get_latest_recovery_time

def get_latest_recovery_time(request, options = nil) -> ::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeResponse
def get_latest_recovery_time(instance: nil, project: nil, source_instance_deletion_time: nil) -> ::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeResponse

Get Latest Recovery Time for a given instance.

Overloads
def get_latest_recovery_time(request, options = nil) -> ::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeResponse
Pass arguments to get_latest_recovery_time via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_latest_recovery_time(instance: nil, project: nil, source_instance_deletion_time: nil) -> ::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeResponse
Pass arguments to get_latest_recovery_time via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — Project ID of the project that contains the instance.
  • source_instance_deletion_time (::Google::Protobuf::Timestamp, ::Hash) — The timestamp used to identify the time when the source instance is deleted. If this instance is deleted, then you must set the timestamp.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#import

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

Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.

Overloads
def import(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to import via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesImportRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesImportRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def import(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to import via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#initialize

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

Create a new SqlInstancesService client object.

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

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

#insert

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

Creates a new Cloud SQL instance.

Overloads
def insert(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to insert via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesInsertRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesInsertRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def insert(project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to insert via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#list

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

Lists instances under a given project.

Overloads
def list(request, options = nil) -> ::Google::Cloud::Sql::V1::InstancesListResponse
Pass arguments to list via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesListRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesListRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list(filter: nil, max_results: nil, page_token: nil, project: nil) -> ::Google::Cloud::Sql::V1::InstancesListResponse
Pass arguments to list via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • filter (::String) — 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.

  • max_results (::Integer) — The maximum number of instances to return. The service may return fewer than this value. If unspecified, at most 500 instances are returned. The maximum value is 1000; values above 1000 are coerced to 1000.
  • page_token (::String) — A previously-returned page token representing part of the larger set of results to view.
  • project (::String) — Project ID of the project for which to list Cloud SQL instances.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#list_entra_id_certificates

def list_entra_id_certificates(request, options = nil) -> ::Google::Cloud::Sql::V1::InstancesListEntraIdCertificatesResponse
def list_entra_id_certificates(instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::InstancesListEntraIdCertificatesResponse

Lists all versions of EntraID certificates for the specified instance. There can be up to three sets of certificates listed: the certificate that is currently in use, a future that has been added but not yet used to sign a certificate, and a certificate that has been rotated out.

Overloads
def list_entra_id_certificates(request, options = nil) -> ::Google::Cloud::Sql::V1::InstancesListEntraIdCertificatesResponse
Pass arguments to list_entra_id_certificates via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesListEntraIdCertificatesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesListEntraIdCertificatesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_entra_id_certificates(instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::InstancesListEntraIdCertificatesResponse
Pass arguments to list_entra_id_certificates via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Required. Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — Required. Project ID of the project that contains the instance.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#list_server_cas

def list_server_cas(request, options = nil) -> ::Google::Cloud::Sql::V1::InstancesListServerCasResponse
def list_server_cas(instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::InstancesListServerCasResponse

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.

Overloads
def list_server_cas(request, options = nil) -> ::Google::Cloud::Sql::V1::InstancesListServerCasResponse
Pass arguments to list_server_cas via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesListServerCasRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesListServerCasRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_server_cas(instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::InstancesListServerCasResponse
Pass arguments to list_server_cas via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — Project ID of the project that contains the instance.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#list_server_certificates

def list_server_certificates(request, options = nil) -> ::Google::Cloud::Sql::V1::InstancesListServerCertificatesResponse
def list_server_certificates(instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::InstancesListServerCertificatesResponse

Lists all versions of server certificates and certificate authorities (CAs) for the specified instance. There can be up to three sets of certs listed: the certificate that is currently in use, a future that has been added but not yet used to sign a certificate, and a certificate that has been rotated out. For instances not using Certificate Authority Service (CAS) server CA, use ListServerCas instead.

Overloads
def list_server_certificates(request, options = nil) -> ::Google::Cloud::Sql::V1::InstancesListServerCertificatesResponse
Pass arguments to list_server_certificates via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesListServerCertificatesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesListServerCertificatesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_server_certificates(instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::InstancesListServerCertificatesResponse
Pass arguments to list_server_certificates via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Required. Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — Required. Project ID of the project that contains the instance.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#location_client

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

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

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

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#patch

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

Partially updates settings of a Cloud SQL instance by merging the request with the current configuration. This method supports patch semantics.

Overloads
def patch(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to patch via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesPatchRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesPatchRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def patch(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to patch via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — Project ID of the project that contains the instance.
  • body (::Google::Cloud::Sql::V1::DatabaseInstance, ::Hash)
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#perform_disk_shrink

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

Perform Disk Shrink on primary instance.

Overloads
def perform_disk_shrink(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to perform_disk_shrink via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesPerformDiskShrinkRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesPerformDiskShrinkRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def perform_disk_shrink(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to perform_disk_shrink via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — Project ID of the project that contains the instance.
  • body (::Google::Cloud::Sql::V1::PerformDiskShrinkContext, ::Hash) — Perform disk shrink context.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#point_in_time_restore

def point_in_time_restore(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
def point_in_time_restore(parent: nil, context: nil) -> ::Google::Cloud::Sql::V1::Operation

Point in time restore for an instance managed by Google Cloud Backup and Disaster Recovery.

Overloads
def point_in_time_restore(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to point_in_time_restore via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesPointInTimeRestoreRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesPointInTimeRestoreRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def point_in_time_restore(parent: nil, context: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to point_in_time_restore via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent resource where you created this instance. Format: projects/{project}
  • context (::Google::Cloud::Sql::V1::PointInTimeRestoreContext, ::Hash) — Required. The context for request to perform a PITR on a Google Cloud Backup and Disaster Recovery managed instance.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#pre_check_major_version_upgrade

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

Execute MVU Pre-checks

Overloads
def pre_check_major_version_upgrade(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to pre_check_major_version_upgrade via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesPreCheckMajorVersionUpgradeRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesPreCheckMajorVersionUpgradeRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def pre_check_major_version_upgrade(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to pre_check_major_version_upgrade via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Required. Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — Required. Project ID of the project that contains the instance.
  • body (::Google::Cloud::Sql::V1::InstancesPreCheckMajorVersionUpgradeRequest, ::Hash) — Required. The context for request to perform the pre-check major version upgrade operation.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#promote_replica

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

Promotes the read replica instance to be an independent Cloud SQL primary instance. Using this operation might cause your instance to restart.

Overloads
def promote_replica(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to promote_replica via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesPromoteReplicaRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesPromoteReplicaRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def promote_replica(instance: nil, project: nil, failover: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to promote_replica via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Cloud SQL read replica instance name.
  • project (::String) — ID of the project that contains the read replica.
  • failover (::Boolean) — Set to true to invoke a replica failover to the DR replica. As part of replica failover, the promote operation attempts to add the original primary instance as a replica of the promoted DR replica when the original primary instance comes back online. If set to false or not specified, then the original primary instance becomes an independent Cloud SQL primary instance.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#reencrypt

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

Reencrypt CMEK instance with latest key version.

Overloads
def reencrypt(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to reencrypt via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesReencryptRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesReencryptRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def reencrypt(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to reencrypt via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — ID of the project that contains the instance.
  • body (::Google::Cloud::Sql::V1::InstancesReencryptRequest, ::Hash) — Reencrypt body that users request
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#release_ssrs_lease

def release_ssrs_lease(request, options = nil) -> ::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseResponse
def release_ssrs_lease(instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseResponse

Release a lease for the setup of SQL Server Reporting Services (SSRS).

Overloads
def release_ssrs_lease(request, options = nil) -> ::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseResponse
Pass arguments to release_ssrs_lease via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def release_ssrs_lease(instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseResponse
Pass arguments to release_ssrs_lease via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Required. The Cloud SQL instance ID. This doesn't include the project ID. The instance ID contains lowercase letters, numbers, and hyphens, and it must start with a letter. This ID can have a maximum length of 98 characters.
  • project (::String) — Required. The project ID that contains the instance.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#reschedule_maintenance

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

Reschedules the maintenance on the given instance.

Overloads
def reschedule_maintenance(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to reschedule_maintenance via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesRescheduleMaintenanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesRescheduleMaintenanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def reschedule_maintenance(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to reschedule_maintenance via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#reset_replica_size

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

Reset Replica Size to primary instance disk size.

Overloads
def reset_replica_size(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to reset_replica_size via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesResetReplicaSizeRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesResetReplicaSizeRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def reset_replica_size(instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to reset_replica_size via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Cloud SQL read replica instance name.
  • project (::String) — ID of the project that contains the read replica.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#reset_ssl_config

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

Deletes all client certificates and generates a new server SSL certificate for the instance.

Overloads
def reset_ssl_config(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to reset_ssl_config via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesResetSslConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesResetSslConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def reset_ssl_config(instance: nil, project: nil, mode: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to reset_ssl_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#restart

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

Restarts a Cloud SQL instance.

Overloads
def restart(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to restart via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesRestartRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesRestartRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def restart(instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to restart via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — Project ID of the project that contains the instance to be restarted.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#restore_backup

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

Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.

Overloads
def restore_backup(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to restore_backup via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesRestoreBackupRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesRestoreBackupRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def restore_backup(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to restore_backup via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#rotate_entra_id_certificate

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

Rotates the server certificate version to one previously added with the addEntraIdCertificate method.

Overloads
def rotate_entra_id_certificate(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to rotate_entra_id_certificate via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesRotateEntraIdCertificateRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesRotateEntraIdCertificateRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def rotate_entra_id_certificate(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to rotate_entra_id_certificate via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#rotate_server_ca

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

Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method. For instances that have enabled Certificate Authority Service (CAS) based server CA, use RotateServerCertificate to rotate the server certificate.

Overloads
def rotate_server_ca(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to rotate_server_ca via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesRotateServerCaRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesRotateServerCaRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def rotate_server_ca(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to rotate_server_ca via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#rotate_server_certificate

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

Rotates the server certificate version to one previously added with the addServerCertificate method. For instances not using Certificate Authority Service (CAS) server CA, use RotateServerCa instead.

Overloads
def rotate_server_certificate(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to rotate_server_certificate via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesRotateServerCertificateRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesRotateServerCertificateRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def rotate_server_certificate(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to rotate_server_certificate via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#start_external_sync

def start_external_sync(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
def start_external_sync(instance: nil, project: nil, sync_mode: nil, skip_verification: nil, mysql_sync_config: nil, sync_parallel_level: nil, migration_type: nil, replica_overwrite_enabled: nil) -> ::Google::Cloud::Sql::V1::Operation

Start External primary instance migration.

Overloads
def start_external_sync(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to start_external_sync via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesStartExternalSyncRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesStartExternalSyncRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def start_external_sync(instance: nil, project: nil, sync_mode: nil, skip_verification: nil, mysql_sync_config: nil, sync_parallel_level: nil, migration_type: nil, replica_overwrite_enabled: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to start_external_sync via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#start_replica

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

Starts the replication in the read replica instance.

Overloads
def start_replica(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to start_replica via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesStartReplicaRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesStartReplicaRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def start_replica(instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to start_replica via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Cloud SQL read replica instance name.
  • project (::String) — ID of the project that contains the read replica.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#stop_replica

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

Stops the replication in the read replica instance.

Overloads
def stop_replica(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to stop_replica via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesStopReplicaRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesStopReplicaRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def stop_replica(instance: nil, project: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to stop_replica via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Cloud SQL read replica instance name.
  • project (::String) — ID of the project that contains the read replica.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#switchover

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

Switches over from the primary instance to the DR replica instance.

Overloads
def switchover(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to switchover via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesSwitchoverRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesSwitchoverRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def switchover(instance: nil, project: nil, db_timeout: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to switchover via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Cloud SQL read replica instance name.
  • project (::String) — ID of the project that contains the replica.
  • db_timeout (::Google::Protobuf::Duration, ::Hash) — Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations timeout, which is a sum of all database operations. Default value is 10 minutes and can be modified to a maximum value of 24 hours.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#truncate_log

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

Truncate MySQL general and slow query log tables MySQL only.

Overloads
def truncate_log(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to truncate_log via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesTruncateLogRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesTruncateLogRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def truncate_log(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to truncate_log via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update

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

Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.

Overloads
def update(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to update via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesUpdateRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesUpdateRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::Operation
Pass arguments to update via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • instance (::String) — Cloud SQL instance ID. This does not include the project ID.
  • project (::String) — Project ID of the project that contains the instance.
  • body (::Google::Cloud::Sql::V1::DatabaseInstance, ::Hash)
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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

#verify_external_sync_settings

def verify_external_sync_settings(request, options = nil) -> ::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsResponse
def verify_external_sync_settings(instance: nil, project: nil, verify_connection_only: nil, sync_mode: nil, verify_replication_only: nil, mysql_sync_config: nil, migration_type: nil, sync_parallel_level: nil, selected_objects: nil) -> ::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsResponse

Verify External primary instance external sync settings.

Overloads
def verify_external_sync_settings(request, options = nil) -> ::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsResponse
Pass arguments to verify_external_sync_settings via a request object, either of type Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def verify_external_sync_settings(instance: nil, project: nil, verify_connection_only: nil, sync_mode: nil, verify_replication_only: nil, mysql_sync_config: nil, migration_type: nil, sync_parallel_level: nil, selected_objects: nil) -> ::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsResponse
Pass arguments to verify_external_sync_settings via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1"

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

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

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

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