Class: Google::Apis::SqlV1beta4::SQLAdminService

Inherits:
Core::BaseService show all
Defined in:
generated/google/apis/sql_v1beta4/service.rb

Overview

Cloud SQL Admin API

API for Cloud SQL database instance management

Examples:

require 'google/apis/sql_v1beta4'

Sql = Google::Apis::SqlV1beta4 # Alias the module
service = Sql::SQLAdminService.new

See Also:

Instance Attribute Summary collapse

Attributes inherited from Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Methods included from Core::Logging

#logger

Constructor Details

#initializeSQLAdminService

Returns a new instance of SQLAdminService



45
46
47
48
# File 'generated/google/apis/sql_v1beta4/service.rb', line 45

def initialize
  super('https://sqladmin.googleapis.com/', '')
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

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

Returns:

  • (String)

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



38
39
40
# File 'generated/google/apis/sql_v1beta4/service.rb', line 38

def key
  @key
end

#quota_userString

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

Returns:

  • (String)

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



43
44
45
# File 'generated/google/apis/sql_v1beta4/service.rb', line 43

def quota_user
  @quota_user
end

Instance Method Details

#add_instance_server_ca(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

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

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • parent (String)

    The parent resource where Cloud SQL should add this server CA. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



513
514
515
516
517
518
519
520
521
522
523
# File 'generated/google/apis/sql_v1beta4/service.rb', line 513

