Class: Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client
- Inherits:
-
Object
- Object
- Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client
- Includes:
- Paths
- Defined in:
- lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb
Overview
REST client for the SqlInstancesService service.
Defined Under Namespace
Classes: Configuration
Instance Attribute Summary collapse
-
#location_client ⇒ Google::Cloud::Location::Locations::Rest::Client
readonly
Get the associated client for mix-in of the Locations.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the SqlInstancesService Client class.
Instance Method Summary collapse
-
#acquire_ssrs_lease(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseResponse
Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
-
#add_entra_id_certificate(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Adds a new Entra ID certificate for the specified instance.
-
#add_server_ca(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Adds a new trusted Certificate Authority (CA) version for the specified instance.
-
#add_server_certificate(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Add a new trusted server certificate version for the specified instance using Certificate Authority Service (CAS) server CA.
-
#call_clone(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Creates a Cloud SQL instance as a clone of the source instance.
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the SqlInstancesService Client instance.
-
#create_ephemeral(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::SslCert
Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance.
-
#delete(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Deletes a Cloud SQL instance.
-
#demote(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Demotes an existing standalone instance to be a Cloud SQL read replica for an external database server.
-
#demote_master(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.
-
#execute_sql(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlResponse
Execute SQL statements.
-
#export(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.
-
#failover(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Initiates a manual failover of a high availability (HA) primary instance to a standby instance, which becomes the primary instance.
-
#get(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::DatabaseInstance
Retrieves a resource containing information about a Cloud SQL instance.
-
#get_disk_shrink_config(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigResponse
Get Disk Shrink Config for a given instance.
-
#get_latest_recovery_time(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeResponse
Get Latest Recovery Time for a given instance.
-
#import(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new SqlInstancesService REST client object.
-
#insert(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Creates a new Cloud SQL instance.
-
#list(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::InstancesListResponse
Lists instances under a given project.
-
#list_entra_id_certificates(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::InstancesListEntraIdCertificatesResponse
Lists all versions of EntraID certificates for the specified instance.
-
#list_server_cas(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::InstancesListServerCasResponse
Lists all of the trusted Certificate Authorities (CAs) for the specified instance.
-
#list_server_certificates(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::InstancesListServerCertificatesResponse
Lists all versions of server certificates and certificate authorities (CAs) for the specified instance.
-
#logger ⇒ Logger
The logger used for request/response debug logging.
-
#patch(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Partially updates settings of a Cloud SQL instance by merging the request with the current configuration.
-
#perform_disk_shrink(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Perform Disk Shrink on primary instance.
-
#point_in_time_restore(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Point in time restore for an instance managed by Google Cloud Backup and Disaster Recovery.
-
#pre_check_major_version_upgrade(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Execute MVU Pre-checks.
-
#promote_replica(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Promotes the read replica instance to be an independent Cloud SQL primary instance.
-
#reencrypt(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Reencrypt CMEK instance with latest key version.
-
#release_ssrs_lease(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseResponse
Release a lease for the setup of SQL Server Reporting Services (SSRS).
-
#reschedule_maintenance(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Reschedules the maintenance on the given instance.
-
#reset_replica_size(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Reset Replica Size to primary instance disk size.
-
#reset_ssl_config(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Deletes all client certificates and generates a new server SSL certificate for the instance.
-
#restart(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Restarts a Cloud SQL instance.
-
#restore_backup(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Restores a backup of a Cloud SQL instance.
-
#rotate_entra_id_certificate(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Rotates the server certificate version to one previously added with the addEntraIdCertificate method.
-
#rotate_server_ca(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.
-
#rotate_server_certificate(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Rotates the server certificate version to one previously added with the addServerCertificate method.
-
#start_external_sync(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Start External primary instance migration.
-
#start_replica(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Starts the replication in the read replica instance.
-
#stop_replica(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Stops the replication in the read replica instance.
-
#switchover(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Switches over from the primary instance to the DR replica instance.
-
#truncate_log(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Truncate MySQL general and slow query log tables MySQL only.
-
#universe_domain ⇒ String
The effective universe domain.
-
#update(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Updates settings of a Cloud SQL instance.
-
#verify_external_sync_settings(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsResponse
Verify External primary instance external sync settings.
Methods included from Paths
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new SqlInstancesService REST client object.
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 127 def initialize # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.endpoint.nil? || (@config.endpoint == Configuration::DEFAULT_ENDPOINT && !@config.endpoint.split(".").first.include?("-")) credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @sql_instances_service_stub = ::Google::Cloud::Sql::V1::SqlInstancesService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials, logger: @config.logger ) @sql_instances_service_stub.logger(stub: true)&.info do |entry| entry.set_system_name entry.set_service entry. = "Created client for #{entry.service}" entry.set_credentials_fields credentials entry.set "customEndpoint", @config.endpoint if @config.endpoint entry.set "defaultTimeout", @config.timeout if @config.timeout entry.set "quotaProject", @quota_project_id if @quota_project_id end @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @sql_instances_service_stub.endpoint config.universe_domain = @sql_instances_service_stub.universe_domain config.logger = @sql_instances_service_stub.logger if config.respond_to? :logger= end end |
Instance Attribute Details
#location_client ⇒ Google::Cloud::Location::Locations::Rest::Client (readonly)
Get the associated client for mix-in of the Locations.
182 183 184 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 182 def location_client @location_client end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the SqlInstancesService Client class.
See Configuration for a description of the configuration fields.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 63 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "Sql", "V1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config.timeout = 60.0 default_config end yield @configure if block_given? @configure end |
Instance Method Details
#acquire_ssrs_lease(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseResponse #acquire_ssrs_lease(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseResponse
Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 3527 def acquire_ssrs_lease request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.acquire_ssrs_lease..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.acquire_ssrs_lease.timeout, metadata: , retry_policy: @config.rpcs.acquire_ssrs_lease.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.acquire_ssrs_lease request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#add_entra_id_certificate(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #add_entra_id_certificate(instance: nil, project: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Adds a new Entra ID certificate for the specified instance. If an Entra ID certificate was previously added but never used in a certificate rotation, this operation replaces that version.
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 414 def add_entra_id_certificate request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesAddEntraIdCertificateRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.add_entra_id_certificate..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.add_entra_id_certificate.timeout, metadata: , retry_policy: @config.rpcs.add_entra_id_certificate.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.add_entra_id_certificate request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#add_server_ca(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #add_server_ca(instance: nil, project: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Adds a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in. For instances that have enabled Certificate Authority Service (CAS) based server CA, use AddServerCertificate to add a new server certificate.
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 246 def add_server_ca request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesAddServerCaRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.add_server_ca..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.add_server_ca.timeout, metadata: , retry_policy: @config.rpcs.add_server_ca.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.add_server_ca request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#add_server_certificate(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #add_server_certificate(instance: nil, project: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Add a new trusted server certificate version for the specified instance using Certificate Authority Service (CAS) server CA. Required to prepare for a certificate rotation. If a server certificate version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one certificate version waiting to be rotated in. For instances not using CAS server CA, use AddServerCa instead.
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 332 def add_server_certificate request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesAddServerCertificateRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.add_server_certificate..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.add_server_certificate.timeout, metadata: , retry_policy: @config.rpcs.add_server_certificate.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.add_server_certificate request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#call_clone(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #call_clone(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.
497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 497 def call_clone request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesCloneRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.call_clone..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.call_clone.timeout, metadata: , retry_policy: @config.rpcs.call_clone.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.call_clone request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#configure {|config| ... } ⇒ Client::Configuration
Configure the SqlInstancesService Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.
See Configuration for a description of the configuration fields.
97 98 99 100 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 97 def configure yield @config if block_given? @config end |
#create_ephemeral(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::SslCert #create_ephemeral(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::SslCert
Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database.
2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 2757 def create_ephemeral request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesCreateEphemeralCertRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_ephemeral..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.create_ephemeral.timeout, metadata: , retry_policy: @config.rpcs.create_ephemeral.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.create_ephemeral request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#delete(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #delete(instance: nil, project: nil, enable_final_backup: nil, final_backup_ttl_days: nil, final_backup_expiry_time: nil, final_backup_description: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Deletes a Cloud SQL instance.
590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 590 def delete request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesDeleteRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.delete.timeout, metadata: , retry_policy: @config.rpcs.delete.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.delete request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#demote(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #demote(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Demotes an existing standalone instance to be a Cloud SQL read replica for an external database server.
755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 755 def demote request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesDemoteRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.demote..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.demote.timeout, metadata: , retry_policy: @config.rpcs.demote.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.demote request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#demote_master(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #demote_master(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.
672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 672 def demote_master request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesDemoteMasterRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.demote_master..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.demote_master.timeout, metadata: , retry_policy: @config.rpcs.demote_master.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.demote_master request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#execute_sql(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlResponse #execute_sql(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlResponse
Execute SQL statements.
3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 3441 def execute_sql request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.execute_sql..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.execute_sql.timeout, metadata: , retry_policy: @config.rpcs.execute_sql.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.execute_sql request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#export(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #export(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.
837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 837 def export request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesExportRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.export..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.export.timeout, metadata: , retry_policy: @config.rpcs.export.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.export request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#failover(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #failover(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Initiates a manual failover of a high availability (HA) primary instance to a standby instance, which becomes the primary instance. Users are then rerouted to the new primary. For more information, see the Overview of high availability page in the Cloud SQL documentation. If using Legacy HA (MySQL only), this causes the instance to failover to its failover replica instance.
925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 925 def failover request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesFailoverRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.failover..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.failover.timeout, metadata: , retry_policy: @config.rpcs.failover.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.failover request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::DatabaseInstance #get(instance: nil, project: nil) ⇒ ::Google::Cloud::Sql::V1::DatabaseInstance
Retrieves a resource containing information about a Cloud SQL instance.
1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 1087 def get request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesGetRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get.timeout, metadata: , retry_policy: @config.rpcs.get.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.get request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_disk_shrink_config(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigResponse #get_disk_shrink_config(instance: nil, project: nil) ⇒ ::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigResponse
Get Disk Shrink Config for a given instance.
3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 3196 def get_disk_shrink_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_disk_shrink_config..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get_disk_shrink_config.timeout, metadata: , retry_policy: @config.rpcs.get_disk_shrink_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.get_disk_shrink_config request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_latest_recovery_time(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeResponse #get_latest_recovery_time(instance: nil, project: nil, source_instance_deletion_time: nil) ⇒ ::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeResponse
Get Latest Recovery Time for a given instance.
3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 3359 def get_latest_recovery_time request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_latest_recovery_time..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get_latest_recovery_time.timeout, metadata: , retry_policy: @config.rpcs.get_latest_recovery_time.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.get_latest_recovery_time request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#import(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #import(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.
1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 1169 def import request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesImportRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.import..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.import.timeout, metadata: , retry_policy: @config.rpcs.import.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.import request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#insert(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #insert(project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Creates a new Cloud SQL instance.
1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 1249 def insert request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesInsertRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.insert..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.insert.timeout, metadata: , retry_policy: @config.rpcs.insert.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.insert request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::InstancesListResponse #list(filter: nil, max_results: nil, page_token: nil, project: nil) ⇒ ::Google::Cloud::Sql::V1::InstancesListResponse
Lists instances under a given project.
1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 1345 def list request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesListRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.list.timeout, metadata: , retry_policy: @config.rpcs.list.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.list request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list_entra_id_certificates(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::InstancesListEntraIdCertificatesResponse #list_entra_id_certificates(instance: nil, project: nil) ⇒ ::Google::Cloud::Sql::V1::InstancesListEntraIdCertificatesResponse
Lists all versions of EntraID certificates for the specified instance. There can be up to three sets of certificates listed: the certificate that is currently in use, a future that has been added but not yet used to sign a certificate, and a certificate that has been rotated out.
1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 1597 def list_entra_id_certificates request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesListEntraIdCertificatesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_entra_id_certificates..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.list_entra_id_certificates.timeout, metadata: , retry_policy: @config.rpcs.list_entra_id_certificates.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.list_entra_id_certificates request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list_server_cas(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::InstancesListServerCasResponse #list_server_cas(instance: nil, project: nil) ⇒ ::Google::Cloud::Sql::V1::InstancesListServerCasResponse
Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out.
1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 1429 def list_server_cas request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesListServerCasRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_server_cas..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.list_server_cas.timeout, metadata: , retry_policy: @config.rpcs.list_server_cas.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.list_server_cas request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list_server_certificates(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::InstancesListServerCertificatesResponse #list_server_certificates(instance: nil, project: nil) ⇒ ::Google::Cloud::Sql::V1::InstancesListServerCertificatesResponse
Lists all versions of server certificates and certificate authorities (CAs) for the specified instance. There can be up to three sets of certs listed: the certificate that is currently in use, a future that has been added but not yet used to sign a certificate, and a certificate that has been rotated out. For instances not using Certificate Authority Service (CAS) server CA, use ListServerCas instead.
1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 1514 def list_server_certificates request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesListServerCertificatesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_server_certificates..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.list_server_certificates.timeout, metadata: , retry_policy: @config.rpcs.list_server_certificates.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.list_server_certificates request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#logger ⇒ Logger
The logger used for request/response debug logging.
189 190 191 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 189 def logger @sql_instances_service_stub.logger end |
#patch(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #patch(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Partially updates settings of a Cloud SQL instance by merging the request with the current configuration. This method supports patch semantics.
1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 1679 def patch request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesPatchRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.patch..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.patch.timeout, metadata: , retry_policy: @config.rpcs.patch.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.patch request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#perform_disk_shrink(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #perform_disk_shrink(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Perform Disk Shrink on primary instance.
3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 3116 def perform_disk_shrink request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesPerformDiskShrinkRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.perform_disk_shrink..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.perform_disk_shrink.timeout, metadata: , retry_policy: @config.rpcs.perform_disk_shrink.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.perform_disk_shrink request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#point_in_time_restore(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #point_in_time_restore(parent: nil, context: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Point in time restore for an instance managed by Google Cloud Backup and Disaster Recovery.
3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 3776 def point_in_time_restore request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesPointInTimeRestoreRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.point_in_time_restore..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.point_in_time_restore.timeout, metadata: , retry_policy: @config.rpcs.point_in_time_restore.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.point_in_time_restore request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#pre_check_major_version_upgrade(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #pre_check_major_version_upgrade(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Execute MVU Pre-checks
3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 3693 def pre_check_major_version_upgrade request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesPreCheckMajorVersionUpgradeRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.pre_check_major_version_upgrade..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.pre_check_major_version_upgrade.timeout, metadata: , retry_policy: @config.rpcs.pre_check_major_version_upgrade.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.pre_check_major_version_upgrade request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#promote_replica(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #promote_replica(instance: nil, project: nil, failover: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Promotes the read replica instance to be an independent Cloud SQL primary instance. Using this operation might cause your instance to restart.
1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 1768 def promote_replica request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesPromoteReplicaRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.promote_replica..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.promote_replica.timeout, metadata: , retry_policy: @config.rpcs.promote_replica.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.promote_replica request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#reencrypt(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #reencrypt(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Reencrypt CMEK instance with latest key version.
1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 1007 def reencrypt request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesReencryptRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.reencrypt..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.reencrypt.timeout, metadata: , retry_policy: @config.rpcs.reencrypt.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.reencrypt request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#release_ssrs_lease(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseResponse #release_ssrs_lease(instance: nil, project: nil) ⇒ ::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseResponse
Release a lease for the setup of SQL Server Reporting Services (SSRS).
3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 3610 def release_ssrs_lease request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.release_ssrs_lease..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.release_ssrs_lease.timeout, metadata: , retry_policy: @config.rpcs.release_ssrs_lease.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.release_ssrs_lease request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#reschedule_maintenance(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #reschedule_maintenance(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Reschedules the maintenance on the given instance.
2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 2838 def reschedule_maintenance request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesRescheduleMaintenanceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.reschedule_maintenance..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.reschedule_maintenance.timeout, metadata: , retry_policy: @config.rpcs.reschedule_maintenance.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.reschedule_maintenance request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#reset_replica_size(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #reset_replica_size(instance: nil, project: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Reset Replica Size to primary instance disk size.
3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 3276 def reset_replica_size request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesResetReplicaSizeRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.reset_replica_size..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.reset_replica_size.timeout, metadata: , retry_policy: @config.rpcs.reset_replica_size.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.reset_replica_size request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#reset_ssl_config(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #reset_ssl_config(instance: nil, project: nil, mode: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Deletes all client certificates and generates a new server SSL certificate for the instance.
1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 1936 def reset_ssl_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesResetSslConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.reset_ssl_config..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.reset_ssl_config.timeout, metadata: , retry_policy: @config.rpcs.reset_ssl_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.reset_ssl_config request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#restart(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #restart(instance: nil, project: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Restarts a Cloud SQL instance.
2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 2016 def restart request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesRestartRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.restart..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.restart.timeout, metadata: , retry_policy: @config.rpcs.restart.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.restart request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#restore_backup(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #restore_backup(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.
2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 2098 def restore_backup request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesRestoreBackupRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.restore_backup..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.restore_backup.timeout, metadata: , retry_policy: @config.rpcs.restore_backup.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.restore_backup request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#rotate_entra_id_certificate(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #rotate_entra_id_certificate(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Rotates the server certificate version to one previously added with the addEntraIdCertificate method.
2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 2349 def rotate_entra_id_certificate request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesRotateEntraIdCertificateRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.rotate_entra_id_certificate..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.rotate_entra_id_certificate.timeout, metadata: , retry_policy: @config.rpcs.rotate_entra_id_certificate.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.rotate_entra_id_certificate request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#rotate_server_ca(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #rotate_server_ca(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method. For instances that have enabled Certificate Authority Service (CAS) based server CA, use RotateServerCertificate to rotate the server certificate.
2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 2182 def rotate_server_ca request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesRotateServerCaRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.rotate_server_ca..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.rotate_server_ca.timeout, metadata: , retry_policy: @config.rpcs.rotate_server_ca.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.rotate_server_ca request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#rotate_server_certificate(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #rotate_server_certificate(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Rotates the server certificate version to one previously added with the addServerCertificate method. For instances not using Certificate Authority Service (CAS) server CA, use RotateServerCa instead.
2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 2266 def rotate_server_certificate request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesRotateServerCertificateRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.rotate_server_certificate..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.rotate_server_certificate.timeout, metadata: , retry_policy: @config.rpcs.rotate_server_certificate.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.rotate_server_certificate request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#start_external_sync(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #start_external_sync(instance: nil, project: nil, sync_mode: nil, skip_verification: nil, mysql_sync_config: nil, sync_parallel_level: nil, migration_type: nil, replica_overwrite_enabled: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Start External primary instance migration.
3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 3034 def start_external_sync request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesStartExternalSyncRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.start_external_sync..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.start_external_sync.timeout, metadata: , retry_policy: @config.rpcs.start_external_sync.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.start_external_sync request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#start_replica(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #start_replica(instance: nil, project: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Starts the replication in the read replica instance.
2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 2429 def start_replica request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesStartReplicaRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.start_replica..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.start_replica.timeout, metadata: , retry_policy: @config.rpcs.start_replica.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.start_replica request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#stop_replica(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #stop_replica(instance: nil, project: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Stops the replication in the read replica instance.
2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 2509 def stop_replica request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesStopReplicaRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.stop_replica..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.stop_replica.timeout, metadata: , retry_policy: @config.rpcs.stop_replica.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.stop_replica request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#switchover(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #switchover(instance: nil, project: nil, db_timeout: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Switches over from the primary instance to the DR replica instance.
1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 1853 def switchover request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesSwitchoverRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.switchover..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.switchover.timeout, metadata: , retry_policy: @config.rpcs.switchover.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.switchover request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#truncate_log(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #truncate_log(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Truncate MySQL general and slow query log tables MySQL only.
2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 2591 def truncate_log request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesTruncateLogRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.truncate_log..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.truncate_log.timeout, metadata: , retry_policy: @config.rpcs.truncate_log.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.truncate_log request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#universe_domain ⇒ String
The effective universe domain
107 108 109 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 107 def universe_domain @sql_instances_service_stub.universe_domain end |
#update(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::Operation #update(instance: nil, project: nil, body: nil) ⇒ ::Google::Cloud::Sql::V1::Operation
Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.
2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 2673 def update request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesUpdateRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.update.timeout, metadata: , retry_policy: @config.rpcs.update.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.update request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#verify_external_sync_settings(request, options = nil) ⇒ ::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsResponse #verify_external_sync_settings(instance: nil, project: nil, verify_connection_only: nil, sync_mode: nil, verify_replication_only: nil, mysql_sync_config: nil, migration_type: nil, sync_parallel_level: nil, selected_objects: nil) ⇒ ::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsResponse
Verify External primary instance external sync settings.
2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb', line 2936 def verify_external_sync_settings request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.verify_external_sync_settings..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Sql::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.verify_external_sync_settings.timeout, metadata: , retry_policy: @config.rpcs.verify_external_sync_settings.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @sql_instances_service_stub.verify_external_sync_settings request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |