google-apis-sqladmin_v1beta4 0.73.0 → 0.94.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,7 +30,7 @@ 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
35
  DEFAULT_ENDPOINT_TEMPLATE = "https://sqladmin.$UNIVERSE_DOMAIN$/"
36
36
 
@@ -203,6 +203,190 @@ module Google
203
203
  execute_or_queue_command(command, &block)
204
204
  end
205
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
+
206
390
  # Generates a short-lived X509 certificate containing the provided public key
207
391
  # and signed by a private key specific to the target instance. Users may use the
208
392
  # certificate to authenticate as themselves when connecting to the database.
@@ -504,6 +688,9 @@ module Google
504
688
  # @param [String] database_version
505
689
  # Database type and version you want to retrieve flags for. By default, this
506
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.
507
694
  # @param [String] fields
508
695
  # Selector specifying which fields to include in a partial response.
509
696
  # @param [String] quota_user
@@ -521,11 +708,161 @@ module Google
521
708
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
522
709
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
523
710
  # @raise [Google::Apis::AuthorizationError] Authorization is required
524
- 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)
525
712
  command = make_simple_command(:get, 'sql/v1beta4/flags', options)
526
713
  command.response_representation = Google::Apis::SqladminV1beta4::ListFlagsResponse::Representation
527
714
  command.response_class = Google::Apis::SqladminV1beta4::ListFlagsResponse
528
715
  command.query['databaseVersion'] = database_version unless database_version.nil?
716
+ command.query['flagScope'] = flag_scope unless flag_scope.nil?
717
+ command.query['fields'] = fields unless fields.nil?
718
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
719
+ execute_or_queue_command(command, &block)
720
+ end
721
+
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.
726
+ # @param [String] project
727
+ # Required. Project ID of the project that contains the instance.
728
+ # @param [String] instance
729
+ # Required. Cloud SQL instance ID. This does not include the project ID.
730
+ # @param [String] fields
731
+ # Selector specifying which fields to include in a partial response.
732
+ # @param [String] quota_user
733
+ # Available to use for quota purposes for server-side applications. Can be any
734
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
735
+ # @param [Google::Apis::RequestOptions] options
736
+ # Request-specific options
737
+ #
738
+ # @yield [result, err] Result & error if block supplied
739
+ # @yieldparam result [Google::Apis::SqladminV1beta4::InstancesListEntraIdCertificatesResponse] parsed result object
740
+ # @yieldparam err [StandardError] error object if request failed
741
+ #
742
+ # @return [Google::Apis::SqladminV1beta4::InstancesListEntraIdCertificatesResponse]
743
+ #
744
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
745
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
746
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
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
751
+ command.params['project'] = project unless project.nil?
752
+ command.params['instance'] = instance unless instance.nil?
753
+ command.query['fields'] = fields unless fields.nil?
754
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
755
+ execute_or_queue_command(command, &block)
756
+ end
757
+
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.
764
+ # @param [String] project
765
+ # Required. Project ID of the project that contains the instance.
766
+ # @param [String] instance
767
+ # Required. Cloud SQL instance ID. This does not include the project ID.
768
+ # @param [String] fields
769
+ # Selector specifying which fields to include in a partial response.
770
+ # @param [String] quota_user
771
+ # Available to use for quota purposes for server-side applications. Can be any
772
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
773
+ # @param [Google::Apis::RequestOptions] options
774
+ # Request-specific options
775
+ #
776
+ # @yield [result, err] Result & error if block supplied
777
+ # @yieldparam result [Google::Apis::SqladminV1beta4::InstancesListServerCertificatesResponse] parsed result object
778
+ # @yieldparam err [StandardError] error object if request failed
779
+ #
780
+ # @return [Google::Apis::SqladminV1beta4::InstancesListServerCertificatesResponse]
781
+ #
782
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
783
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
784
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
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
789
+ command.params['project'] = project unless project.nil?
790
+ command.params['instance'] = instance unless instance.nil?
791
+ command.query['fields'] = fields unless fields.nil?
792
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
793
+ execute_or_queue_command(command, &block)
794
+ end
795
+
796
+ # Rotates the Entra Id certificate version to one previously added with the
797
+ # addEntraIdCertificate method.
798
+ # @param [String] project
799
+ # Required. Project ID of the project that contains the instance.
800
+ # @param [String] instance
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
803
+ # @param [String] fields
804
+ # Selector specifying which fields to include in a partial response.
805
+ # @param [String] quota_user
806
+ # Available to use for quota purposes for server-side applications. Can be any
807
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
808
+ # @param [Google::Apis::RequestOptions] options
809
+ # Request-specific options
810
+ #
811
+ # @yield [result, err] Result & error if block supplied
812
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
813
+ # @yieldparam err [StandardError] error object if request failed
814
+ #
815
+ # @return [Google::Apis::SqladminV1beta4::Operation]
816
+ #
817
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
818
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
819
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
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
824
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
825
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
826
+ command.params['project'] = project unless project.nil?
827
+ command.params['instance'] = instance unless instance.nil?
828
+ command.query['fields'] = fields unless fields.nil?
829
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
830
+ execute_or_queue_command(command, &block)
831
+ end
832
+
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.
836
+ # @param [String] project
837
+ # Required. Project ID of the project that contains the instance.
838
+ # @param [String] instance
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
841
+ # @param [String] fields
842
+ # Selector specifying which fields to include in a partial response.
843
+ # @param [String] quota_user
844
+ # Available to use for quota purposes for server-side applications. Can be any
845
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
846
+ # @param [Google::Apis::RequestOptions] options
847
+ # Request-specific options
848
+ #
849
+ # @yield [result, err] Result & error if block supplied
850
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
851
+ # @yieldparam err [StandardError] error object if request failed
852
+ #
853
+ # @return [Google::Apis::SqladminV1beta4::Operation]
854
+ #
855
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
856
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
857
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
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
862
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
863
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
864
+ command.params['project'] = project unless project.nil?
865
+ command.params['instance'] = instance unless instance.nil?
529
866
  command.query['fields'] = fields unless fields.nil?
530
867
  command.query['quotaUser'] = quota_user unless quota_user.nil?
531
868
  execute_or_queue_command(command, &block)
@@ -569,11 +906,50 @@ module Google
569
906
  execute_or_queue_command(command, &block)
570
907
  end
571
908
 
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.
912
+ # @param [String] project
913
+ # Required. Project ID of the project that contains the instance.
914
+ # @param [String] instance
915
+ # Required. Cloud SQL instance ID. This does not include the project ID.
916
+ # @param [Google::Apis::SqladminV1beta4::SqlInstancesAddEntraIdCertificateRequest] sql_instances_add_entra_id_certificate_request_object
917
+ # @param [String] fields
918
+ # Selector specifying which fields to include in a partial response.
919
+ # @param [String] quota_user
920
+ # Available to use for quota purposes for server-side applications. Can be any
921
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
922
+ # @param [Google::Apis::RequestOptions] options
923
+ # Request-specific options
924
+ #
925
+ # @yield [result, err] Result & error if block supplied
926
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
927
+ # @yieldparam err [StandardError] error object if request failed
928
+ #
929
+ # @return [Google::Apis::SqladminV1beta4::Operation]
930
+ #
931
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
932
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
933
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
934
+ def add_instance_entra_id_certificate(project, instance, sql_instances_add_entra_id_certificate_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
935
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/addEntraIdCertificate', options)
936
+ command.request_representation = Google::Apis::SqladminV1beta4::SqlInstancesAddEntraIdCertificateRequest::Representation
937
+ command.request_object = sql_instances_add_entra_id_certificate_request_object
938
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
939
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
940
+ command.params['project'] = project unless project.nil?
941
+ command.params['instance'] = instance unless instance.nil?
942
+ command.query['fields'] = fields unless fields.nil?
943
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
944
+ execute_or_queue_command(command, &block)
945
+ end
946
+
572
947
  # Add a new trusted Certificate Authority (CA) version for the specified
573
948
  # instance. Required to prepare for a certificate rotation. If a CA version was
574
949
  # previously added but never used in a certificate rotation, this operation
575
950
  # replaces that version. There cannot be more than one CA version waiting to be
576
- # rotated in.
951
+ # rotated in. For instances that have enabled Certificate Authority Service (CAS)
952
+ # based server CA, use AddServerCertificate to add a new server certificate.
577
953
  # @param [String] project
578
954
  # Project ID of the project that contains the instance.
579
955
  # @param [String] instance
@@ -606,6 +982,44 @@ module Google
606
982
  execute_or_queue_command(command, &block)
607
983
  end
608
984
 
985
+ # Add a new trusted server certificate version for the specified instance using
986
+ # Certificate Authority Service (CAS) server CA. Required to prepare for a
987
+ # certificate rotation. If a server certificate version was previously added but
988
+ # never used in a certificate rotation, this operation replaces that version.
989
+ # There cannot be more than one certificate version waiting to be rotated in.
990
+ # For instances not using CAS server CA, use AddServerCa instead.
991
+ # @param [String] project
992
+ # Required. Project ID of the project that contains the instance.
993
+ # @param [String] instance
994
+ # Required. Cloud SQL instance ID. This does not include the project ID.
995
+ # @param [String] fields
996
+ # Selector specifying which fields to include in a partial response.
997
+ # @param [String] quota_user
998
+ # Available to use for quota purposes for server-side applications. Can be any
999
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1000
+ # @param [Google::Apis::RequestOptions] options
1001
+ # Request-specific options
1002
+ #
1003
+ # @yield [result, err] Result & error if block supplied
1004
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1005
+ # @yieldparam err [StandardError] error object if request failed
1006
+ #
1007
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1008
+ #
1009
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1010
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1011
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1012
+ def add_instance_server_certificate(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1013
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/addServerCertificate', options)
1014
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1015
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1016
+ command.params['project'] = project unless project.nil?
1017
+ command.params['instance'] = instance unless instance.nil?
1018
+ command.query['fields'] = fields unless fields.nil?
1019
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1020
+ execute_or_queue_command(command, &block)
1021
+ end
1022
+
609
1023
  # Creates a Cloud SQL instance as a clone of the source instance. Using this
610
1024
  # operation might cause your instance to restart.
611
1025
  # @param [String] project
@@ -649,6 +1063,15 @@ module Google
649
1063
  # Project ID of the project that contains the instance to be deleted.
650
1064
  # @param [String] instance
651
1065
  # Cloud SQL instance ID. This does not include the project ID.
1066
+ # @param [Boolean] enable_final_backup
1067
+ # Flag to opt-in for final backup. By default, it is turned off.
1068
+ # @param [String] final_backup_description
1069
+ # Optional. The description of the final backup.
1070
+ # @param [String] final_backup_expiry_time
1071
+ # Optional. Final Backup expiration time. Timestamp in UTC of when this resource
1072
+ # is considered expired.
1073
+ # @param [Fixnum] final_backup_ttl_days
1074
+ # Optional. Retention period of the final backup.
652
1075
  # @param [String] fields
653
1076
  # Selector specifying which fields to include in a partial response.
654
1077
  # @param [String] quota_user
@@ -666,12 +1089,16 @@ module Google
666
1089
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
667
1090
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
668
1091
  # @raise [Google::Apis::AuthorizationError] Authorization is required
669
- def delete_instance(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1092
+ 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)
670
1093
  command = make_simple_command(:delete, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
671
1094
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
672
1095
  command.response_class = Google::Apis::SqladminV1beta4::Operation
673
1096
  command.params['project'] = project unless project.nil?
674
1097
  command.params['instance'] = instance unless instance.nil?
1098
+ command.query['enableFinalBackup'] = enable_final_backup unless enable_final_backup.nil?
1099
+ command.query['finalBackupDescription'] = final_backup_description unless final_backup_description.nil?
1100
+ command.query['finalBackupExpiryTime'] = final_backup_expiry_time unless final_backup_expiry_time.nil?
1101
+ command.query['finalBackupTtlDays'] = final_backup_ttl_days unless final_backup_ttl_days.nil?
675
1102
  command.query['fields'] = fields unless fields.nil?
676
1103
  command.query['quotaUser'] = quota_user unless quota_user.nil?
677
1104
  execute_or_queue_command(command, &block)
@@ -751,6 +1178,42 @@ module Google
751
1178
  execute_or_queue_command(command, &block)
752
1179
  end
753
1180
 
1181
+ # Execute SQL statements.
1182
+ # @param [String] project
1183
+ # Required. Project ID of the project that contains the instance.
1184
+ # @param [String] instance
1185
+ # Required. Database instance ID. This does not include the project ID.
1186
+ # @param [Google::Apis::SqladminV1beta4::ExecuteSqlPayload] execute_sql_payload_object
1187
+ # @param [String] fields
1188
+ # Selector specifying which fields to include in a partial response.
1189
+ # @param [String] quota_user
1190
+ # Available to use for quota purposes for server-side applications. Can be any
1191
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1192
+ # @param [Google::Apis::RequestOptions] options
1193
+ # Request-specific options
1194
+ #
1195
+ # @yield [result, err] Result & error if block supplied
1196
+ # @yieldparam result [Google::Apis::SqladminV1beta4::SqlInstancesExecuteSqlResponse] parsed result object
1197
+ # @yieldparam err [StandardError] error object if request failed
1198
+ #
1199
+ # @return [Google::Apis::SqladminV1beta4::SqlInstancesExecuteSqlResponse]
1200
+ #
1201
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1202
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1203
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1204
+ def execute_instance_sql(project, instance, execute_sql_payload_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1205
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/executeSql', options)
1206
+ command.request_representation = Google::Apis::SqladminV1beta4::ExecuteSqlPayload::Representation
1207
+ command.request_object = execute_sql_payload_object
1208
+ command.response_representation = Google::Apis::SqladminV1beta4::SqlInstancesExecuteSqlResponse::Representation
1209
+ command.response_class = Google::Apis::SqladminV1beta4::SqlInstancesExecuteSqlResponse
1210
+ command.params['project'] = project unless project.nil?
1211
+ command.params['instance'] = instance unless instance.nil?
1212
+ command.query['fields'] = fields unless fields.nil?
1213
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1214
+ execute_or_queue_command(command, &block)
1215
+ end
1216
+
754
1217
  # Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump
755
1218
  # or CSV file.
756
1219
  # @param [String] project
@@ -1055,6 +1518,77 @@ module Google
1055
1518
  execute_or_queue_command(command, &block)
1056
1519
  end
1057
1520
 
1521
+ # Point in time restore for an instance managed by Google Cloud Backup and
1522
+ # Disaster Recovery.
1523
+ # @param [String] parent
1524
+ # Required. The parent resource where you created this instance. Format:
1525
+ # projects/`project`
1526
+ # @param [Google::Apis::SqladminV1beta4::PointInTimeRestoreContext] point_in_time_restore_context_object
1527
+ # @param [String] fields
1528
+ # Selector specifying which fields to include in a partial response.
1529
+ # @param [String] quota_user
1530
+ # Available to use for quota purposes for server-side applications. Can be any
1531
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1532
+ # @param [Google::Apis::RequestOptions] options
1533
+ # Request-specific options
1534
+ #
1535
+ # @yield [result, err] Result & error if block supplied
1536
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1537
+ # @yieldparam err [StandardError] error object if request failed
1538
+ #
1539
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1540
+ #
1541
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1542
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1543
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1544
+ def point_instance_in_time_restore(parent, point_in_time_restore_context_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1545
+ command = make_simple_command(:post, 'sql/v1beta4/{+parent}:pointInTimeRestore', options)
1546
+ command.request_representation = Google::Apis::SqladminV1beta4::PointInTimeRestoreContext::Representation
1547
+ command.request_object = point_in_time_restore_context_object
1548
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1549
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1550
+ command.params['parent'] = parent unless parent.nil?
1551
+ command.query['fields'] = fields unless fields.nil?
1552
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1553
+ execute_or_queue_command(command, &block)
1554
+ end
1555
+
1556
+ # Execute MVU Pre-checks
1557
+ # @param [String] project
1558
+ # Required. Project ID of the project that contains the instance.
1559
+ # @param [String] instance
1560
+ # Required. Cloud SQL instance ID. This does not include the project ID.
1561
+ # @param [Google::Apis::SqladminV1beta4::InstancesPreCheckMajorVersionUpgradeRequest] instances_pre_check_major_version_upgrade_request_object
1562
+ # @param [String] fields
1563
+ # Selector specifying which fields to include in a partial response.
1564
+ # @param [String] quota_user
1565
+ # Available to use for quota purposes for server-side applications. Can be any
1566
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1567
+ # @param [Google::Apis::RequestOptions] options
1568
+ # Request-specific options
1569
+ #
1570
+ # @yield [result, err] Result & error if block supplied
1571
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1572
+ # @yieldparam err [StandardError] error object if request failed
1573
+ #
1574
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1575
+ #
1576
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1577
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1578
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1579
+ 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)
1580
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/preCheckMajorVersionUpgrade', options)
1581
+ command.request_representation = Google::Apis::SqladminV1beta4::InstancesPreCheckMajorVersionUpgradeRequest::Representation
1582
+ command.request_object = instances_pre_check_major_version_upgrade_request_object
1583
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1584
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1585
+ command.params['project'] = project unless project.nil?
1586
+ command.params['instance'] = instance unless instance.nil?
1587
+ command.query['fields'] = fields unless fields.nil?
1588
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1589
+ execute_or_queue_command(command, &block)
1590
+ end
1591
+
1058
1592
  # Promotes the read replica instance to be an independent Cloud SQL primary
1059
1593
  # instance. Using this operation might cause your instance to restart.
1060
1594
  # @param [String] project
@@ -1062,12 +1596,11 @@ module Google
1062
1596
  # @param [String] instance
1063
1597
  # Cloud SQL read replica instance name.
1064
1598
  # @param [Boolean] failover
1065
- # Set to true to invoke a replica failover to the designated DR replica. As part
1066
- # of replica failover, the promote operation attempts to add the original
1067
- # primary instance as a replica of the promoted DR replica when the original
1068
- # primary instance comes back online. If set to false or not specified, then the
1069
- # original primary instance becomes an independent Cloud SQL primary instance.
1070
- # Only applicable to MySQL.
1599
+ # Set to true to invoke a replica failover to the DR replica. As part of replica
1600
+ # failover, the promote operation attempts to add the original primary instance
1601
+ # as a replica of the promoted DR replica when the original primary instance
1602
+ # comes back online. If set to false or not specified, then the original primary
1603
+ # instance becomes an independent Cloud SQL primary instance.
1071
1604
  # @param [String] fields
1072
1605
  # Selector specifying which fields to include in a partial response.
1073
1606
  # @param [String] quota_user
@@ -1175,6 +1708,8 @@ module Google
1175
1708
  # Project ID of the project that contains the instance.
1176
1709
  # @param [String] instance
1177
1710
  # Cloud SQL instance ID. This does not include the project ID.
1711
+ # @param [String] mode
1712
+ # Optional. Reset SSL mode to use.
1178
1713
  # @param [String] fields
1179
1714
  # Selector specifying which fields to include in a partial response.
1180
1715
  # @param [String] quota_user
@@ -1192,12 +1727,13 @@ module Google
1192
1727
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1193
1728
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1194
1729
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1195
- def reset_instance_ssl_config(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1730
+ def reset_instance_ssl_config(project, instance, mode: nil, fields: nil, quota_user: nil, options: nil, &block)
1196
1731
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig', options)
1197
1732
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1198
1733
  command.response_class = Google::Apis::SqladminV1beta4::Operation
1199
1734
  command.params['project'] = project unless project.nil?
1200
1735
  command.params['instance'] = instance unless instance.nil?
1736
+ command.query['mode'] = mode unless mode.nil?
1201
1737
  command.query['fields'] = fields unless fields.nil?
1202
1738
  command.query['quotaUser'] = quota_user unless quota_user.nil?
1203
1739
  execute_or_queue_command(command, &block)
@@ -1274,7 +1810,9 @@ module Google
1274
1810
  end
1275
1811
 
1276
1812
  # Rotates the server certificate to one signed by the Certificate Authority (CA)
1277
- # version previously added with the addServerCA method.
1813
+ # version previously added with the addServerCA method. For instances that have
1814
+ # enabled Certificate Authority Service (CAS) based server CA, use
1815
+ # RotateServerCertificate to rotate the server certificate.
1278
1816
  # @param [String] project
1279
1817
  # Project ID of the project that contains the instance.
1280
1818
  # @param [String] instance
@@ -1376,15 +1914,15 @@ module Google
1376
1914
  execute_or_queue_command(command, &block)
1377
1915
  end
1378
1916
 
1379
- # Switches over from the primary instance to the designated DR replica instance.
1917
+ # Switches over from the primary instance to the DR replica instance.
1380
1918
  # @param [String] project
1381
1919
  # ID of the project that contains the replica.
1382
1920
  # @param [String] instance
1383
1921
  # Cloud SQL read replica instance name.
1384
1922
  # @param [String] db_timeout
1385
- # Optional. (MySQL only) Cloud SQL instance operations timeout, which is a sum
1386
- # of all database operations. Default value is 10 minutes and can be modified to
1387
- # a maximum value of 24 hours.
1923
+ # Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations timeout,
1924
+ # which is a sum of all database operations. Default value is 10 minutes and can
1925
+ # be modified to a maximum value of 24 hours.
1388
1926
  # @param [String] fields
1389
1927
  # Selector specifying which fields to include in a partial response.
1390
1928
  # @param [String] quota_user
@@ -1488,6 +2026,7 @@ module Google
1488
2026
  end
1489
2027
 
1490
2028
  # Cancels an instance operation that has been performed on an instance.
2029
+ # Ordinarily, this method name should be `CancelSqlOperation`.
1491
2030
  # @param [String] project
1492
2031
  # Project ID of the project that contains the instance.
1493
2032
  # @param [String] operation
@@ -1632,6 +2171,9 @@ module Google
1632
2171
  # Project ID of the project that contains the instance.
1633
2172
  # @param [String] instance
1634
2173
  # Cloud SQL instance ID. This does not include the project ID.
2174
+ # @param [String] source_instance_deletion_time
2175
+ # The timestamp used to identify the time when the source instance is deleted.
2176
+ # If this instance is deleted, then you must set the timestamp.
1635
2177
  # @param [String] fields
1636
2178
  # Selector specifying which fields to include in a partial response.
1637
2179
  # @param [String] quota_user
@@ -1649,12 +2191,13 @@ module Google
1649
2191
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1650
2192
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1651
2193
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1652
- def get_project_instance_latest_recovery_time(project, instance, fields: nil, quota_user: nil, options: nil, &block)
2194
+ def get_project_instance_latest_recovery_time(project, instance, source_instance_deletion_time: nil, fields: nil, quota_user: nil, options: nil, &block)
1653
2195
  command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/getLatestRecoveryTime', options)
1654
2196
  command.response_representation = Google::Apis::SqladminV1beta4::SqlInstancesGetLatestRecoveryTimeResponse::Representation
1655
2197
  command.response_class = Google::Apis::SqladminV1beta4::SqlInstancesGetLatestRecoveryTimeResponse
1656
2198
  command.params['project'] = project unless project.nil?
1657
2199
  command.params['instance'] = instance unless instance.nil?
2200
+ command.query['sourceInstanceDeletionTime'] = source_instance_deletion_time unless source_instance_deletion_time.nil?
1658
2201
  command.query['fields'] = fields unless fields.nil?
1659
2202
  command.query['quotaUser'] = quota_user unless quota_user.nil?
1660
2203
  execute_or_queue_command(command, &block)
@@ -2208,10 +2751,15 @@ module Google
2208
2751
  # @param [String] instance
2209
2752
  # Database instance ID. This does not include the project ID.
2210
2753
  # @param [Google::Apis::SqladminV1beta4::User] user_object
2754
+ # @param [Array<String>, String] database_roles
2755
+ # Optional. List of database roles to grant to the user. body.database_roles
2756
+ # will be ignored for update request.
2211
2757
  # @param [String] host
2212
2758
  # Optional. Host of the user in the instance.
2213
2759
  # @param [String] name
2214
2760
  # Name of the user in the instance.
2761
+ # @param [Boolean] revoke_existing_roles
2762
+ # Optional. revoke the existing roles granted to the user.
2215
2763
  # @param [String] fields
2216
2764
  # Selector specifying which fields to include in a partial response.
2217
2765
  # @param [String] quota_user
@@ -2229,7 +2777,7 @@ module Google
2229
2777
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2230
2778
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2231
2779
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2232
- def update_user(project, instance, user_object = nil, host: nil, name: nil, fields: nil, quota_user: nil, options: nil, &block)
2780
+ 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)
2233
2781
  command = make_simple_command(:put, 'sql/v1beta4/projects/{project}/instances/{instance}/users', options)
2234
2782
  command.request_representation = Google::Apis::SqladminV1beta4::User::Representation
2235
2783
  command.request_object = user_object
@@ -2237,8 +2785,10 @@ module Google
2237
2785
  command.response_class = Google::Apis::SqladminV1beta4::Operation
2238
2786
  command.params['project'] = project unless project.nil?
2239
2787
  command.params['instance'] = instance unless instance.nil?
2788
+ command.query['databaseRoles'] = database_roles unless database_roles.nil?
2240
2789
  command.query['host'] = host unless host.nil?
2241
2790
  command.query['name'] = name unless name.nil?
2791
+ command.query['revokeExistingRoles'] = revoke_existing_roles unless revoke_existing_roles.nil?
2242
2792
  command.query['fields'] = fields unless fields.nil?
2243
2793
  command.query['quotaUser'] = quota_user unless quota_user.nil?
2244
2794
  execute_or_queue_command(command, &block)