def add_instance_server_ca(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/addServerCa', options)
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#clone_instance(project, instance, instances_clone_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Creates a Cloud SQL instance as a clone of the source instance.

Parameters:

  • project (String)

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

  • instance (String)

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

  • instances_clone_request_object (Google::Apis::SqlV1beta4::InstancesCloneRequest) (defaults to: nil)
  • parent (String)

    The parent resource where Cloud SQL should clone this instance. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



552
553
554
555
556
557
558
559
560
561
562
563
564
# File 'generated/google/apis/sql_v1beta4/service.rb', line 552

def clone_instance(project, instance, instances_clone_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/clone', options)
  command.request_representation = Google::Apis::SqlV1beta4::InstancesCloneRequest::Representation
  command.request_object = instances_clone_request_object
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_ssl_cert_ephemeral(project, instance, ssl_certs_create_ephemeral_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::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.

Parameters:

  • project (String)

    Project ID of the Cloud SQL project.

  • instance (String)

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

  • ssl_certs_create_ephemeral_request_object (Google::Apis::SqlV1beta4::SslCertsCreateEphemeralRequest) (defaults to: nil)
  • parent (String)

    The parent resource where Cloud SQL creates this ephemeral certificate. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1418

def create_ssl_cert_ephemeral(project, instance, ssl_certs_create_ephemeral_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral', options)
  command.request_representation = Google::Apis::SqlV1beta4::SslCertsCreateEphemeralRequest::Representation
  command.request_object = ssl_certs_create_ephemeral_request_object
  command.response_representation = Google::Apis::SqlV1beta4::SslCert::Representation
  command.response_class = Google::Apis::SqlV1beta4::SslCert
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_backup_run(project, instance, id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Deletes the backup taken by a backup run.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • id (Fixnum)

    The ID of the Backup Run to delete. To find a Backup Run ID, use the list method.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



76
77
78
79
80
81
82
83
84
85
86
# File 'generated/google/apis/sql_v1beta4/service.rb', line 76

def delete_backup_run(project, instance, id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}', options)
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_database(project, instance, database, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Deletes a database from a Cloud SQL instance.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • database (String)

    Name of the database to be deleted in the instance.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



240
241
242
243
244
245
246
247
248
249
250
# File 'generated/google/apis/sql_v1beta4/service.rb', line 240

def delete_database(project, instance, database, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}', options)
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.params['database'] = database unless database.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_instance(project, instance, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Deletes a Cloud SQL instance.

Parameters:

  • project (String)

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

  • instance (String)

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

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



588
589
590
591
592
593
594
595
596
597
# File 'generated/google/apis/sql_v1beta4/service.rb', line 588

def delete_instance(project, instance, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_ssl_cert(project, instance, sha1_fingerprint, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • sha1_fingerprint (String)

    Sha1 FingerPrint.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1457

def delete_ssl_cert(project, instance, sha1_fingerprint, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}', options)
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.params['sha1Fingerprint'] = sha1_fingerprint unless sha1_fingerprint.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_user(project, instance, host: nil, name: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Deletes a user from a Cloud SQL instance.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • host (String)

    Host of the user in the instance.

  • name (String)

    Name of the user in the instance.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1649

def delete_user(project, instance, host: nil, name: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'sql/v1beta4/projects/{project}/instances/{instance}/users', options)
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['host'] = host unless host.nil?
  command.query['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#demote_instance_master(project, instance, instances_demote_master_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

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

Parameters:

  • project (String)

    ID of the project that contains the instance.

  • instance (String)

    Cloud SQL instance name.

  • instances_demote_master_request_object (Google::Apis::SqlV1beta4::InstancesDemoteMasterRequest) (defaults to: nil)
  • parent (String)

    The parent resource where Cloud SQL demotes this master database instance. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



626
627
628
629
630
631
632
633
634
635
636
637
638
# File 'generated/google/apis/sql_v1beta4/service.rb', line 626

def demote_instance_master(project, instance, instances_demote_master_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster', options)
  command.request_representation = Google::Apis::SqlV1beta4::InstancesDemoteMasterRequest::Representation
  command.request_object = instances_demote_master_request_object
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#export_instance(project, instance, instances_export_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

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

Parameters:

  • project (String)

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

  • instance (String)

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

  • instances_export_request_object (Google::Apis::SqlV1beta4::InstancesExportRequest) (defaults to: nil)
  • parent (String)

    The parent resource where Cloud SQL exports this database instance. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



667
668
669
670
671
672
673
674
675
676
677
678
679
# File 'generated/google/apis/sql_v1beta4/service.rb', line 667

def export_instance(project, instance, instances_export_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/export', options)
  command.request_representation = Google::Apis::SqlV1beta4::InstancesExportRequest::Representation
  command.request_object = instances_export_request_object
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#failover_instance(project, instance, instances_failover_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Failover the instance to its failover replica instance.

Parameters:

  • project (String)

    ID of the project that contains the read replica.

  • instance (String)

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

  • instances_failover_request_object (Google::Apis::SqlV1beta4::InstancesFailoverRequest) (defaults to: nil)
  • parent (String)

    The parent resource where Cloud SQL sends this database instance during a failover. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



708
709
710
711
712
713
714
715
716
717
718
719
720
# File 'generated/google/apis/sql_v1beta4/service.rb', line 708

def failover_instance(project, instance, instances_failover_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/failover', options)
  command.request_representation = Google::Apis::SqlV1beta4::InstancesFailoverRequest::Representation
  command.request_object = instances_failover_request_object
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_backup_run(project, instance, id, resource_name: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::BackupRun

Retrieves a resource containing information about a backup run.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • id (Fixnum)

    The ID of this Backup Run.

  • resource_name (String)

    Name of the resource backupRun. Format: projects/project/locations/location/instances/instance/backupRuns/ backupRun

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



117
118
119
120
121
122
123
124
125
126
127
128
# File 'generated/google/apis/sql_v1beta4/service.rb', line 117

def get_backup_run(project, instance, id, resource_name: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}', options)
  command.response_representation = Google::Apis::SqlV1beta4::BackupRun::Representation
  command.response_class = Google::Apis::SqlV1beta4::BackupRun
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.params['id'] = id unless id.nil?
  command.query['resourceName'] = resource_name unless resource_name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_database(project, instance, database, resource_name: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Database

Retrieves a resource containing information about a database inside a Cloud SQL instance.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • database (String)

    Name of the database in the instance.

  • resource_name (String)

    Name of the resource database. Format: projects/project/locations/location/instances/instance/databases/ database

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



282
283
284
285
286
287
288
289
290
291
292
293
# File 'generated/google/apis/sql_v1beta4/service.rb', line 282

def get_database(project, instance, database, resource_name: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}', options)
  command.response_representation = Google::Apis::SqlV1beta4::Database::Representation
  command.response_class = Google::Apis::SqlV1beta4::Database
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.params['database'] = database unless database.nil?
  command.query['resourceName'] = resource_name unless resource_name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_instance(project, instance, resource_name: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::DatabaseInstance

Retrieves a resource containing information about a Cloud SQL instance.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • resource_name (String)

    Name of the resource database instance. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



747
748
749
750
751
752
753
754
755
756
757
# File 'generated/google/apis/sql_v1beta4/service.rb', line 747

def get_instance(project, instance, resource_name: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
  command.response_representation = Google::Apis::SqlV1beta4::DatabaseInstance::Representation
  command.response_class = Google::Apis::SqlV1beta4::DatabaseInstance
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['resourceName'] = resource_name unless resource_name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_operation(project, operation, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Retrieves an instance operation that has been performed on an instance.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • operation (String)

    Instance operation ID.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1331

def get_operation(project, operation, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/operations/{operation}', options)
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['operation'] = operation unless operation.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_ssl_cert(project, instance, sha1_fingerprint, resource_name: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::SslCert

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

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • sha1_fingerprint (String)

    Sha1 FingerPrint.

  • resource_name (String)

    Name of the resource ssl certificate. Format: projects/project/locations/location/instances/instance/sslCerts/sslCert

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1499

def get_ssl_cert(project, instance, sha1_fingerprint, resource_name: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}', options)
  command.response_representation = Google::Apis::SqlV1beta4::SslCert::Representation
  command.response_class = Google::Apis::SqlV1beta4::SslCert
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.params['sha1Fingerprint'] = sha1_fingerprint unless sha1_fingerprint.nil?
  command.query['resourceName'] = resource_name unless resource_name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#import_instance(project, instance, instances_import_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

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

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • instances_import_request_object (Google::Apis::SqlV1beta4::InstancesImportRequest) (defaults to: nil)
  • parent (String)

    The parent resource where Cloud SQL imports this database instance. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



786
787
788
789
790
791
792
793
794
795
796
797
798
# File 'generated/google/apis/sql_v1beta4/service.rb', line 786

def import_instance(project, instance, instances_import_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/import', options)
  command.request_representation = Google::Apis::SqlV1beta4::InstancesImportRequest::Representation
  command.request_object = instances_import_request_object
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#insert_backup_run(project, instance, backup_run_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Creates a new backup run on demand. This method is applicable only to Second Generation instances.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • backup_run_object (Google::Apis::SqlV1beta4::BackupRun) (defaults to: nil)
  • parent (String)

    The parent resource where Cloud SQL should create this backupRun. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'generated/google/apis/sql_v1beta4/service.rb', line 157

def insert_backup_run(project, instance, backup_run_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/backupRuns', options)
  command.request_representation = Google::Apis::SqlV1beta4::BackupRun::Representation
  command.request_object = backup_run_object
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#insert_database(project, instance, database_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Inserts a resource containing information about a database inside a Cloud SQL instance.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • database_object (Google::Apis::SqlV1beta4::Database) (defaults to: nil)
  • parent (String)

    The parent resource where Cloud SQL should add this database. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'generated/google/apis/sql_v1beta4/service.rb', line 322

def insert_database(project, instance, database_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/databases', options)
  command.request_representation = Google::Apis::SqlV1beta4::Database::Representation
  command.request_object = database_object
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#insert_instance(project, database_instance_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Creates a new Cloud SQL instance.

Parameters:

  • project (String)

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

  • database_instance_object (Google::Apis::SqlV1beta4::DatabaseInstance) (defaults to: nil)
  • parent (String)

    The parent resource where Cloud SQL creates this database instance. Format: projects/project/locations/location

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



825
826
827
828
829
830
831
832
833
834
835
836
# File 'generated/google/apis/sql_v1beta4/service.rb', line 825

def insert_instance(project, database_instance_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances', options)
  command.request_representation = Google::Apis::SqlV1beta4::DatabaseInstance::Representation
  command.request_object = database_instance_object
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#insert_ssl_cert(project, instance, ssl_certs_insert_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::SslCertsInsertResponse

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

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • ssl_certs_insert_request_object (Google::Apis::SqlV1beta4::SslCertsInsertRequest) (defaults to: nil)
  • parent (String)

    The parent resource where Cloud SQL creates this SSL certificate. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1540

def insert_ssl_cert(project, instance, ssl_certs_insert_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/sslCerts', options)
  command.request_representation = Google::Apis::SqlV1beta4::SslCertsInsertRequest::Representation
  command.request_object = ssl_certs_insert_request_object
  command.response_representation = Google::Apis::SqlV1beta4::SslCertsInsertResponse::Representation
  command.response_class = Google::Apis::SqlV1beta4::SslCertsInsertResponse
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#insert_user(project, instance, user_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Creates a new user in a Cloud SQL instance.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • user_object (Google::Apis::SqlV1beta4::User) (defaults to: nil)
  • parent (String)

    The parent resource where Cloud SQL creates this user. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1688

def insert_user(project, instance, user_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/users', options)
  command.request_representation = Google::Apis::SqlV1beta4::User::Representation
  command.request_object = user_object
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_backup_runs(project, instance, max_results: nil, page_token: nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::BackupRunsListResponse

Lists all backup runs associated with a given instance and configuration in the reverse chronological order of the backup initiation time.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • max_results (Fixnum)

    Maximum number of backup runs per response.

  • page_token (String)

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

  • parent (String)

    The parent, which owns this collection of backupRuns. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'generated/google/apis/sql_v1beta4/service.rb', line 202

def list_backup_runs(project, instance, max_results: nil, page_token: nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/backupRuns', options)
  command.response_representation = Google::Apis::SqlV1beta4::BackupRunsListResponse::Representation
  command.response_class = Google::Apis::SqlV1beta4::BackupRunsListResponse
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_databases(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::DatabasesListResponse

Lists databases in the specified Cloud SQL instance.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • parent (String)

    The parent, which owns this collection of databases. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



361
362
363
364
365
366
367
368
369
370
371
# File 'generated/google/apis/sql_v1beta4/service.rb', line 361

def list_databases(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/databases', options)
  command.response_representation = Google::Apis::SqlV1beta4::DatabasesListResponse::Representation
  command.response_class = Google::Apis::SqlV1beta4::DatabasesListResponse
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_flags(database_version: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::FlagsListResponse

List all available database flags for Cloud SQL instances.

Parameters:

  • database_version (String)

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

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



474
475
476
477
478
479
480
481
482
# File 'generated/google/apis/sql_v1beta4/service.rb', line 474

def list_flags(database_version: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/flags', options)
  command.response_representation = Google::Apis::SqlV1beta4::FlagsListResponse::Representation
  command.response_class = Google::Apis::SqlV1beta4::FlagsListResponse
  command.query['databaseVersion'] = database_version unless database_version.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_instance_server_cas(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::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.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • parent (String)

    The parent, which owns this collection of server CAs. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



909
910
911
912
913
914
915
916
917
918
919
# File 'generated/google/apis/sql_v1beta4/service.rb', line 909

def list_instance_server_cas(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/listServerCas', options)
  command.response_representation = Google::Apis::SqlV1beta4::InstancesListServerCasResponse::Representation
  command.response_class = Google::Apis::SqlV1beta4::InstancesListServerCasResponse
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_instances(project, filter: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::InstancesListResponse

Lists instances under a given project in the alphabetical order of the instance name.

Parameters:

  • project (String)

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

  • filter (String)

    An expression for filtering the results of the request, such as by name or label.

  • max_results (Fixnum)

    The maximum number of results to return per response.

  • page_token (String)

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

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



867
868
869
870
871
872
873
874
875
876
877
878
# File 'generated/google/apis/sql_v1beta4/service.rb', line 867

def list_instances(project, filter: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances', options)
  command.response_representation = Google::Apis::SqlV1beta4::InstancesListResponse::Representation
  command.response_class = Google::Apis::SqlV1beta4::InstancesListResponse
  command.params['project'] = project unless project.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_operations(project, instance: nil, max_results: nil, page_token: nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::OperationsListResponse

Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • max_results (Fixnum)

    Maximum number of operations per response.

  • page_token (String)

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

  • parent (String)

    Indirect parent. The direct parent should combine with the instance name, which owns this collection of operations. Format: projects/project/locations/location

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1375

def list_operations(project, instance: nil, max_results: nil, page_token: nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/operations', options)
  command.response_representation = Google::Apis::SqlV1beta4::OperationsListResponse::Representation
  command.response_class = Google::Apis::SqlV1beta4::OperationsListResponse
  command.params['project'] = project unless project.nil?
  command.query['instance'] = instance unless instance.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_ssl_certs(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::SslCertsListResponse

Lists all of the current SSL certificates for the instance.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • parent (String)

    The parent, which owns this collection of SSL certificates. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1579

def list_ssl_certs(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/sslCerts', options)
  command.response_representation = Google::Apis::SqlV1beta4::SslCertsListResponse::Representation
  command.response_class = Google::Apis::SqlV1beta4::SslCertsListResponse
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_tiers(project, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::TiersListResponse

Lists all available machine types (tiers) for Cloud SQL, for example, db-n1-standard-1. For related information, see Pricing.

Parameters:

  • project (String)

    Project ID of the project for which to list tiers.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1613
1614
1615
1616
1617
1618
1619
1620
1621
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1613

def list_tiers(project, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/tiers', options)
  command.response_representation = Google::Apis::SqlV1beta4::TiersListResponse::Representation
  command.response_class = Google::Apis::SqlV1beta4::TiersListResponse
  command.params['project'] = project unless project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_users(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::UsersListResponse

Lists users in the specified Cloud SQL instance.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • parent (String)

    The parent, which owns this collection of users. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1727

def list_users(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/users', options)
  command.response_representation = Google::Apis::SqlV1beta4::UsersListResponse::Representation
  command.response_class = Google::Apis::SqlV1beta4::UsersListResponse
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_database(project, instance, database, database_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • database (String)

    Name of the database to be updated in the instance.

  • database_object (Google::Apis::SqlV1beta4::Database) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'generated/google/apis/sql_v1beta4/service.rb', line 399

def patch_database(project, instance, database, database_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}', options)
  command.request_representation = Google::Apis::SqlV1beta4::Database::Representation
  command.request_object = database_object
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.params['database'] = database unless database.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_instance(project, instance, database_instance_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Updates settings of a Cloud SQL instance. This method supports patch semantics.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • database_instance_object (Google::Apis::SqlV1beta4::DatabaseInstance) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



945
946
947
948
949
950
951
952
953
954
955
956
# File 'generated/google/apis/sql_v1beta4/service.rb', line 945

def patch_instance(project, instance, database_instance_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
  command.request_representation = Google::Apis::SqlV1beta4::DatabaseInstance::Representation
  command.request_object = database_instance_object
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#promote_instance_replica(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Promotes the read replica instance to be a stand-alone Cloud SQL instance.

Parameters:

  • project (String)

    ID of the project that contains the read replica.

  • instance (String)

    Cloud SQL read replica instance name.

  • parent (String)

    The parent resource where Cloud SQL promotes this replica database instance. Format: projects/project/locations/location

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



983
984
985
986
987
988
989
990
991
992
993
# File 'generated/google/apis/sql_v1beta4/service.rb', line 983

def promote_instance_replica(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica', options)
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#reset_instance_ssl_config(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

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

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • parent (String)

    The parent resource where Cloud SQL resets this SSL config. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1021

def reset_instance_ssl_config(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig', options)
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#restart_instance(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Restarts a Cloud SQL instance.

Parameters:

  • project (String)

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

  • instance (String)

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

  • parent (String)

    The parent resource where Cloud SQL restarts this database instance. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1058

def restart_instance(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/restart', options)
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#restore_instance_backup(project, instance, instances_restore_backup_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Restores a backup of a Cloud SQL instance.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • instances_restore_backup_request_object (Google::Apis::SqlV1beta4::InstancesRestoreBackupRequest) (defaults to: nil)
  • parent (String)

    The parent resource where Cloud SQL restores this database instance from backup. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1097

def restore_instance_backup(project, instance, instances_restore_backup_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup', options)
  command.request_representation = Google::Apis::SqlV1beta4::InstancesRestoreBackupRequest::Representation
  command.request_object = instances_restore_backup_request_object
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#rotate_instance_server_ca(project, instance, instances_rotate_server_ca_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • instances_rotate_server_ca_request_object (Google::Apis::SqlV1beta4::InstancesRotateServerCaRequest) (defaults to: nil)
  • parent (String)

    The parent resource where Cloud SQL rotates these server CAs. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1138

def rotate_instance_server_ca(project, instance, instances_rotate_server_ca_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa', options)
  command.request_representation = Google::Apis::SqlV1beta4::InstancesRotateServerCaRequest::Representation
  command.request_object = instances_rotate_server_ca_request_object
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#start_instance_replica(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Starts the replication in the read replica instance.

Parameters:

  • project (String)

    ID of the project that contains the read replica.

  • instance (String)

    Cloud SQL read replica instance name.

  • parent (String)

    The parent resource where Cloud SQL starts this database instance replication. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1178

def start_instance_replica(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/startReplica', options)
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#stop_instance_replica(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Stops the replication in the read replica instance.

Parameters:

  • project (String)

    ID of the project that contains the read replica.

  • instance (String)

    Cloud SQL read replica instance name.

  • parent (String)

    The parent resource where Cloud SQL stops this database instance replication. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1216

def stop_instance_replica(project, instance, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/stopReplica', options)
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#truncate_instance_log(project, instance, instances_truncate_log_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Truncate MySQL general and slow query log tables

Parameters:

  • project (String)

    Project ID of the Cloud SQL project.

  • instance (String)

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

  • instances_truncate_log_request_object (Google::Apis::SqlV1beta4::InstancesTruncateLogRequest) (defaults to: nil)
  • parent (String)

    The parent resource where Cloud SQL truncates this log. Format: projects/project/locations/location/instances/instance

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1254

def truncate_instance_log(project, instance, instances_truncate_log_request_object = nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/truncateLog', options)
  command.request_representation = Google::Apis::SqlV1beta4::InstancesTruncateLogRequest::Representation
  command.request_object = instances_truncate_log_request_object
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_database(project, instance, database, database_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Updates a resource containing information about a database inside a Cloud SQL instance.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • database (String)

    Name of the database to be updated in the instance.

  • database_object (Google::Apis::SqlV1beta4::Database) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



439
440
441
442
443
444
445
446
447
448
449
450
451
# File 'generated/google/apis/sql_v1beta4/service.rb', line 439

def update_database(project, instance, database, database_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:put, 'sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}', options)
  command.request_representation = Google::Apis::SqlV1beta4::Database::Representation
  command.request_object = database_object
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.params['database'] = database unless database.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_instance(project, instance, database_instance_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Updates settings of a Cloud SQL instance.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • database_instance_object (Google::Apis::SqlV1beta4::DatabaseInstance) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1296

def update_instance(project, instance, database_instance_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:put, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
  command.request_representation = Google::Apis::SqlV1beta4::DatabaseInstance::Representation
  command.request_object = database_instance_object
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_user(project, instance, user_object = nil, host: nil, name: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SqlV1beta4::Operation

Updates an existing user in a Cloud SQL instance.

Parameters:

  • project (String)

    Project ID of the project that contains the instance.

  • instance (String)

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

  • user_object (Google::Apis::SqlV1beta4::User) (defaults to: nil)
  • host (String)

    Host of the user in the instance. For a MySQL instance, it's required; For a PostgreSQL instance, it's optional.

  • name (String)

    Name of the user in the instance.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
# File 'generated/google/apis/sql_v1beta4/service.rb', line 1767

def update_user(project, instance, user_object = nil, host: nil, name: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:put, 'sql/v1beta4/projects/{project}/instances/{instance}/users', options)
  command.request_representation = Google::Apis::SqlV1beta4::User::Representation
  command.request_object = user_object
  command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
  command.response_class = Google::Apis::SqlV1beta4::Operation
  command.params['project'] = project unless project.nil?
  command.params['instance'] = instance unless instance.nil?
  command.query['host'] = host unless host.nil?
  command.query['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end