Class: Google::Cloud::Sql::V1::SqlInstancesService::Client
- Inherits:
-
Object
- Object
- Google::Cloud::Sql::V1::SqlInstancesService::Client
- Includes:
- Paths
- Defined in:
- lib/google/cloud/sql/v1/sql_instances_service/client.rb
Overview
Client for the SqlInstancesService service.
Defined Under Namespace
Classes: Configuration
Instance Attribute Summary collapse
-
#location_client ⇒ Google::Cloud::Location::Locations::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) {|response, 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) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Adds a new Entra ID certificate for the specified instance.
-
#add_server_ca(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Adds a new trusted Certificate Authority (CA) version for the specified instance.
-
#add_server_certificate(request, options = nil) {|response, 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) {|response, 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) {|response, 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) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Deletes a Cloud SQL instance.
-
#demote(request, options = nil) {|response, 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) {|response, 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) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlResponse
Execute SQL statements.
-
#export(request, options = nil) {|response, 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) {|response, 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) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::DatabaseInstance
Retrieves a resource containing information about a Cloud SQL instance.
-
#get_disk_shrink_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigResponse
Get Disk Shrink Config for a given instance.
-
#get_latest_recovery_time(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeResponse
Get Latest Recovery Time for a given instance.
-
#import(request, options = nil) {|response, 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 client object.
-
#insert(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Creates a new Cloud SQL instance.
-
#list(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::InstancesListResponse
Lists instances under a given project.
-
#list_entra_id_certificates(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::InstancesListEntraIdCertificatesResponse
Lists all versions of EntraID certificates for the specified instance.
-
#list_server_cas(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::InstancesListServerCasResponse
Lists all of the trusted Certificate Authorities (CAs) for the specified instance.
-
#list_server_certificates(request, options = nil) {|response, 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) {|response, 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) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Perform Disk Shrink on primary instance.
-
#point_in_time_restore(request, options = nil) {|response, 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) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Execute MVU Pre-checks.
-
#promote_replica(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Promotes the read replica instance to be an independent Cloud SQL primary instance.
-
#reencrypt(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Reencrypt CMEK instance with latest key version.
-
#release_ssrs_lease(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseResponse
Release a lease for the setup of SQL Server Reporting Services (SSRS).
-
#reschedule_maintenance(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Reschedules the maintenance on the given instance.
-
#reset_replica_size(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Reset Replica Size to primary instance disk size.
-
#reset_ssl_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Deletes all client certificates and generates a new server SSL certificate for the instance.
-
#restart(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Restarts a Cloud SQL instance.
-
#restore_backup(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Restores a backup of a Cloud SQL instance.
-
#rotate_entra_id_certificate(request, options = nil) {|response, 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) {|response, 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) {|response, 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) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Start External primary instance migration.
-
#start_replica(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Starts the replication in the read replica instance.
-
#stop_replica(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Stops the replication in the read replica instance.
-
#switchover(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Switches over from the primary instance to the DR replica instance.
-
#truncate_log(request, options = nil) {|response, 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) {|response, operation| ... } ⇒ ::Google::Cloud::Sql::V1::Operation
Updates settings of a Cloud SQL instance.
-
#verify_external_sync_settings(request, options = nil) {|response, 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 client object.
125 126 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 176 177 178 179 180 181 182 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 125 def initialize # These require statements are intentionally placed here to initialize # the gRPC module only when it's required. # See https://github.com/googleapis/toolkit/issues/446 require "gapic/grpc" require "google/cloud/sql/v1/cloud_sql_instances_services_pb" # 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 = ::Gapic::ServiceStub.new( ::Google::Cloud::Sql::V1::SqlInstancesService::Stub, credentials: credentials, endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, channel_args: @config.channel_args, interceptors: @config.interceptors, channel_pool_config: @config.channel_pool, logger: @config.logger ) @sql_instances_service_stub.stub_logger&.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::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::Client (readonly)
Get the associated client for mix-in of the Locations.
189 190 191 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 189 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.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 61 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).
3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 3919 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :acquire_ssrs_lease, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 442 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :add_entra_id_certificate, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
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 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 254 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :add_server_ca, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 350 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :add_server_certificate, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 535 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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_rpc :call_clone, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
95 96 97 98 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 95 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.
3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 3059 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :create_ephemeral, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 638 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :delete, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
823 824 825 826 827 828 829 830 831 832 833 834 835 836 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 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 823 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :demote, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 730 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :demote_master, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 3823 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :execute_sql, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
915 916 917 918 919 920 921 922 923 924 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 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 915 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :export, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
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 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 1013 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :failover, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 1195 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :get, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 3548 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :get_disk_shrink_config, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 3731 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :get_latest_recovery_time, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 1287 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :import, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 1377 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :insert, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 1480 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :list, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
1759 1760 1761 1762 1763 1764 1765 1766 1767 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/client.rb', line 1759 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :list_entra_id_certificates, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 1571 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :list_server_cas, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 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 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 1666 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :list_server_certificates, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#logger ⇒ Logger
The logger used for request/response debug logging.
196 197 198 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 196 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.
1851 1852 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 1887 1888 1889 1890 1891 1892 1893 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 1851 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :patch, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 3458 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :perform_disk_shrink, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 4198 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :point_in_time_restore, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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
4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 4105 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :pre_check_major_version_upgrade, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 1950 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :promote_replica, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 1105 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :reencrypt, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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).
4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 4012 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :release_ssrs_lease, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 3150 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :reschedule_maintenance, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 3638 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :reset_replica_size, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 2138 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :reset_ssl_config, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 2228 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :restart, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 2320 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :restore_backup, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 2601 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :rotate_entra_id_certificate, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 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 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 2414 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :rotate_server_ca, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
2508 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 2543 2544 2545 2546 2547 2548 2549 2550 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 2508 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :rotate_server_certificate, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
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 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 3366 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :start_external_sync, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 2691 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :start_replica, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 2781 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :stop_replica, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 2045 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :switchover, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 2873 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :truncate_log, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#universe_domain ⇒ String
The effective universe domain
105 106 107 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 105 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.
2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 2965 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :update, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => 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.
3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 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 |
# File 'lib/google/cloud/sql/v1/sql_instances_service/client.rb', line 3258 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 [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.project header_params["project"] = request.project end if request.instance header_params["instance"] = request.instance end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .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.call_rpc :verify_external_sync_settings, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |