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::ConfigurationConfigure the SqlInstancesService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# 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::SqlInstancesAcquireSsrsLeaseResponseAcquire a lease for the setup of SQL Server Reporting Services (SSRS).
def acquire_ssrs_lease(request, options = nil) -> ::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseResponseacquire_ssrs_lease via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseRequest or an equivalent Hash.
- 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::SqlInstancesAcquireSsrsLeaseResponseacquire_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).
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationAdds 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.
def add_entra_id_certificate(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationadd_entra_id_certificate via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesAddEntraIdCertificateRequest or an equivalent Hash.
- 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::Operationadd_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).
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationAdds 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.
def add_server_ca(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationadd_server_ca via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesAddServerCaRequest or an equivalent Hash.
- 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::Operationadd_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).
- instance (::String) — Cloud SQL instance ID. This does not include the project ID.
- project (::String) — Project ID of the project that contains the instance.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationAdd 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.
def add_server_certificate(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationadd_server_certificate via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesAddServerCertificateRequest or an equivalent Hash.
- 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::Operationadd_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).
- instance (::String) — Cloud SQL instance ID. This does not include the project ID.
- project (::String) — Project ID of the project that contains the instance.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationCreates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.
def call_clone(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationcall_clone via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesCloneRequest or an equivalent Hash.
- 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::Operationcall_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).
- 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)
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::ConfigurationConfigure 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#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::SslCertGenerates 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.
def create_ephemeral(request, options = nil) -> ::Google::Cloud::Sql::V1::SslCertcreate_ephemeral via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesCreateEphemeralCertRequest or an equivalent Hash.
- 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::SslCertcreate_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).
- instance (::String) — Cloud SQL instance ID. This does not include the project ID.
- project (::String) — Project ID of the Cloud SQL project.
- body (::Google::Cloud::Sql::V1::SslCertsCreateEphemeralRequest, ::Hash)
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::SslCert)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationDeletes a Cloud SQL instance.
def delete(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationdelete via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesDeleteRequest or an equivalent Hash.
- 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::Operationdelete 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).
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationDemotes an existing standalone instance to be a Cloud SQL read replica for an external database server.
def demote(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationdemote via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesDemoteRequest or an equivalent Hash.
- 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::Operationdemote 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).
- instance (::String) — Required. Cloud SQL instance name.
- project (::String) — Required. ID of the project that contains the instance.
- body (::Google::Cloud::Sql::V1::InstancesDemoteRequest, ::Hash) — Required. The request body.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationDemotes the stand-alone instance to be a Cloud SQL read replica for an external database server.
def demote_master(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationdemote_master via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesDemoteMasterRequest or an equivalent Hash.
- 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::Operationdemote_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).
- instance (::String) — Cloud SQL instance name.
- project (::String) — ID of the project that contains the instance.
- body (::Google::Cloud::Sql::V1::InstancesDemoteMasterRequest, ::Hash)
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::SqlInstancesExecuteSqlResponseExecute SQL statements.
def execute_sql(request, options = nil) -> ::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlResponseexecute_sql via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesExecuteSqlRequest or an equivalent Hash.
- 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::SqlInstancesExecuteSqlResponseexecute_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).
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationExports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.
def export(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationexport via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesExportRequest or an equivalent Hash.
- 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::Operationexport 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).
- 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)
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationInitiates 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.
def failover(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationfailover via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesFailoverRequest or an equivalent Hash.
- 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::Operationfailover 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).
- instance (::String) — Cloud SQL instance ID. This does not include the project ID.
- project (::String) — ID of the project that contains the read replica.
- body (::Google::Cloud::Sql::V1::InstancesFailoverRequest, ::Hash)
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::DatabaseInstanceRetrieves a resource containing information about a Cloud SQL instance.
def get(request, options = nil) -> ::Google::Cloud::Sql::V1::DatabaseInstanceget via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesGetRequest or an equivalent Hash.
- 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::DatabaseInstanceget 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).
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::DatabaseInstance)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::SqlInstancesGetDiskShrinkConfigResponseGet Disk Shrink Config for a given instance.
def get_disk_shrink_config(request, options = nil) -> ::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigResponseget_disk_shrink_config via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigRequest or an equivalent Hash.
- 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::SqlInstancesGetDiskShrinkConfigResponseget_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).
- instance (::String) — Cloud SQL instance ID. This does not include the project ID.
- project (::String) — Project ID of the project that contains the instance.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::SqlInstancesGetLatestRecoveryTimeResponseGet Latest Recovery Time for a given instance.
def get_latest_recovery_time(request, options = nil) -> ::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeResponseget_latest_recovery_time via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeRequest or an equivalent Hash.
- 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::SqlInstancesGetLatestRecoveryTimeResponseget_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).
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationImports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.
def import(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationimport via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesImportRequest or an equivalent Hash.
- 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::Operationimport 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).
- 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::InstancesImportRequest, ::Hash)
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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| ... } -> ClientCreate a new SqlInstancesService client object.
- (config) — Configure the SqlInstancesService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# 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::OperationCreates a new Cloud SQL instance.
def insert(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationinsert via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesInsertRequest or an equivalent Hash.
- 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::Operationinsert 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).
- project (::String) — Project ID of the project to which the newly created Cloud SQL instances should belong.
- body (::Google::Cloud::Sql::V1::DatabaseInstance, ::Hash)
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::InstancesListResponseLists instances under a given project.
def list(request, options = nil) -> ::Google::Cloud::Sql::V1::InstancesListResponselist via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesListRequest or an equivalent Hash.
- 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::InstancesListResponselist 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).
-
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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::InstancesListResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::InstancesListEntraIdCertificatesResponseLists 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.
def list_entra_id_certificates(request, options = nil) -> ::Google::Cloud::Sql::V1::InstancesListEntraIdCertificatesResponselist_entra_id_certificates via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesListEntraIdCertificatesRequest or an equivalent Hash.
- 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::InstancesListEntraIdCertificatesResponselist_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).
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::InstancesListEntraIdCertificatesResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::InstancesListServerCasResponseLists 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.
def list_server_cas(request, options = nil) -> ::Google::Cloud::Sql::V1::InstancesListServerCasResponselist_server_cas via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesListServerCasRequest or an equivalent Hash.
- 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::InstancesListServerCasResponselist_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).
- instance (::String) — Cloud SQL instance ID. This does not include the project ID.
- project (::String) — Project ID of the project that contains the instance.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::InstancesListServerCasResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::InstancesListServerCertificatesResponseLists 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.
def list_server_certificates(request, options = nil) -> ::Google::Cloud::Sql::V1::InstancesListServerCertificatesResponselist_server_certificates via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesListServerCertificatesRequest or an equivalent Hash.
- 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::InstancesListServerCertificatesResponselist_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).
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::InstancesListServerCertificatesResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#patch
def patch(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
def patch(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::OperationPartially updates settings of a Cloud SQL instance by merging the request with the current configuration. This method supports patch semantics.
def patch(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationpatch via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesPatchRequest or an equivalent Hash.
- 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::Operationpatch 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).
- 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)
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationPerform Disk Shrink on primary instance.
def perform_disk_shrink(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationperform_disk_shrink via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesPerformDiskShrinkRequest or an equivalent Hash.
- 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::Operationperform_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).
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationPoint in time restore for an instance managed by Google Cloud Backup and Disaster Recovery.
def point_in_time_restore(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationpoint_in_time_restore via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesPointInTimeRestoreRequest or an equivalent Hash.
- 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::Operationpoint_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).
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationExecute MVU Pre-checks
def pre_check_major_version_upgrade(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationpre_check_major_version_upgrade via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesPreCheckMajorVersionUpgradeRequest or an equivalent Hash.
- 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::Operationpre_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).
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationPromotes the read replica instance to be an independent Cloud SQL primary instance. Using this operation might cause your instance to restart.
def promote_replica(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationpromote_replica via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesPromoteReplicaRequest or an equivalent Hash.
- 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::Operationpromote_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).
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationReencrypt CMEK instance with latest key version.
def reencrypt(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationreencrypt via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesReencryptRequest or an equivalent Hash.
- 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::Operationreencrypt 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).
- 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
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::SqlInstancesReleaseSsrsLeaseResponseRelease a lease for the setup of SQL Server Reporting Services (SSRS).
def release_ssrs_lease(request, options = nil) -> ::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseResponserelease_ssrs_lease via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseRequest or an equivalent Hash.
- 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::SqlInstancesReleaseSsrsLeaseResponserelease_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).
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationReschedules the maintenance on the given instance.
def reschedule_maintenance(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationreschedule_maintenance via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesRescheduleMaintenanceRequest or an equivalent Hash.
- 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::Operationreschedule_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).
- 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::SqlInstancesRescheduleMaintenanceRequestBody, ::Hash)
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationReset Replica Size to primary instance disk size.
def reset_replica_size(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationreset_replica_size via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesResetReplicaSizeRequest or an equivalent Hash.
- 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::Operationreset_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).
- instance (::String) — Cloud SQL read replica instance name.
- project (::String) — ID of the project that contains the read replica.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationDeletes all client certificates and generates a new server SSL certificate for the instance.
def reset_ssl_config(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationreset_ssl_config via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesResetSslConfigRequest or an equivalent Hash.
- 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::Operationreset_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).
- instance (::String) — Cloud SQL instance ID. This does not include the project ID.
- project (::String) — Project ID of the project that contains the instance.
- mode (::Google::Cloud::Sql::V1::SqlInstancesResetSslConfigRequest::ResetSslMode) — Optional. Reset SSL mode to use.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationRestarts a Cloud SQL instance.
def restart(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationrestart via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesRestartRequest or an equivalent Hash.
- 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::Operationrestart 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).
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationRestores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.
def restore_backup(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationrestore_backup via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesRestoreBackupRequest or an equivalent Hash.
- 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::Operationrestore_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).
- 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::InstancesRestoreBackupRequest, ::Hash)
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationRotates the server certificate version to one previously added with the addEntraIdCertificate method.
def rotate_entra_id_certificate(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationrotate_entra_id_certificate via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesRotateEntraIdCertificateRequest or an equivalent Hash.
- 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::Operationrotate_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).
- 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::InstancesRotateEntraIdCertificateRequest, ::Hash) — Optional. Rotate Entra ID certificate request body.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationRotates 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.
def rotate_server_ca(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationrotate_server_ca via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesRotateServerCaRequest or an equivalent Hash.
- 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::Operationrotate_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).
- 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::InstancesRotateServerCaRequest, ::Hash)
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationRotates 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.
def rotate_server_certificate(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationrotate_server_certificate via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesRotateServerCertificateRequest or an equivalent Hash.
- 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::Operationrotate_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).
- 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::InstancesRotateServerCertificateRequest, ::Hash) — Optional. Rotate server certificate request body.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationStart External primary instance migration.
def start_external_sync(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationstart_external_sync via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesStartExternalSyncRequest or an equivalent Hash.
- 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::Operationstart_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).
- instance (::String) — Cloud SQL instance ID. This does not include the project ID.
- project (::String) — ID of the project that contains the instance.
- sync_mode (::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest::ExternalSyncMode) — External sync mode.
- skip_verification (::Boolean) — Whether to skip the verification step (VESS).
- mysql_sync_config (::Google::Cloud::Sql::V1::MySqlSyncConfig, ::Hash) — MySQL-specific settings for start external sync.
- sync_parallel_level (::Google::Cloud::Sql::V1::ExternalSyncParallelLevel) — Optional. Parallel level for initial data sync. Currently only applicable for MySQL.
-
migration_type (::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest::MigrationType) — Optional. MigrationType configures the migration to use physical files or
logical dump files. If not set, then the logical dump file configuration is
used. Valid values are
LOGICALorPHYSICAL. Only applicable to MySQL. - replica_overwrite_enabled (::Boolean) — Optional. MySQL only. True if end-user has confirmed that this SES call will wipe replica databases overlapping with the proposed selected_objects. If this field is not set and there are both overlapping and additional databases proposed, an error will be returned.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationStarts the replication in the read replica instance.
def start_replica(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationstart_replica via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesStartReplicaRequest or an equivalent Hash.
- 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::Operationstart_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).
- instance (::String) — Cloud SQL read replica instance name.
- project (::String) — ID of the project that contains the read replica.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationStops the replication in the read replica instance.
def stop_replica(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationstop_replica via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesStopReplicaRequest or an equivalent Hash.
- 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::Operationstop_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).
- instance (::String) — Cloud SQL read replica instance name.
- project (::String) — ID of the project that contains the read replica.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationSwitches over from the primary instance to the DR replica instance.
def switchover(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationswitchover via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesSwitchoverRequest or an equivalent Hash.
- 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::Operationswitchover 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).
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::OperationTruncate MySQL general and slow query log tables MySQL only.
def truncate_log(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationtruncate_log via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesTruncateLogRequest or an equivalent Hash.
- 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::Operationtruncate_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).
- instance (::String) — Cloud SQL instance ID. This does not include the project ID.
- project (::String) — Project ID of the Cloud SQL project.
- body (::Google::Cloud::Sql::V1::InstancesTruncateLogRequest, ::Hash)
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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() -> StringThe effective universe domain
- (String)
#update
def update(request, options = nil) -> ::Google::Cloud::Sql::V1::Operation
def update(instance: nil, project: nil, body: nil) -> ::Google::Cloud::Sql::V1::OperationUpdates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.
def update(request, options = nil) -> ::Google::Cloud::Sql::V1::Operationupdate via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesUpdateRequest or an equivalent Hash.
- 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::Operationupdate 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).
- 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)
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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::SqlInstancesVerifyExternalSyncSettingsResponseVerify External primary instance external sync settings.
def verify_external_sync_settings(request, options = nil) -> ::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsResponseverify_external_sync_settings via a request object, either of type
Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest or an equivalent Hash.
- 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::SqlInstancesVerifyExternalSyncSettingsResponseverify_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).
- instance (::String) — Cloud SQL instance ID. This does not include the project ID.
- project (::String) — Project ID of the project that contains the instance.
- verify_connection_only (::Boolean) — Flag to enable verifying connection only
- sync_mode (::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest::ExternalSyncMode) — External sync mode
- verify_replication_only (::Boolean) — Optional. Flag to verify settings required by replication setup only
- mysql_sync_config (::Google::Cloud::Sql::V1::MySqlSyncConfig, ::Hash) — Optional. MySQL-specific settings for start external sync.
-
migration_type (::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest::MigrationType) — Optional. MigrationType configures the migration to use physical files or
logical dump files. If not set, then the logical dump file configuration is
used. Valid values are
LOGICALorPHYSICAL. Only applicable to MySQL. - sync_parallel_level (::Google::Cloud::Sql::V1::ExternalSyncParallelLevel) — Optional. Parallel level for initial data sync. Only applicable for PostgreSQL.
- selected_objects (::Array<::Google::Cloud::Sql::V1::ExternalSyncSelectedObject, ::Hash>) — Optional. Migrate only the specified objects from the source instance. If this field is empty, then migrate all objects.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/sql/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Sql::V1::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