google-apis-sqladmin_v1beta4 0.41.0 → 0.95.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,8 +30,10 @@ module Google
30
30
  # Sqladmin = Google::Apis::SqladminV1beta4 # Alias the module
31
31
  # service = Sqladmin::SQLAdminService.new
32
32
  #
33
- # @see https://developers.google.com/cloud-sql/
33
+ # @see https://cloud.google.com/sql/docs
34
34
  class SQLAdminService < Google::Apis::Core::BaseService
35
+ DEFAULT_ENDPOINT_TEMPLATE = "https://sqladmin.$UNIVERSE_DOMAIN$/"
36
+
35
37
  # @return [String]
36
38
  # API key. Your API key identifies your project and provides you with API access,
37
39
  # quota, and reports. Required unless you provide an OAuth 2.0 token.
@@ -43,7 +45,7 @@ module Google
43
45
  attr_accessor :quota_user
44
46
 
45
47
  def initialize
46
- super('https://sqladmin.googleapis.com/', '',
48
+ super(DEFAULT_ENDPOINT_TEMPLATE, '',
47
49
  client_name: 'google-apis-sqladmin_v1beta4',
48
50
  client_version: Google::Apis::SqladminV1beta4::GEM_VERSION)
49
51
  @batch_path = 'batch'
@@ -201,6 +203,190 @@ module Google
201
203
  execute_or_queue_command(command, &block)
202
204
  end
203
205
 
206
+ # Creates a backup for a Cloud SQL instance. This API can be used only to create
207
+ # on-demand backups.
208
+ # @param [String] parent
209
+ # Required. The parent resource where this backup is created. Format: projects/`
210
+ # project`
211
+ # @param [Google::Apis::SqladminV1beta4::Backup] backup_object
212
+ # @param [String] fields
213
+ # Selector specifying which fields to include in a partial response.
214
+ # @param [String] quota_user
215
+ # Available to use for quota purposes for server-side applications. Can be any
216
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
217
+ # @param [Google::Apis::RequestOptions] options
218
+ # Request-specific options
219
+ #
220
+ # @yield [result, err] Result & error if block supplied
221
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
222
+ # @yieldparam err [StandardError] error object if request failed
223
+ #
224
+ # @return [Google::Apis::SqladminV1beta4::Operation]
225
+ #
226
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
227
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
228
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
229
+ def create_backup_backup(parent, backup_object = nil, fields: nil, quota_user: nil, options: nil, &block)
230
+ command = make_simple_command(:post, 'sql/v1beta4/{+parent}/backups', options)
231
+ command.request_representation = Google::Apis::SqladminV1beta4::Backup::Representation
232
+ command.request_object = backup_object
233
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
234
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
235
+ command.params['parent'] = parent unless parent.nil?
236
+ command.query['fields'] = fields unless fields.nil?
237
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
238
+ execute_or_queue_command(command, &block)
239
+ end
240
+
241
+ # Deletes the backup.
242
+ # @param [String] name
243
+ # Required. The name of the backup to delete. Format: projects/`project`/backups/
244
+ # `backup`
245
+ # @param [String] fields
246
+ # Selector specifying which fields to include in a partial response.
247
+ # @param [String] quota_user
248
+ # Available to use for quota purposes for server-side applications. Can be any
249
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
250
+ # @param [Google::Apis::RequestOptions] options
251
+ # Request-specific options
252
+ #
253
+ # @yield [result, err] Result & error if block supplied
254
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
255
+ # @yieldparam err [StandardError] error object if request failed
256
+ #
257
+ # @return [Google::Apis::SqladminV1beta4::Operation]
258
+ #
259
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
260
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
261
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
262
+ def delete_backup_backup(name, fields: nil, quota_user: nil, options: nil, &block)
263
+ command = make_simple_command(:delete, 'sql/v1beta4/{+name}', options)
264
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
265
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
266
+ command.params['name'] = name unless name.nil?
267
+ command.query['fields'] = fields unless fields.nil?
268
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
269
+ execute_or_queue_command(command, &block)
270
+ end
271
+
272
+ # Retrieves a resource containing information about a backup.
273
+ # @param [String] name
274
+ # Required. The name of the backup to retrieve. Format: projects/`project`/
275
+ # backups/`backup`
276
+ # @param [String] fields
277
+ # Selector specifying which fields to include in a partial response.
278
+ # @param [String] quota_user
279
+ # Available to use for quota purposes for server-side applications. Can be any
280
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
281
+ # @param [Google::Apis::RequestOptions] options
282
+ # Request-specific options
283
+ #
284
+ # @yield [result, err] Result & error if block supplied
285
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Backup] parsed result object
286
+ # @yieldparam err [StandardError] error object if request failed
287
+ #
288
+ # @return [Google::Apis::SqladminV1beta4::Backup]
289
+ #
290
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
291
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
292
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
293
+ def get_backup_backup(name, fields: nil, quota_user: nil, options: nil, &block)
294
+ command = make_simple_command(:get, 'sql/v1beta4/{+name}', options)
295
+ command.response_representation = Google::Apis::SqladminV1beta4::Backup::Representation
296
+ command.response_class = Google::Apis::SqladminV1beta4::Backup
297
+ command.params['name'] = name unless name.nil?
298
+ command.query['fields'] = fields unless fields.nil?
299
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
300
+ execute_or_queue_command(command, &block)
301
+ end
302
+
303
+ # Lists all backups associated with the project.
304
+ # @param [String] parent
305
+ # Required. The parent that owns this collection of backups. Format: projects/`
306
+ # project`
307
+ # @param [String] filter
308
+ # Multiple filter queries are separated by spaces. For example, 'instance:abc
309
+ # AND type:FINAL, 'location:us', 'backupInterval.startTime>=1950-01-01T01:01:25.
310
+ # 771Z'. You can filter by type, instance, backupInterval.startTime (creation
311
+ # time), or location.
312
+ # @param [Fixnum] page_size
313
+ # The maximum number of backups to return per response. The service might return
314
+ # fewer backups than this value. If a value for this parameter isn't specified,
315
+ # then, at most, 500 backups are returned. The maximum value is 2,000. Any
316
+ # values that you set, which are greater than 2,000, are changed to 2,000.
317
+ # @param [String] page_token
318
+ # A page token, received from a previous `ListBackups` call. Provide this to
319
+ # retrieve the subsequent page. When paginating, all other parameters provided
320
+ # to `ListBackups` must match the call that provided the page token.
321
+ # @param [String] fields
322
+ # Selector specifying which fields to include in a partial response.
323
+ # @param [String] quota_user
324
+ # Available to use for quota purposes for server-side applications. Can be any
325
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
326
+ # @param [Google::Apis::RequestOptions] options
327
+ # Request-specific options
328
+ #
329
+ # @yield [result, err] Result & error if block supplied
330
+ # @yieldparam result [Google::Apis::SqladminV1beta4::ListBackupsResponse] parsed result object
331
+ # @yieldparam err [StandardError] error object if request failed
332
+ #
333
+ # @return [Google::Apis::SqladminV1beta4::ListBackupsResponse]
334
+ #
335
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
336
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
337
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
338
+ def list_backup_backups(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
339
+ command = make_simple_command(:get, 'sql/v1beta4/{+parent}/backups', options)
340
+ command.response_representation = Google::Apis::SqladminV1beta4::ListBackupsResponse::Representation
341
+ command.response_class = Google::Apis::SqladminV1beta4::ListBackupsResponse
342
+ command.params['parent'] = parent unless parent.nil?
343
+ command.query['filter'] = filter unless filter.nil?
344
+ command.query['pageSize'] = page_size unless page_size.nil?
345
+ command.query['pageToken'] = page_token unless page_token.nil?
346
+ command.query['fields'] = fields unless fields.nil?
347
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
348
+ execute_or_queue_command(command, &block)
349
+ end
350
+
351
+ # Updates the retention period and the description of the backup. You can use
352
+ # this API to update final backups only.
353
+ # @param [String] name
354
+ # Output only. The resource name of the backup. Format: projects/`project`/
355
+ # backups/`backup`.
356
+ # @param [Google::Apis::SqladminV1beta4::Backup] backup_object
357
+ # @param [String] update_mask
358
+ # The list of fields that you can update. You can update only the description
359
+ # and retention period of the final backup.
360
+ # @param [String] fields
361
+ # Selector specifying which fields to include in a partial response.
362
+ # @param [String] quota_user
363
+ # Available to use for quota purposes for server-side applications. Can be any
364
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
365
+ # @param [Google::Apis::RequestOptions] options
366
+ # Request-specific options
367
+ #
368
+ # @yield [result, err] Result & error if block supplied
369
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
370
+ # @yieldparam err [StandardError] error object if request failed
371
+ #
372
+ # @return [Google::Apis::SqladminV1beta4::Operation]
373
+ #
374
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
375
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
376
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
377
+ def update_backup_backup(name, backup_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
378
+ command = make_simple_command(:patch, 'sql/v1beta4/{+name}', options)
379
+ command.request_representation = Google::Apis::SqladminV1beta4::Backup::Representation
380
+ command.request_object = backup_object
381
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
382
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
383
+ command.params['name'] = name unless name.nil?
384
+ command.query['updateMask'] = update_mask unless update_mask.nil?
385
+ command.query['fields'] = fields unless fields.nil?
386
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
387
+ execute_or_queue_command(command, &block)
388
+ end
389
+
204
390
  # Generates a short-lived X509 certificate containing the provided public key
205
391
  # and signed by a private key specific to the target instance. Users may use the
206
392
  # certificate to authenticate as themselves when connecting to the database.
@@ -349,7 +535,7 @@ module Google
349
535
  end
350
536
 
351
537
  # Inserts a resource containing information about a database inside a Cloud SQL
352
- # instance.
538
+ # instance. **Note:** You can't modify the default character set and collation.
353
539
  # @param [String] project
354
540
  # Project ID of the project that contains the instance.
355
541
  # @param [String] instance
@@ -502,6 +688,9 @@ module Google
502
688
  # @param [String] database_version
503
689
  # Database type and version you want to retrieve flags for. By default, this
504
690
  # method returns flags for all database types and versions.
691
+ # @param [String] flag_scope
692
+ # Optional. Specify the scope of flags to be returned by SqlFlagsListService.
693
+ # Return list of database flags if unspecified.
505
694
  # @param [String] fields
506
695
  # Selector specifying which fields to include in a partial response.
507
696
  # @param [String] quota_user
@@ -519,25 +708,25 @@ module Google
519
708
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
520
709
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
521
710
  # @raise [Google::Apis::AuthorizationError] Authorization is required
522
- def list_flags(database_version: nil, fields: nil, quota_user: nil, options: nil, &block)
711
+ def list_flags(database_version: nil, flag_scope: nil, fields: nil, quota_user: nil, options: nil, &block)
523
712
  command = make_simple_command(:get, 'sql/v1beta4/flags', options)
524
713
  command.response_representation = Google::Apis::SqladminV1beta4::ListFlagsResponse::Representation
525
714
  command.response_class = Google::Apis::SqladminV1beta4::ListFlagsResponse
526
715
  command.query['databaseVersion'] = database_version unless database_version.nil?
716
+ command.query['flagScope'] = flag_scope unless flag_scope.nil?
527
717
  command.query['fields'] = fields unless fields.nil?
528
718
  command.query['quotaUser'] = quota_user unless quota_user.nil?
529
719
  execute_or_queue_command(command, &block)
530
720
  end
531
721
 
532
- # Add a new trusted Certificate Authority (CA) version for the specified
533
- # instance. Required to prepare for a certificate rotation. If a CA version was
534
- # previously added but never used in a certificate rotation, this operation
535
- # replaces that version. There cannot be more than one CA version waiting to be
536
- # rotated in.
722
+ # Lists all versions of EntraID certificates for the specified instance. There
723
+ # can be up to three sets of certificates listed: the certificate that is
724
+ # currently in use, a future that has been added but not yet used to sign a
725
+ # certificate, and a certificate that has been rotated out.
537
726
  # @param [String] project
538
- # Project ID of the project that contains the instance.
727
+ # Required. Project ID of the project that contains the instance.
539
728
  # @param [String] instance
540
- # Cloud SQL instance ID. This does not include the project ID.
729
+ # Required. Cloud SQL instance ID. This does not include the project ID.
541
730
  # @param [String] fields
542
731
  # Selector specifying which fields to include in a partial response.
543
732
  # @param [String] quota_user
@@ -547,18 +736,18 @@ module Google
547
736
  # Request-specific options
548
737
  #
549
738
  # @yield [result, err] Result & error if block supplied
550
- # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
739
+ # @yieldparam result [Google::Apis::SqladminV1beta4::InstancesListEntraIdCertificatesResponse] parsed result object
551
740
  # @yieldparam err [StandardError] error object if request failed
552
741
  #
553
- # @return [Google::Apis::SqladminV1beta4::Operation]
742
+ # @return [Google::Apis::SqladminV1beta4::InstancesListEntraIdCertificatesResponse]
554
743
  #
555
744
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
556
745
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
557
746
  # @raise [Google::Apis::AuthorizationError] Authorization is required
558
- def add_instance_server_ca(project, instance, fields: nil, quota_user: nil, options: nil, &block)
559
- command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/addServerCa', options)
560
- command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
561
- command.response_class = Google::Apis::SqladminV1beta4::Operation
747
+ def list_instance_entra_id_certificates(project, instance, fields: nil, quota_user: nil, options: nil, &block)
748
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/listEntraIdCertificates', options)
749
+ command.response_representation = Google::Apis::SqladminV1beta4::InstancesListEntraIdCertificatesResponse::Representation
750
+ command.response_class = Google::Apis::SqladminV1beta4::InstancesListEntraIdCertificatesResponse
562
751
  command.params['project'] = project unless project.nil?
563
752
  command.params['instance'] = instance unless instance.nil?
564
753
  command.query['fields'] = fields unless fields.nil?
@@ -566,14 +755,16 @@ module Google
566
755
  execute_or_queue_command(command, &block)
567
756
  end
568
757
 
569
- # Creates a Cloud SQL instance as a clone of the source instance. Using this
570
- # operation might cause your instance to restart.
758
+ # Lists all versions of server certificates and certificate authorities (CAs)
759
+ # for the specified instance. There can be up to three sets of certs listed: the
760
+ # certificate that is currently in use, a future that has been added but not yet
761
+ # used to sign a certificate, and a certificate that has been rotated out. For
762
+ # instances not using Certificate Authority Service (CAS) server CA, use
763
+ # ListServerCas instead.
571
764
  # @param [String] project
572
- # Project ID of the source as well as the clone Cloud SQL instance.
765
+ # Required. Project ID of the project that contains the instance.
573
766
  # @param [String] instance
574
- # The ID of the Cloud SQL instance to be cloned (source). This does not include
575
- # the project ID.
576
- # @param [Google::Apis::SqladminV1beta4::CloneInstancesRequest] clone_instances_request_object
767
+ # Required. Cloud SQL instance ID. This does not include the project ID.
577
768
  # @param [String] fields
578
769
  # Selector specifying which fields to include in a partial response.
579
770
  # @param [String] quota_user
@@ -583,20 +774,18 @@ module Google
583
774
  # Request-specific options
584
775
  #
585
776
  # @yield [result, err] Result & error if block supplied
586
- # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
777
+ # @yieldparam result [Google::Apis::SqladminV1beta4::InstancesListServerCertificatesResponse] parsed result object
587
778
  # @yieldparam err [StandardError] error object if request failed
588
779
  #
589
- # @return [Google::Apis::SqladminV1beta4::Operation]
780
+ # @return [Google::Apis::SqladminV1beta4::InstancesListServerCertificatesResponse]
590
781
  #
591
782
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
592
783
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
593
784
  # @raise [Google::Apis::AuthorizationError] Authorization is required
594
- def clone_instance(project, instance, clone_instances_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
595
- command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/clone', options)
596
- command.request_representation = Google::Apis::SqladminV1beta4::CloneInstancesRequest::Representation
597
- command.request_object = clone_instances_request_object
598
- command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
599
- command.response_class = Google::Apis::SqladminV1beta4::Operation
785
+ def list_instance_server_certificates(project, instance, fields: nil, quota_user: nil, options: nil, &block)
786
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/listServerCertificates', options)
787
+ command.response_representation = Google::Apis::SqladminV1beta4::InstancesListServerCertificatesResponse::Representation
788
+ command.response_class = Google::Apis::SqladminV1beta4::InstancesListServerCertificatesResponse
600
789
  command.params['project'] = project unless project.nil?
601
790
  command.params['instance'] = instance unless instance.nil?
602
791
  command.query['fields'] = fields unless fields.nil?
@@ -604,11 +793,13 @@ module Google
604
793
  execute_or_queue_command(command, &block)
605
794
  end
606
795
 
607
- # Deletes a Cloud SQL instance.
796
+ # Rotates the Entra Id certificate version to one previously added with the
797
+ # addEntraIdCertificate method.
608
798
  # @param [String] project
609
- # Project ID of the project that contains the instance to be deleted.
799
+ # Required. Project ID of the project that contains the instance.
610
800
  # @param [String] instance
611
- # Cloud SQL instance ID. This does not include the project ID.
801
+ # Required. Cloud SQL instance ID. This does not include the project ID.
802
+ # @param [Google::Apis::SqladminV1beta4::InstancesRotateEntraIdCertificateRequest] instances_rotate_entra_id_certificate_request_object
612
803
  # @param [String] fields
613
804
  # Selector specifying which fields to include in a partial response.
614
805
  # @param [String] quota_user
@@ -626,8 +817,10 @@ module Google
626
817
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
627
818
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
628
819
  # @raise [Google::Apis::AuthorizationError] Authorization is required
629
- def delete_instance(project, instance, fields: nil, quota_user: nil, options: nil, &block)
630
- command = make_simple_command(:delete, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
820
+ def rotate_instance_entra_id_certificate(project, instance, instances_rotate_entra_id_certificate_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
821
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/rotateEntraIdCertificate', options)
822
+ command.request_representation = Google::Apis::SqladminV1beta4::InstancesRotateEntraIdCertificateRequest::Representation
823
+ command.request_object = instances_rotate_entra_id_certificate_request_object
631
824
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
632
825
  command.response_class = Google::Apis::SqladminV1beta4::Operation
633
826
  command.params['project'] = project unless project.nil?
@@ -637,13 +830,14 @@ module Google
637
830
  execute_or_queue_command(command, &block)
638
831
  end
639
832
 
640
- # Demotes the stand-alone instance to be a Cloud SQL read replica for an
641
- # external database server.
833
+ # Rotates the server certificate version to one previously added with the
834
+ # addServerCertificate method. For instances not using Certificate Authority
835
+ # Service (CAS) server CA, use RotateServerCa instead.
642
836
  # @param [String] project
643
- # ID of the project that contains the instance.
837
+ # Required. Project ID of the project that contains the instance.
644
838
  # @param [String] instance
645
- # Cloud SQL instance name.
646
- # @param [Google::Apis::SqladminV1beta4::InstancesDemoteMasterRequest] instances_demote_master_request_object
839
+ # Required. Cloud SQL instance ID. This does not include the project ID.
840
+ # @param [Google::Apis::SqladminV1beta4::InstancesRotateServerCertificateRequest] instances_rotate_server_certificate_request_object
647
841
  # @param [String] fields
648
842
  # Selector specifying which fields to include in a partial response.
649
843
  # @param [String] quota_user
@@ -661,10 +855,10 @@ module Google
661
855
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
662
856
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
663
857
  # @raise [Google::Apis::AuthorizationError] Authorization is required
664
- def demote_instance_master(project, instance, instances_demote_master_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
665
- command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster', options)
666
- command.request_representation = Google::Apis::SqladminV1beta4::InstancesDemoteMasterRequest::Representation
667
- command.request_object = instances_demote_master_request_object
858
+ def rotate_instance_server_certificate(project, instance, instances_rotate_server_certificate_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
859
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCertificate', options)
860
+ command.request_representation = Google::Apis::SqladminV1beta4::InstancesRotateServerCertificateRequest::Representation
861
+ command.request_object = instances_rotate_server_certificate_request_object
668
862
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
669
863
  command.response_class = Google::Apis::SqladminV1beta4::Operation
670
864
  command.params['project'] = project unless project.nil?
@@ -674,13 +868,14 @@ module Google
674
868
  execute_or_queue_command(command, &block)
675
869
  end
676
870
 
677
- # Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump
678
- # or CSV file.
871
+ # Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
679
872
  # @param [String] project
680
- # Project ID of the project that contains the instance to be exported.
873
+ # Required. ID of the project that contains the instance (Example: project-id).
681
874
  # @param [String] instance
682
- # Cloud SQL instance ID. This does not include the project ID.
683
- # @param [Google::Apis::SqladminV1beta4::ExportInstancesRequest] export_instances_request_object
875
+ # Required. Cloud SQL instance ID. This doesn't include the project ID. It's
876
+ # composed of lowercase letters, numbers, and hyphens, and it must start with a
877
+ # letter. The total length must be 98 characters or less (Example: instance-id).
878
+ # @param [Google::Apis::SqladminV1beta4::InstancesAcquireSsrsLeaseRequest] instances_acquire_ssrs_lease_request_object
684
879
  # @param [String] fields
685
880
  # Selector specifying which fields to include in a partial response.
686
881
  # @param [String] quota_user
@@ -690,20 +885,20 @@ module Google
690
885
  # Request-specific options
691
886
  #
692
887
  # @yield [result, err] Result & error if block supplied
693
- # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
888
+ # @yieldparam result [Google::Apis::SqladminV1beta4::SqlInstancesAcquireSsrsLeaseResponse] parsed result object
694
889
  # @yieldparam err [StandardError] error object if request failed
695
890
  #
696
- # @return [Google::Apis::SqladminV1beta4::Operation]
891
+ # @return [Google::Apis::SqladminV1beta4::SqlInstancesAcquireSsrsLeaseResponse]
697
892
  #
698
893
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
699
894
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
700
895
  # @raise [Google::Apis::AuthorizationError] Authorization is required
701
- def export_instance(project, instance, export_instances_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
702
- command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/export', options)
703
- command.request_representation = Google::Apis::SqladminV1beta4::ExportInstancesRequest::Representation
704
- command.request_object = export_instances_request_object
705
- command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
706
- command.response_class = Google::Apis::SqladminV1beta4::Operation
896
+ def acquire_instance_ssrs_lease(project, instance, instances_acquire_ssrs_lease_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
897
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/acquireSsrsLease', options)
898
+ command.request_representation = Google::Apis::SqladminV1beta4::InstancesAcquireSsrsLeaseRequest::Representation
899
+ command.request_object = instances_acquire_ssrs_lease_request_object
900
+ command.response_representation = Google::Apis::SqladminV1beta4::SqlInstancesAcquireSsrsLeaseResponse::Representation
901
+ command.response_class = Google::Apis::SqladminV1beta4::SqlInstancesAcquireSsrsLeaseResponse
707
902
  command.params['project'] = project unless project.nil?
708
903
  command.params['instance'] = instance unless instance.nil?
709
904
  command.query['fields'] = fields unless fields.nil?
@@ -711,17 +906,13 @@ module Google
711
906
  execute_or_queue_command(command, &block)
712
907
  end
713
908
 
714
- # Initiates a manual failover of a high availability (HA) primary instance to a
715
- # standby instance, which becomes the primary instance. Users are then rerouted
716
- # to the new primary. For more information, see the [Overview of high
717
- # availability](https://cloud.google.com/sql/docs/mysql/high-availability) page
718
- # in the Cloud SQL documentation. If using Legacy HA (MySQL only), this causes
719
- # the instance to failover to its failover replica instance.
909
+ # Adds a new Entra ID certificate for the specified instance. If an Entra ID
910
+ # certificate was previously added but never used in a certificate rotation,
911
+ # this operation replaces that version.
720
912
  # @param [String] project
721
- # ID of the project that contains the read replica.
913
+ # Required. Project ID of the project that contains the instance.
722
914
  # @param [String] instance
723
- # Cloud SQL instance ID. This does not include the project ID.
724
- # @param [Google::Apis::SqladminV1beta4::InstancesFailoverRequest] instances_failover_request_object
915
+ # Required. Cloud SQL instance ID. This does not include the project ID.
725
916
  # @param [String] fields
726
917
  # Selector specifying which fields to include in a partial response.
727
918
  # @param [String] quota_user
@@ -739,10 +930,8 @@ module Google
739
930
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
740
931
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
741
932
  # @raise [Google::Apis::AuthorizationError] Authorization is required
742
- def failover_instance(project, instance, instances_failover_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
743
- command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/failover', options)
744
- command.request_representation = Google::Apis::SqladminV1beta4::InstancesFailoverRequest::Representation
745
- command.request_object = instances_failover_request_object
933
+ def add_instance_entra_id_certificate(project, instance, fields: nil, quota_user: nil, options: nil, &block)
934
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/addEntraIdCertificate', options)
746
935
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
747
936
  command.response_class = Google::Apis::SqladminV1beta4::Operation
748
937
  command.params['project'] = project unless project.nil?
@@ -752,11 +941,16 @@ module Google
752
941
  execute_or_queue_command(command, &block)
753
942
  end
754
943
 
755
- # Retrieves a resource containing information about a Cloud SQL instance.
944
+ # Add a new trusted Certificate Authority (CA) version for the specified
945
+ # instance. Required to prepare for a certificate rotation. If a CA version was
946
+ # previously added but never used in a certificate rotation, this operation
947
+ # replaces that version. There cannot be more than one CA version waiting to be
948
+ # rotated in. For instances that have enabled Certificate Authority Service (CAS)
949
+ # based server CA, use AddServerCertificate to add a new server certificate.
756
950
  # @param [String] project
757
951
  # Project ID of the project that contains the instance.
758
952
  # @param [String] instance
759
- # Database instance ID. This does not include the project ID.
953
+ # Cloud SQL instance ID. This does not include the project ID.
760
954
  # @param [String] fields
761
955
  # Selector specifying which fields to include in a partial response.
762
956
  # @param [String] quota_user
@@ -766,18 +960,18 @@ module Google
766
960
  # Request-specific options
767
961
  #
768
962
  # @yield [result, err] Result & error if block supplied
769
- # @yieldparam result [Google::Apis::SqladminV1beta4::DatabaseInstance] parsed result object
963
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
770
964
  # @yieldparam err [StandardError] error object if request failed
771
965
  #
772
- # @return [Google::Apis::SqladminV1beta4::DatabaseInstance]
966
+ # @return [Google::Apis::SqladminV1beta4::Operation]
773
967
  #
774
968
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
775
969
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
776
970
  # @raise [Google::Apis::AuthorizationError] Authorization is required
777
- def get_instance(project, instance, fields: nil, quota_user: nil, options: nil, &block)
778
- command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
779
- command.response_representation = Google::Apis::SqladminV1beta4::DatabaseInstance::Representation
780
- command.response_class = Google::Apis::SqladminV1beta4::DatabaseInstance
971
+ def add_instance_server_ca(project, instance, fields: nil, quota_user: nil, options: nil, &block)
972
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/addServerCa', options)
973
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
974
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
781
975
  command.params['project'] = project unless project.nil?
782
976
  command.params['instance'] = instance unless instance.nil?
783
977
  command.query['fields'] = fields unless fields.nil?
@@ -785,13 +979,16 @@ module Google
785
979
  execute_or_queue_command(command, &block)
786
980
  end
787
981
 
788
- # Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud
789
- # Storage.
982
+ # Add a new trusted server certificate version for the specified instance using
983
+ # Certificate Authority Service (CAS) server CA. Required to prepare for a
984
+ # certificate rotation. If a server certificate version was previously added but
985
+ # never used in a certificate rotation, this operation replaces that version.
986
+ # There cannot be more than one certificate version waiting to be rotated in.
987
+ # For instances not using CAS server CA, use AddServerCa instead.
790
988
  # @param [String] project
791
- # Project ID of the project that contains the instance.
989
+ # Required. Project ID of the project that contains the instance.
792
990
  # @param [String] instance
793
- # Cloud SQL instance ID. This does not include the project ID.
794
- # @param [Google::Apis::SqladminV1beta4::ImportInstancesRequest] import_instances_request_object
991
+ # Required. Cloud SQL instance ID. This does not include the project ID.
795
992
  # @param [String] fields
796
993
  # Selector specifying which fields to include in a partial response.
797
994
  # @param [String] quota_user
@@ -809,10 +1006,8 @@ module Google
809
1006
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
810
1007
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
811
1008
  # @raise [Google::Apis::AuthorizationError] Authorization is required
812
- def import_instance(project, instance, import_instances_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
813
- command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/import', options)
814
- command.request_representation = Google::Apis::SqladminV1beta4::ImportInstancesRequest::Representation
815
- command.request_object = import_instances_request_object
1009
+ def add_instance_server_certificate(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1010
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/addServerCertificate', options)
816
1011
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
817
1012
  command.response_class = Google::Apis::SqladminV1beta4::Operation
818
1013
  command.params['project'] = project unless project.nil?
@@ -822,11 +1017,14 @@ module Google
822
1017
  execute_or_queue_command(command, &block)
823
1018
  end
824
1019
 
825
- # Creates a new Cloud SQL instance.
1020
+ # Creates a Cloud SQL instance as a clone of the source instance. Using this
1021
+ # operation might cause your instance to restart.
826
1022
  # @param [String] project
827
- # Project ID of the project to which the newly created Cloud SQL instances
828
- # should belong.
829
- # @param [Google::Apis::SqladminV1beta4::DatabaseInstance] database_instance_object
1023
+ # Project ID of the source as well as the clone Cloud SQL instance.
1024
+ # @param [String] instance
1025
+ # The ID of the Cloud SQL instance to be cloned (source). This does not include
1026
+ # the project ID.
1027
+ # @param [Google::Apis::SqladminV1beta4::CloneInstancesRequest] clone_instances_request_object
830
1028
  # @param [String] fields
831
1029
  # Selector specifying which fields to include in a partial response.
832
1030
  # @param [String] quota_user
@@ -844,37 +1042,486 @@ module Google
844
1042
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
845
1043
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
846
1044
  # @raise [Google::Apis::AuthorizationError] Authorization is required
847
- def insert_instance(project, database_instance_object = nil, fields: nil, quota_user: nil, options: nil, &block)
848
- command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances', options)
849
- command.request_representation = Google::Apis::SqladminV1beta4::DatabaseInstance::Representation
850
- command.request_object = database_instance_object
1045
+ def clone_instance(project, instance, clone_instances_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1046
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/clone', options)
1047
+ command.request_representation = Google::Apis::SqladminV1beta4::CloneInstancesRequest::Representation
1048
+ command.request_object = clone_instances_request_object
851
1049
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
852
1050
  command.response_class = Google::Apis::SqladminV1beta4::Operation
853
1051
  command.params['project'] = project unless project.nil?
1052
+ command.params['instance'] = instance unless instance.nil?
854
1053
  command.query['fields'] = fields unless fields.nil?
855
1054
  command.query['quotaUser'] = quota_user unless quota_user.nil?
856
1055
  execute_or_queue_command(command, &block)
857
1056
  end
858
1057
 
859
- # Lists instances under a given project.
1058
+ # Deletes a Cloud SQL instance.
860
1059
  # @param [String] project
861
- # Project ID of the project for which to list Cloud SQL instances.
862
- # @param [String] filter
863
- # A filter expression that filters resources listed in the response. The
864
- # expression is in the form of field:value. For example, 'instanceType:
865
- # CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per their JSON
866
- # representation, such as 'settings.userLabels.auto_start:true'. Multiple filter
867
- # queries are space-separated. For example. 'state:RUNNABLE instanceType:
868
- # CLOUD_SQL_INSTANCE'. By default, each expression is an AND expression. However,
869
- # you can include AND and OR expressions explicitly.
870
- # @param [Fixnum] max_results
871
- # The maximum number of instances to return. The service may return fewer than
872
- # this value. If unspecified, at most 500 instances are returned. The maximum
873
- # value is 1000; values above 1000 are coerced to 1000.
874
- # @param [String] page_token
875
- # A previously-returned page token representing part of the larger set of
876
- # results to view.
877
- # @param [String] fields
1060
+ # Project ID of the project that contains the instance to be deleted.
1061
+ # @param [String] instance
1062
+ # Cloud SQL instance ID. This does not include the project ID.
1063
+ # @param [Boolean] enable_final_backup
1064
+ # Flag to opt-in for final backup. By default, it is turned off.
1065
+ # @param [String] final_backup_description
1066
+ # Optional. The description of the final backup.
1067
+ # @param [String] final_backup_expiry_time
1068
+ # Optional. Final Backup expiration time. Timestamp in UTC of when this resource
1069
+ # is considered expired.
1070
+ # @param [Fixnum] final_backup_ttl_days
1071
+ # Optional. Retention period of the final backup.
1072
+ # @param [String] fields
1073
+ # Selector specifying which fields to include in a partial response.
1074
+ # @param [String] quota_user
1075
+ # Available to use for quota purposes for server-side applications. Can be any
1076
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1077
+ # @param [Google::Apis::RequestOptions] options
1078
+ # Request-specific options
1079
+ #
1080
+ # @yield [result, err] Result & error if block supplied
1081
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1082
+ # @yieldparam err [StandardError] error object if request failed
1083
+ #
1084
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1085
+ #
1086
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1087
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1088
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1089
+ def delete_instance(project, instance, enable_final_backup: nil, final_backup_description: nil, final_backup_expiry_time: nil, final_backup_ttl_days: nil, fields: nil, quota_user: nil, options: nil, &block)
1090
+ command = make_simple_command(:delete, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
1091
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1092
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1093
+ command.params['project'] = project unless project.nil?
1094
+ command.params['instance'] = instance unless instance.nil?
1095
+ command.query['enableFinalBackup'] = enable_final_backup unless enable_final_backup.nil?
1096
+ command.query['finalBackupDescription'] = final_backup_description unless final_backup_description.nil?
1097
+ command.query['finalBackupExpiryTime'] = final_backup_expiry_time unless final_backup_expiry_time.nil?
1098
+ command.query['finalBackupTtlDays'] = final_backup_ttl_days unless final_backup_ttl_days.nil?
1099
+ command.query['fields'] = fields unless fields.nil?
1100
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1101
+ execute_or_queue_command(command, &block)
1102
+ end
1103
+
1104
+ # Demotes an existing standalone instance to be a Cloud SQL read replica for an
1105
+ # external database server.
1106
+ # @param [String] project
1107
+ # Required. The project ID of the project that contains the instance.
1108
+ # @param [String] instance
1109
+ # Required. The name of the Cloud SQL instance.
1110
+ # @param [Google::Apis::SqladminV1beta4::InstancesDemoteRequest] instances_demote_request_object
1111
+ # @param [String] fields
1112
+ # Selector specifying which fields to include in a partial response.
1113
+ # @param [String] quota_user
1114
+ # Available to use for quota purposes for server-side applications. Can be any
1115
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1116
+ # @param [Google::Apis::RequestOptions] options
1117
+ # Request-specific options
1118
+ #
1119
+ # @yield [result, err] Result & error if block supplied
1120
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1121
+ # @yieldparam err [StandardError] error object if request failed
1122
+ #
1123
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1124
+ #
1125
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1126
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1127
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1128
+ def demote_instance(project, instance, instances_demote_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1129
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/demote', options)
1130
+ command.request_representation = Google::Apis::SqladminV1beta4::InstancesDemoteRequest::Representation
1131
+ command.request_object = instances_demote_request_object
1132
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1133
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1134
+ command.params['project'] = project unless project.nil?
1135
+ command.params['instance'] = instance unless instance.nil?
1136
+ command.query['fields'] = fields unless fields.nil?
1137
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1138
+ execute_or_queue_command(command, &block)
1139
+ end
1140
+
1141
+ # Demotes the stand-alone instance to be a Cloud SQL read replica for an
1142
+ # external database server.
1143
+ # @param [String] project
1144
+ # ID of the project that contains the instance.
1145
+ # @param [String] instance
1146
+ # Cloud SQL instance name.
1147
+ # @param [Google::Apis::SqladminV1beta4::InstancesDemoteMasterRequest] instances_demote_master_request_object
1148
+ # @param [String] fields
1149
+ # Selector specifying which fields to include in a partial response.
1150
+ # @param [String] quota_user
1151
+ # Available to use for quota purposes for server-side applications. Can be any
1152
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1153
+ # @param [Google::Apis::RequestOptions] options
1154
+ # Request-specific options
1155
+ #
1156
+ # @yield [result, err] Result & error if block supplied
1157
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1158
+ # @yieldparam err [StandardError] error object if request failed
1159
+ #
1160
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1161
+ #
1162
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1163
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1164
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1165
+ def demote_instance_master(project, instance, instances_demote_master_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1166
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster', options)
1167
+ command.request_representation = Google::Apis::SqladminV1beta4::InstancesDemoteMasterRequest::Representation
1168
+ command.request_object = instances_demote_master_request_object
1169
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1170
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1171
+ command.params['project'] = project unless project.nil?
1172
+ command.params['instance'] = instance unless instance.nil?
1173
+ command.query['fields'] = fields unless fields.nil?
1174
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1175
+ execute_or_queue_command(command, &block)
1176
+ end
1177
+
1178
+ # Execute SQL statements.
1179
+ # @param [String] project
1180
+ # Required. Project ID of the project that contains the instance.
1181
+ # @param [String] instance
1182
+ # Required. Database instance ID. This does not include the project ID.
1183
+ # @param [Google::Apis::SqladminV1beta4::ExecuteSqlPayload] execute_sql_payload_object
1184
+ # @param [String] fields
1185
+ # Selector specifying which fields to include in a partial response.
1186
+ # @param [String] quota_user
1187
+ # Available to use for quota purposes for server-side applications. Can be any
1188
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1189
+ # @param [Google::Apis::RequestOptions] options
1190
+ # Request-specific options
1191
+ #
1192
+ # @yield [result, err] Result & error if block supplied
1193
+ # @yieldparam result [Google::Apis::SqladminV1beta4::SqlInstancesExecuteSqlResponse] parsed result object
1194
+ # @yieldparam err [StandardError] error object if request failed
1195
+ #
1196
+ # @return [Google::Apis::SqladminV1beta4::SqlInstancesExecuteSqlResponse]
1197
+ #
1198
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1199
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1200
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1201
+ def execute_instance_sql(project, instance, execute_sql_payload_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1202
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/executeSql', options)
1203
+ command.request_representation = Google::Apis::SqladminV1beta4::ExecuteSqlPayload::Representation
1204
+ command.request_object = execute_sql_payload_object
1205
+ command.response_representation = Google::Apis::SqladminV1beta4::SqlInstancesExecuteSqlResponse::Representation
1206
+ command.response_class = Google::Apis::SqladminV1beta4::SqlInstancesExecuteSqlResponse
1207
+ command.params['project'] = project unless project.nil?
1208
+ command.params['instance'] = instance unless instance.nil?
1209
+ command.query['fields'] = fields unless fields.nil?
1210
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1211
+ execute_or_queue_command(command, &block)
1212
+ end
1213
+
1214
+ # Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump
1215
+ # or CSV file.
1216
+ # @param [String] project
1217
+ # Project ID of the project that contains the instance to be exported.
1218
+ # @param [String] instance
1219
+ # The Cloud SQL instance ID. This doesn't include the project ID.
1220
+ # @param [Google::Apis::SqladminV1beta4::ExportInstancesRequest] export_instances_request_object
1221
+ # @param [String] fields
1222
+ # Selector specifying which fields to include in a partial response.
1223
+ # @param [String] quota_user
1224
+ # Available to use for quota purposes for server-side applications. Can be any
1225
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1226
+ # @param [Google::Apis::RequestOptions] options
1227
+ # Request-specific options
1228
+ #
1229
+ # @yield [result, err] Result & error if block supplied
1230
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1231
+ # @yieldparam err [StandardError] error object if request failed
1232
+ #
1233
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1234
+ #
1235
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1236
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1237
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1238
+ def export_instance(project, instance, export_instances_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1239
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/export', options)
1240
+ command.request_representation = Google::Apis::SqladminV1beta4::ExportInstancesRequest::Representation
1241
+ command.request_object = export_instances_request_object
1242
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1243
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1244
+ command.params['project'] = project unless project.nil?
1245
+ command.params['instance'] = instance unless instance.nil?
1246
+ command.query['fields'] = fields unless fields.nil?
1247
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1248
+ execute_or_queue_command(command, &block)
1249
+ end
1250
+
1251
+ # Initiates a manual failover of a high availability (HA) primary instance to a
1252
+ # standby instance, which becomes the primary instance. Users are then rerouted
1253
+ # to the new primary. For more information, see the [Overview of high
1254
+ # availability](https://cloud.google.com/sql/docs/mysql/high-availability) page
1255
+ # in the Cloud SQL documentation. If using Legacy HA (MySQL only), this causes
1256
+ # the instance to failover to its failover replica instance.
1257
+ # @param [String] project
1258
+ # ID of the project that contains the read replica.
1259
+ # @param [String] instance
1260
+ # Cloud SQL instance ID. This does not include the project ID.
1261
+ # @param [Google::Apis::SqladminV1beta4::InstancesFailoverRequest] instances_failover_request_object
1262
+ # @param [String] fields
1263
+ # Selector specifying which fields to include in a partial response.
1264
+ # @param [String] quota_user
1265
+ # Available to use for quota purposes for server-side applications. Can be any
1266
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1267
+ # @param [Google::Apis::RequestOptions] options
1268
+ # Request-specific options
1269
+ #
1270
+ # @yield [result, err] Result & error if block supplied
1271
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1272
+ # @yieldparam err [StandardError] error object if request failed
1273
+ #
1274
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1275
+ #
1276
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1277
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1278
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1279
+ def failover_instance(project, instance, instances_failover_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1280
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/failover', options)
1281
+ command.request_representation = Google::Apis::SqladminV1beta4::InstancesFailoverRequest::Representation
1282
+ command.request_object = instances_failover_request_object
1283
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1284
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1285
+ command.params['project'] = project unless project.nil?
1286
+ command.params['instance'] = instance unless instance.nil?
1287
+ command.query['fields'] = fields unless fields.nil?
1288
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1289
+ execute_or_queue_command(command, &block)
1290
+ end
1291
+
1292
+ # Retrieves a resource containing information about a Cloud SQL instance.
1293
+ # @param [String] project
1294
+ # Project ID of the project that contains the instance.
1295
+ # @param [String] instance
1296
+ # Database instance ID. This does not include the project ID.
1297
+ # @param [String] fields
1298
+ # Selector specifying which fields to include in a partial response.
1299
+ # @param [String] quota_user
1300
+ # Available to use for quota purposes for server-side applications. Can be any
1301
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1302
+ # @param [Google::Apis::RequestOptions] options
1303
+ # Request-specific options
1304
+ #
1305
+ # @yield [result, err] Result & error if block supplied
1306
+ # @yieldparam result [Google::Apis::SqladminV1beta4::DatabaseInstance] parsed result object
1307
+ # @yieldparam err [StandardError] error object if request failed
1308
+ #
1309
+ # @return [Google::Apis::SqladminV1beta4::DatabaseInstance]
1310
+ #
1311
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1312
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1313
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1314
+ def get_instance(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1315
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
1316
+ command.response_representation = Google::Apis::SqladminV1beta4::DatabaseInstance::Representation
1317
+ command.response_class = Google::Apis::SqladminV1beta4::DatabaseInstance
1318
+ command.params['project'] = project unless project.nil?
1319
+ command.params['instance'] = instance unless instance.nil?
1320
+ command.query['fields'] = fields unless fields.nil?
1321
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1322
+ execute_or_queue_command(command, &block)
1323
+ end
1324
+
1325
+ # Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud
1326
+ # Storage.
1327
+ # @param [String] project
1328
+ # Project ID of the project that contains the instance.
1329
+ # @param [String] instance
1330
+ # Cloud SQL instance ID. This does not include the project ID.
1331
+ # @param [Google::Apis::SqladminV1beta4::ImportInstancesRequest] import_instances_request_object
1332
+ # @param [String] fields
1333
+ # Selector specifying which fields to include in a partial response.
1334
+ # @param [String] quota_user
1335
+ # Available to use for quota purposes for server-side applications. Can be any
1336
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1337
+ # @param [Google::Apis::RequestOptions] options
1338
+ # Request-specific options
1339
+ #
1340
+ # @yield [result, err] Result & error if block supplied
1341
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1342
+ # @yieldparam err [StandardError] error object if request failed
1343
+ #
1344
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1345
+ #
1346
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1347
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1348
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1349
+ def import_instance(project, instance, import_instances_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1350
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/import', options)
1351
+ command.request_representation = Google::Apis::SqladminV1beta4::ImportInstancesRequest::Representation
1352
+ command.request_object = import_instances_request_object
1353
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1354
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1355
+ command.params['project'] = project unless project.nil?
1356
+ command.params['instance'] = instance unless instance.nil?
1357
+ command.query['fields'] = fields unless fields.nil?
1358
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1359
+ execute_or_queue_command(command, &block)
1360
+ end
1361
+
1362
+ # Creates a new Cloud SQL instance.
1363
+ # @param [String] project
1364
+ # Project ID of the project to which the newly created Cloud SQL instances
1365
+ # should belong.
1366
+ # @param [Google::Apis::SqladminV1beta4::DatabaseInstance] database_instance_object
1367
+ # @param [String] fields
1368
+ # Selector specifying which fields to include in a partial response.
1369
+ # @param [String] quota_user
1370
+ # Available to use for quota purposes for server-side applications. Can be any
1371
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1372
+ # @param [Google::Apis::RequestOptions] options
1373
+ # Request-specific options
1374
+ #
1375
+ # @yield [result, err] Result & error if block supplied
1376
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1377
+ # @yieldparam err [StandardError] error object if request failed
1378
+ #
1379
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1380
+ #
1381
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1382
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1383
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1384
+ def insert_instance(project, database_instance_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1385
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances', options)
1386
+ command.request_representation = Google::Apis::SqladminV1beta4::DatabaseInstance::Representation
1387
+ command.request_object = database_instance_object
1388
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1389
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1390
+ command.params['project'] = project unless project.nil?
1391
+ command.query['fields'] = fields unless fields.nil?
1392
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1393
+ execute_or_queue_command(command, &block)
1394
+ end
1395
+
1396
+ # Lists instances under a given project.
1397
+ # @param [String] project
1398
+ # Project ID of the project for which to list Cloud SQL instances.
1399
+ # @param [String] filter
1400
+ # A filter expression that filters resources listed in the response. The
1401
+ # expression is in the form of field:value. For example, 'instanceType:
1402
+ # CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per their JSON
1403
+ # representation, such as 'settings.userLabels.auto_start:true'. Multiple filter
1404
+ # queries are space-separated. For example. 'state:RUNNABLE instanceType:
1405
+ # CLOUD_SQL_INSTANCE'. By default, each expression is an AND expression. However,
1406
+ # you can include AND and OR expressions explicitly.
1407
+ # @param [Fixnum] max_results
1408
+ # The maximum number of instances to return. The service may return fewer than
1409
+ # this value. If unspecified, at most 500 instances are returned. The maximum
1410
+ # value is 1000; values above 1000 are coerced to 1000.
1411
+ # @param [String] page_token
1412
+ # A previously-returned page token representing part of the larger set of
1413
+ # results to view.
1414
+ # @param [String] fields
1415
+ # Selector specifying which fields to include in a partial response.
1416
+ # @param [String] quota_user
1417
+ # Available to use for quota purposes for server-side applications. Can be any
1418
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1419
+ # @param [Google::Apis::RequestOptions] options
1420
+ # Request-specific options
1421
+ #
1422
+ # @yield [result, err] Result & error if block supplied
1423
+ # @yieldparam result [Google::Apis::SqladminV1beta4::ListInstancesResponse] parsed result object
1424
+ # @yieldparam err [StandardError] error object if request failed
1425
+ #
1426
+ # @return [Google::Apis::SqladminV1beta4::ListInstancesResponse]
1427
+ #
1428
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1429
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1430
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1431
+ def list_instances(project, filter: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1432
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances', options)
1433
+ command.response_representation = Google::Apis::SqladminV1beta4::ListInstancesResponse::Representation
1434
+ command.response_class = Google::Apis::SqladminV1beta4::ListInstancesResponse
1435
+ command.params['project'] = project unless project.nil?
1436
+ command.query['filter'] = filter unless filter.nil?
1437
+ command.query['maxResults'] = max_results unless max_results.nil?
1438
+ command.query['pageToken'] = page_token unless page_token.nil?
1439
+ command.query['fields'] = fields unless fields.nil?
1440
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1441
+ execute_or_queue_command(command, &block)
1442
+ end
1443
+
1444
+ # Lists all of the trusted Certificate Authorities (CAs) for the specified
1445
+ # instance. There can be up to three CAs listed: the CA that was used to sign
1446
+ # the certificate that is currently in use, a CA that has been added but not yet
1447
+ # used to sign a certificate, and a CA used to sign a certificate that has
1448
+ # previously rotated out.
1449
+ # @param [String] project
1450
+ # Project ID of the project that contains the instance.
1451
+ # @param [String] instance
1452
+ # Cloud SQL instance ID. This does not include the project ID.
1453
+ # @param [String] fields
1454
+ # Selector specifying which fields to include in a partial response.
1455
+ # @param [String] quota_user
1456
+ # Available to use for quota purposes for server-side applications. Can be any
1457
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1458
+ # @param [Google::Apis::RequestOptions] options
1459
+ # Request-specific options
1460
+ #
1461
+ # @yield [result, err] Result & error if block supplied
1462
+ # @yieldparam result [Google::Apis::SqladminV1beta4::InstancesListServerCasResponse] parsed result object
1463
+ # @yieldparam err [StandardError] error object if request failed
1464
+ #
1465
+ # @return [Google::Apis::SqladminV1beta4::InstancesListServerCasResponse]
1466
+ #
1467
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1468
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1469
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1470
+ def list_instance_server_cas(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1471
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/listServerCas', options)
1472
+ command.response_representation = Google::Apis::SqladminV1beta4::InstancesListServerCasResponse::Representation
1473
+ command.response_class = Google::Apis::SqladminV1beta4::InstancesListServerCasResponse
1474
+ command.params['project'] = project unless project.nil?
1475
+ command.params['instance'] = instance unless instance.nil?
1476
+ command.query['fields'] = fields unless fields.nil?
1477
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1478
+ execute_or_queue_command(command, &block)
1479
+ end
1480
+
1481
+ # Partially updates settings of a Cloud SQL instance by merging the request with
1482
+ # the current configuration. This method supports patch semantics.
1483
+ # @param [String] project
1484
+ # Project ID of the project that contains the instance.
1485
+ # @param [String] instance
1486
+ # Cloud SQL instance ID. This does not include the project ID.
1487
+ # @param [Google::Apis::SqladminV1beta4::DatabaseInstance] database_instance_object
1488
+ # @param [String] fields
1489
+ # Selector specifying which fields to include in a partial response.
1490
+ # @param [String] quota_user
1491
+ # Available to use for quota purposes for server-side applications. Can be any
1492
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1493
+ # @param [Google::Apis::RequestOptions] options
1494
+ # Request-specific options
1495
+ #
1496
+ # @yield [result, err] Result & error if block supplied
1497
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1498
+ # @yieldparam err [StandardError] error object if request failed
1499
+ #
1500
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1501
+ #
1502
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1503
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1504
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1505
+ def patch_instance(project, instance, database_instance_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1506
+ command = make_simple_command(:patch, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
1507
+ command.request_representation = Google::Apis::SqladminV1beta4::DatabaseInstance::Representation
1508
+ command.request_object = database_instance_object
1509
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1510
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1511
+ command.params['project'] = project unless project.nil?
1512
+ command.params['instance'] = instance unless instance.nil?
1513
+ command.query['fields'] = fields unless fields.nil?
1514
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1515
+ execute_or_queue_command(command, &block)
1516
+ end
1517
+
1518
+ # Point in time restore for an instance managed by Google Cloud Backup and
1519
+ # Disaster Recovery.
1520
+ # @param [String] parent
1521
+ # Required. The parent resource where you created this instance. Format:
1522
+ # projects/`project`
1523
+ # @param [Google::Apis::SqladminV1beta4::PointInTimeRestoreContext] point_in_time_restore_context_object
1524
+ # @param [String] fields
878
1525
  # Selector specifying which fields to include in a partial response.
879
1526
  # @param [String] quota_user
880
1527
  # Available to use for quota purposes for server-side applications. Can be any
@@ -883,36 +1530,32 @@ module Google
883
1530
  # Request-specific options
884
1531
  #
885
1532
  # @yield [result, err] Result & error if block supplied
886
- # @yieldparam result [Google::Apis::SqladminV1beta4::ListInstancesResponse] parsed result object
1533
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
887
1534
  # @yieldparam err [StandardError] error object if request failed
888
1535
  #
889
- # @return [Google::Apis::SqladminV1beta4::ListInstancesResponse]
1536
+ # @return [Google::Apis::SqladminV1beta4::Operation]
890
1537
  #
891
1538
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
892
1539
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
893
1540
  # @raise [Google::Apis::AuthorizationError] Authorization is required
894
- def list_instances(project, filter: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
895
- command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances', options)
896
- command.response_representation = Google::Apis::SqladminV1beta4::ListInstancesResponse::Representation
897
- command.response_class = Google::Apis::SqladminV1beta4::ListInstancesResponse
898
- command.params['project'] = project unless project.nil?
899
- command.query['filter'] = filter unless filter.nil?
900
- command.query['maxResults'] = max_results unless max_results.nil?
901
- command.query['pageToken'] = page_token unless page_token.nil?
1541
+ def point_instance_in_time_restore(parent, point_in_time_restore_context_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1542
+ command = make_simple_command(:post, 'sql/v1beta4/{+parent}:pointInTimeRestore', options)
1543
+ command.request_representation = Google::Apis::SqladminV1beta4::PointInTimeRestoreContext::Representation
1544
+ command.request_object = point_in_time_restore_context_object
1545
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1546
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1547
+ command.params['parent'] = parent unless parent.nil?
902
1548
  command.query['fields'] = fields unless fields.nil?
903
1549
  command.query['quotaUser'] = quota_user unless quota_user.nil?
904
1550
  execute_or_queue_command(command, &block)
905
1551
  end
906
1552
 
907
- # Lists all of the trusted Certificate Authorities (CAs) for the specified
908
- # instance. There can be up to three CAs listed: the CA that was used to sign
909
- # the certificate that is currently in use, a CA that has been added but not yet
910
- # used to sign a certificate, and a CA used to sign a certificate that has
911
- # previously rotated out.
1553
+ # Execute MVU Pre-checks
912
1554
  # @param [String] project
913
- # Project ID of the project that contains the instance.
1555
+ # Required. Project ID of the project that contains the instance.
914
1556
  # @param [String] instance
915
- # Cloud SQL instance ID. This does not include the project ID.
1557
+ # Required. Cloud SQL instance ID. This does not include the project ID.
1558
+ # @param [Google::Apis::SqladminV1beta4::InstancesPreCheckMajorVersionUpgradeRequest] instances_pre_check_major_version_upgrade_request_object
916
1559
  # @param [String] fields
917
1560
  # Selector specifying which fields to include in a partial response.
918
1561
  # @param [String] quota_user
@@ -922,18 +1565,20 @@ module Google
922
1565
  # Request-specific options
923
1566
  #
924
1567
  # @yield [result, err] Result & error if block supplied
925
- # @yieldparam result [Google::Apis::SqladminV1beta4::InstancesListServerCasResponse] parsed result object
1568
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
926
1569
  # @yieldparam err [StandardError] error object if request failed
927
1570
  #
928
- # @return [Google::Apis::SqladminV1beta4::InstancesListServerCasResponse]
1571
+ # @return [Google::Apis::SqladminV1beta4::Operation]
929
1572
  #
930
1573
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
931
1574
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
932
1575
  # @raise [Google::Apis::AuthorizationError] Authorization is required
933
- def list_instance_server_cas(project, instance, fields: nil, quota_user: nil, options: nil, &block)
934
- command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/listServerCas', options)
935
- command.response_representation = Google::Apis::SqladminV1beta4::InstancesListServerCasResponse::Representation
936
- command.response_class = Google::Apis::SqladminV1beta4::InstancesListServerCasResponse
1576
+ def pre_instance_check_major_version_upgrade(project, instance, instances_pre_check_major_version_upgrade_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1577
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/preCheckMajorVersionUpgrade', options)
1578
+ command.request_representation = Google::Apis::SqladminV1beta4::InstancesPreCheckMajorVersionUpgradeRequest::Representation
1579
+ command.request_object = instances_pre_check_major_version_upgrade_request_object
1580
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1581
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
937
1582
  command.params['project'] = project unless project.nil?
938
1583
  command.params['instance'] = instance unless instance.nil?
939
1584
  command.query['fields'] = fields unless fields.nil?
@@ -941,13 +1586,18 @@ module Google
941
1586
  execute_or_queue_command(command, &block)
942
1587
  end
943
1588
 
944
- # Partially updates settings of a Cloud SQL instance by merging the request with
945
- # the current configuration. This method supports patch semantics.
1589
+ # Promotes the read replica instance to be an independent Cloud SQL primary
1590
+ # instance. Using this operation might cause your instance to restart.
946
1591
  # @param [String] project
947
- # Project ID of the project that contains the instance.
1592
+ # ID of the project that contains the read replica.
948
1593
  # @param [String] instance
949
- # Cloud SQL instance ID. This does not include the project ID.
950
- # @param [Google::Apis::SqladminV1beta4::DatabaseInstance] database_instance_object
1594
+ # Cloud SQL read replica instance name.
1595
+ # @param [Boolean] failover
1596
+ # Set to true to invoke a replica failover to the DR replica. As part of replica
1597
+ # failover, the promote operation attempts to add the original primary instance
1598
+ # as a replica of the promoted DR replica when the original primary instance
1599
+ # comes back online. If set to false or not specified, then the original primary
1600
+ # instance becomes an independent Cloud SQL primary instance.
951
1601
  # @param [String] fields
952
1602
  # Selector specifying which fields to include in a partial response.
953
1603
  # @param [String] quota_user
@@ -965,25 +1615,24 @@ module Google
965
1615
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
966
1616
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
967
1617
  # @raise [Google::Apis::AuthorizationError] Authorization is required
968
- def patch_instance(project, instance, database_instance_object = nil, fields: nil, quota_user: nil, options: nil, &block)
969
- command = make_simple_command(:patch, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
970
- command.request_representation = Google::Apis::SqladminV1beta4::DatabaseInstance::Representation
971
- command.request_object = database_instance_object
1618
+ def promote_instance_replica(project, instance, failover: nil, fields: nil, quota_user: nil, options: nil, &block)
1619
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica', options)
972
1620
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
973
1621
  command.response_class = Google::Apis::SqladminV1beta4::Operation
974
1622
  command.params['project'] = project unless project.nil?
975
1623
  command.params['instance'] = instance unless instance.nil?
1624
+ command.query['failover'] = failover unless failover.nil?
976
1625
  command.query['fields'] = fields unless fields.nil?
977
1626
  command.query['quotaUser'] = quota_user unless quota_user.nil?
978
1627
  execute_or_queue_command(command, &block)
979
1628
  end
980
1629
 
981
- # Promotes the read replica instance to be a stand-alone Cloud SQL instance.
982
- # Using this operation might cause your instance to restart.
1630
+ # Reencrypt CMEK instance with latest key version.
983
1631
  # @param [String] project
984
- # ID of the project that contains the read replica.
1632
+ # ID of the project that contains the instance.
985
1633
  # @param [String] instance
986
- # Cloud SQL read replica instance name.
1634
+ # Cloud SQL instance ID. This does not include the project ID.
1635
+ # @param [Google::Apis::SqladminV1beta4::InstancesReencryptRequest] instances_reencrypt_request_object
987
1636
  # @param [String] fields
988
1637
  # Selector specifying which fields to include in a partial response.
989
1638
  # @param [String] quota_user
@@ -1001,8 +1650,10 @@ module Google
1001
1650
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1002
1651
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1003
1652
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1004
- def promote_instance_replica(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1005
- command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica', options)
1653
+ def reencrypt_instance(project, instance, instances_reencrypt_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1654
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/reencrypt', options)
1655
+ command.request_representation = Google::Apis::SqladminV1beta4::InstancesReencryptRequest::Representation
1656
+ command.request_object = instances_reencrypt_request_object
1006
1657
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1007
1658
  command.response_class = Google::Apis::SqladminV1beta4::Operation
1008
1659
  command.params['project'] = project unless project.nil?
@@ -1012,12 +1663,50 @@ module Google
1012
1663
  execute_or_queue_command(command, &block)
1013
1664
  end
1014
1665
 
1666
+ # Release a lease for the setup of SQL Server Reporting Services (SSRS).
1667
+ # @param [String] project
1668
+ # Required. The ID of the project that contains the instance (Example: project-
1669
+ # id).
1670
+ # @param [String] instance
1671
+ # Required. The Cloud SQL instance ID. This doesn't include the project ID. It's
1672
+ # composed of lowercase letters, numbers, and hyphens, and it must start with a
1673
+ # letter. The total length must be 98 characters or less (Example: instance-id).
1674
+ # @param [String] fields
1675
+ # Selector specifying which fields to include in a partial response.
1676
+ # @param [String] quota_user
1677
+ # Available to use for quota purposes for server-side applications. Can be any
1678
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1679
+ # @param [Google::Apis::RequestOptions] options
1680
+ # Request-specific options
1681
+ #
1682
+ # @yield [result, err] Result & error if block supplied
1683
+ # @yieldparam result [Google::Apis::SqladminV1beta4::SqlInstancesReleaseSsrsLeaseResponse] parsed result object
1684
+ # @yieldparam err [StandardError] error object if request failed
1685
+ #
1686
+ # @return [Google::Apis::SqladminV1beta4::SqlInstancesReleaseSsrsLeaseResponse]
1687
+ #
1688
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1689
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1690
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1691
+ def release_instance_ssrs_lease(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1692
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/releaseSsrsLease', options)
1693
+ command.response_representation = Google::Apis::SqladminV1beta4::SqlInstancesReleaseSsrsLeaseResponse::Representation
1694
+ command.response_class = Google::Apis::SqladminV1beta4::SqlInstancesReleaseSsrsLeaseResponse
1695
+ command.params['project'] = project unless project.nil?
1696
+ command.params['instance'] = instance unless instance.nil?
1697
+ command.query['fields'] = fields unless fields.nil?
1698
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1699
+ execute_or_queue_command(command, &block)
1700
+ end
1701
+
1015
1702
  # Deletes all client certificates and generates a new server SSL certificate for
1016
1703
  # the instance.
1017
1704
  # @param [String] project
1018
1705
  # Project ID of the project that contains the instance.
1019
1706
  # @param [String] instance
1020
1707
  # Cloud SQL instance ID. This does not include the project ID.
1708
+ # @param [String] mode
1709
+ # Optional. Reset SSL mode to use.
1021
1710
  # @param [String] fields
1022
1711
  # Selector specifying which fields to include in a partial response.
1023
1712
  # @param [String] quota_user
@@ -1035,12 +1724,13 @@ module Google
1035
1724
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1036
1725
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1037
1726
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1038
- def reset_instance_ssl_config(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1727
+ def reset_instance_ssl_config(project, instance, mode: nil, fields: nil, quota_user: nil, options: nil, &block)
1039
1728
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig', options)
1040
1729
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1041
1730
  command.response_class = Google::Apis::SqladminV1beta4::Operation
1042
1731
  command.params['project'] = project unless project.nil?
1043
1732
  command.params['instance'] = instance unless instance.nil?
1733
+ command.query['mode'] = mode unless mode.nil?
1044
1734
  command.query['fields'] = fields unless fields.nil?
1045
1735
  command.query['quotaUser'] = quota_user unless quota_user.nil?
1046
1736
  execute_or_queue_command(command, &block)
@@ -1117,7 +1807,9 @@ module Google
1117
1807
  end
1118
1808
 
1119
1809
  # Rotates the server certificate to one signed by the Certificate Authority (CA)
1120
- # version previously added with the addServerCA method.
1810
+ # version previously added with the addServerCA method. For instances that have
1811
+ # enabled Certificate Authority Service (CAS) based server CA, use
1812
+ # RotateServerCertificate to rotate the server certificate.
1121
1813
  # @param [String] project
1122
1814
  # Project ID of the project that contains the instance.
1123
1815
  # @param [String] instance
@@ -1219,6 +1911,44 @@ module Google
1219
1911
  execute_or_queue_command(command, &block)
1220
1912
  end
1221
1913
 
1914
+ # Switches over from the primary instance to the DR replica instance.
1915
+ # @param [String] project
1916
+ # ID of the project that contains the replica.
1917
+ # @param [String] instance
1918
+ # Cloud SQL read replica instance name.
1919
+ # @param [String] db_timeout
1920
+ # Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations timeout,
1921
+ # which is a sum of all database operations. Default value is 10 minutes and can
1922
+ # be modified to a maximum value of 24 hours.
1923
+ # @param [String] fields
1924
+ # Selector specifying which fields to include in a partial response.
1925
+ # @param [String] quota_user
1926
+ # Available to use for quota purposes for server-side applications. Can be any
1927
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1928
+ # @param [Google::Apis::RequestOptions] options
1929
+ # Request-specific options
1930
+ #
1931
+ # @yield [result, err] Result & error if block supplied
1932
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1933
+ # @yieldparam err [StandardError] error object if request failed
1934
+ #
1935
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1936
+ #
1937
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1938
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1939
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1940
+ def switchover_instance(project, instance, db_timeout: nil, fields: nil, quota_user: nil, options: nil, &block)
1941
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/switchover', options)
1942
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1943
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1944
+ command.params['project'] = project unless project.nil?
1945
+ command.params['instance'] = instance unless instance.nil?
1946
+ command.query['dbTimeout'] = db_timeout unless db_timeout.nil?
1947
+ command.query['fields'] = fields unless fields.nil?
1948
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1949
+ execute_or_queue_command(command, &block)
1950
+ end
1951
+
1222
1952
  # Truncate MySQL general and slow query log tables MySQL only.
1223
1953
  # @param [String] project
1224
1954
  # Project ID of the Cloud SQL project.
@@ -1292,6 +2022,40 @@ module Google
1292
2022
  execute_or_queue_command(command, &block)
1293
2023
  end
1294
2024
 
2025
+ # Cancels an instance operation that has been performed on an instance.
2026
+ # Ordinarily, this method name should be `CancelSqlOperation`.
2027
+ # @param [String] project
2028
+ # Project ID of the project that contains the instance.
2029
+ # @param [String] operation
2030
+ # Instance operation ID.
2031
+ # @param [String] fields
2032
+ # Selector specifying which fields to include in a partial response.
2033
+ # @param [String] quota_user
2034
+ # Available to use for quota purposes for server-side applications. Can be any
2035
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2036
+ # @param [Google::Apis::RequestOptions] options
2037
+ # Request-specific options
2038
+ #
2039
+ # @yield [result, err] Result & error if block supplied
2040
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Empty] parsed result object
2041
+ # @yieldparam err [StandardError] error object if request failed
2042
+ #
2043
+ # @return [Google::Apis::SqladminV1beta4::Empty]
2044
+ #
2045
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2046
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2047
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2048
+ def cancel_operation(project, operation, fields: nil, quota_user: nil, options: nil, &block)
2049
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/operations/{operation}/cancel', options)
2050
+ command.response_representation = Google::Apis::SqladminV1beta4::Empty::Representation
2051
+ command.response_class = Google::Apis::SqladminV1beta4::Empty
2052
+ command.params['project'] = project unless project.nil?
2053
+ command.params['operation'] = operation unless operation.nil?
2054
+ command.query['fields'] = fields unless fields.nil?
2055
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2056
+ execute_or_queue_command(command, &block)
2057
+ end
2058
+
1295
2059
  # Retrieves an instance operation that has been performed on an instance.
1296
2060
  # @param [String] project
1297
2061
  # Project ID of the project that contains the instance.
@@ -1366,6 +2130,112 @@ module Google
1366
2130
  execute_or_queue_command(command, &block)
1367
2131
  end
1368
2132
 
2133
+ # Get Disk Shrink Config for a given instance.
2134
+ # @param [String] project
2135
+ # Project ID of the project that contains the instance.
2136
+ # @param [String] instance
2137
+ # Cloud SQL instance ID. This does not include the project ID.
2138
+ # @param [String] fields
2139
+ # Selector specifying which fields to include in a partial response.
2140
+ # @param [String] quota_user
2141
+ # Available to use for quota purposes for server-side applications. Can be any
2142
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2143
+ # @param [Google::Apis::RequestOptions] options
2144
+ # Request-specific options
2145
+ #
2146
+ # @yield [result, err] Result & error if block supplied
2147
+ # @yieldparam result [Google::Apis::SqladminV1beta4::SqlInstancesGetDiskShrinkConfigResponse] parsed result object
2148
+ # @yieldparam err [StandardError] error object if request failed
2149
+ #
2150
+ # @return [Google::Apis::SqladminV1beta4::SqlInstancesGetDiskShrinkConfigResponse]
2151
+ #
2152
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2153
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2154
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2155
+ def get_project_instance_disk_shrink_config(project, instance, fields: nil, quota_user: nil, options: nil, &block)
2156
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/getDiskShrinkConfig', options)
2157
+ command.response_representation = Google::Apis::SqladminV1beta4::SqlInstancesGetDiskShrinkConfigResponse::Representation
2158
+ command.response_class = Google::Apis::SqladminV1beta4::SqlInstancesGetDiskShrinkConfigResponse
2159
+ command.params['project'] = project unless project.nil?
2160
+ command.params['instance'] = instance unless instance.nil?
2161
+ command.query['fields'] = fields unless fields.nil?
2162
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2163
+ execute_or_queue_command(command, &block)
2164
+ end
2165
+
2166
+ # Get Latest Recovery Time for a given instance.
2167
+ # @param [String] project
2168
+ # Project ID of the project that contains the instance.
2169
+ # @param [String] instance
2170
+ # Cloud SQL instance ID. This does not include the project ID.
2171
+ # @param [String] source_instance_deletion_time
2172
+ # The timestamp used to identify the time when the source instance is deleted.
2173
+ # If this instance is deleted, then you must set the timestamp.
2174
+ # @param [String] fields
2175
+ # Selector specifying which fields to include in a partial response.
2176
+ # @param [String] quota_user
2177
+ # Available to use for quota purposes for server-side applications. Can be any
2178
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2179
+ # @param [Google::Apis::RequestOptions] options
2180
+ # Request-specific options
2181
+ #
2182
+ # @yield [result, err] Result & error if block supplied
2183
+ # @yieldparam result [Google::Apis::SqladminV1beta4::SqlInstancesGetLatestRecoveryTimeResponse] parsed result object
2184
+ # @yieldparam err [StandardError] error object if request failed
2185
+ #
2186
+ # @return [Google::Apis::SqladminV1beta4::SqlInstancesGetLatestRecoveryTimeResponse]
2187
+ #
2188
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2189
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2190
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2191
+ def get_project_instance_latest_recovery_time(project, instance, source_instance_deletion_time: nil, fields: nil, quota_user: nil, options: nil, &block)
2192
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/getLatestRecoveryTime', options)
2193
+ command.response_representation = Google::Apis::SqladminV1beta4::SqlInstancesGetLatestRecoveryTimeResponse::Representation
2194
+ command.response_class = Google::Apis::SqladminV1beta4::SqlInstancesGetLatestRecoveryTimeResponse
2195
+ command.params['project'] = project unless project.nil?
2196
+ command.params['instance'] = instance unless instance.nil?
2197
+ command.query['sourceInstanceDeletionTime'] = source_instance_deletion_time unless source_instance_deletion_time.nil?
2198
+ command.query['fields'] = fields unless fields.nil?
2199
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2200
+ execute_or_queue_command(command, &block)
2201
+ end
2202
+
2203
+ # Perform Disk Shrink on primary instance.
2204
+ # @param [String] project
2205
+ # Project ID of the project that contains the instance.
2206
+ # @param [String] instance
2207
+ # Cloud SQL instance ID. This does not include the project ID.
2208
+ # @param [Google::Apis::SqladminV1beta4::PerformDiskShrinkContext] perform_disk_shrink_context_object
2209
+ # @param [String] fields
2210
+ # Selector specifying which fields to include in a partial response.
2211
+ # @param [String] quota_user
2212
+ # Available to use for quota purposes for server-side applications. Can be any
2213
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2214
+ # @param [Google::Apis::RequestOptions] options
2215
+ # Request-specific options
2216
+ #
2217
+ # @yield [result, err] Result & error if block supplied
2218
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
2219
+ # @yieldparam err [StandardError] error object if request failed
2220
+ #
2221
+ # @return [Google::Apis::SqladminV1beta4::Operation]
2222
+ #
2223
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2224
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2225
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2226
+ def perform_project_instance_disk_shrink(project, instance, perform_disk_shrink_context_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2227
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/performDiskShrink', options)
2228
+ command.request_representation = Google::Apis::SqladminV1beta4::PerformDiskShrinkContext::Representation
2229
+ command.request_object = perform_disk_shrink_context_object
2230
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
2231
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
2232
+ command.params['project'] = project unless project.nil?
2233
+ command.params['instance'] = instance unless instance.nil?
2234
+ command.query['fields'] = fields unless fields.nil?
2235
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2236
+ execute_or_queue_command(command, &block)
2237
+ end
2238
+
1369
2239
  # Reschedules the maintenance on the given instance.
1370
2240
  # @param [String] project
1371
2241
  # ID of the project that contains the instance.
@@ -1402,6 +2272,42 @@ module Google
1402
2272
  execute_or_queue_command(command, &block)
1403
2273
  end
1404
2274
 
2275
+ # Reset Replica Size to primary instance disk size.
2276
+ # @param [String] project
2277
+ # ID of the project that contains the read replica.
2278
+ # @param [String] instance
2279
+ # Cloud SQL read replica instance name.
2280
+ # @param [Google::Apis::SqladminV1beta4::SqlInstancesResetReplicaSizeRequest] sql_instances_reset_replica_size_request_object
2281
+ # @param [String] fields
2282
+ # Selector specifying which fields to include in a partial response.
2283
+ # @param [String] quota_user
2284
+ # Available to use for quota purposes for server-side applications. Can be any
2285
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2286
+ # @param [Google::Apis::RequestOptions] options
2287
+ # Request-specific options
2288
+ #
2289
+ # @yield [result, err] Result & error if block supplied
2290
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
2291
+ # @yieldparam err [StandardError] error object if request failed
2292
+ #
2293
+ # @return [Google::Apis::SqladminV1beta4::Operation]
2294
+ #
2295
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2296
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2297
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2298
+ def reset_project_instance_replica_size(project, instance, sql_instances_reset_replica_size_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2299
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/resetReplicaSize', options)
2300
+ command.request_representation = Google::Apis::SqladminV1beta4::SqlInstancesResetReplicaSizeRequest::Representation
2301
+ command.request_object = sql_instances_reset_replica_size_request_object
2302
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
2303
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
2304
+ command.params['project'] = project unless project.nil?
2305
+ command.params['instance'] = instance unless instance.nil?
2306
+ command.query['fields'] = fields unless fields.nil?
2307
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2308
+ execute_or_queue_command(command, &block)
2309
+ end
2310
+
1405
2311
  # Start External primary instance migration.
1406
2312
  # @param [String] project
1407
2313
  # ID of the project that contains the instance.
@@ -1842,10 +2748,15 @@ module Google
1842
2748
  # @param [String] instance
1843
2749
  # Database instance ID. This does not include the project ID.
1844
2750
  # @param [Google::Apis::SqladminV1beta4::User] user_object
2751
+ # @param [Array<String>, String] database_roles
2752
+ # Optional. List of database roles to grant to the user. body.database_roles
2753
+ # will be ignored for update request.
1845
2754
  # @param [String] host
1846
2755
  # Optional. Host of the user in the instance.
1847
2756
  # @param [String] name
1848
2757
  # Name of the user in the instance.
2758
+ # @param [Boolean] revoke_existing_roles
2759
+ # Optional. revoke the existing roles granted to the user.
1849
2760
  # @param [String] fields
1850
2761
  # Selector specifying which fields to include in a partial response.
1851
2762
  # @param [String] quota_user
@@ -1863,7 +2774,7 @@ module Google
1863
2774
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1864
2775
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1865
2776
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1866
- def update_user(project, instance, user_object = nil, host: nil, name: nil, fields: nil, quota_user: nil, options: nil, &block)
2777
+ def update_user(project, instance, user_object = nil, database_roles: nil, host: nil, name: nil, revoke_existing_roles: nil, fields: nil, quota_user: nil, options: nil, &block)
1867
2778
  command = make_simple_command(:put, 'sql/v1beta4/projects/{project}/instances/{instance}/users', options)
1868
2779
  command.request_representation = Google::Apis::SqladminV1beta4::User::Representation
1869
2780
  command.request_object = user_object
@@ -1871,8 +2782,10 @@ module Google
1871
2782
  command.response_class = Google::Apis::SqladminV1beta4::Operation
1872
2783
  command.params['project'] = project unless project.nil?
1873
2784
  command.params['instance'] = instance unless instance.nil?
2785
+ command.query['databaseRoles'] = database_roles unless database_roles.nil?
1874
2786
  command.query['host'] = host unless host.nil?
1875
2787
  command.query['name'] = name unless name.nil?
2788
+ command.query['revokeExistingRoles'] = revoke_existing_roles unless revoke_existing_roles.nil?
1876
2789
  command.query['fields'] = fields unless fields.nil?
1877
2790
  command.query['quotaUser'] = quota_user unless quota_user.nil?
1878
2791
  execute_or_queue_command(command, &block)