google-apis-sqladmin_v1beta4 0.41.0 → 0.77.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.
@@ -32,6 +32,8 @@ module Google
32
32
  #
33
33
  # @see https://developers.google.com/cloud-sql/
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'
@@ -349,7 +351,7 @@ module Google
349
351
  end
350
352
 
351
353
  # Inserts a resource containing information about a database inside a Cloud SQL
352
- # instance.
354
+ # instance. **Note:** You can't modify the default character set and collation.
353
355
  # @param [String] project
354
356
  # Project ID of the project that contains the instance.
355
357
  # @param [String] instance
@@ -529,11 +531,126 @@ module Google
529
531
  execute_or_queue_command(command, &block)
530
532
  end
531
533
 
534
+ # Lists all versions of server certificates and certificate authorities (CAs)
535
+ # for the specified instance. There can be up to three sets of certs listed: the
536
+ # certificate that is currently in use, a future that has been added but not yet
537
+ # used to sign a certificate, and a certificate that has been rotated out. For
538
+ # instances not using Certificate Authority Service (CAS) server CA, use
539
+ # ListServerCas instead.
540
+ # @param [String] project
541
+ # Required. Project ID of the project that contains the instance.
542
+ # @param [String] instance
543
+ # Required. Cloud SQL instance ID. This does not include the project ID.
544
+ # @param [String] fields
545
+ # Selector specifying which fields to include in a partial response.
546
+ # @param [String] quota_user
547
+ # Available to use for quota purposes for server-side applications. Can be any
548
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
549
+ # @param [Google::Apis::RequestOptions] options
550
+ # Request-specific options
551
+ #
552
+ # @yield [result, err] Result & error if block supplied
553
+ # @yieldparam result [Google::Apis::SqladminV1beta4::InstancesListServerCertificatesResponse] parsed result object
554
+ # @yieldparam err [StandardError] error object if request failed
555
+ #
556
+ # @return [Google::Apis::SqladminV1beta4::InstancesListServerCertificatesResponse]
557
+ #
558
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
559
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
560
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
561
+ def list_instance_server_certificates(project, instance, fields: nil, quota_user: nil, options: nil, &block)
562
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/listServerCertificates', options)
563
+ command.response_representation = Google::Apis::SqladminV1beta4::InstancesListServerCertificatesResponse::Representation
564
+ command.response_class = Google::Apis::SqladminV1beta4::InstancesListServerCertificatesResponse
565
+ command.params['project'] = project unless project.nil?
566
+ command.params['instance'] = instance unless instance.nil?
567
+ command.query['fields'] = fields unless fields.nil?
568
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
569
+ execute_or_queue_command(command, &block)
570
+ end
571
+
572
+ # Rotates the server certificate version to one previously added with the
573
+ # addServerCertificate method. For instances not using Certificate Authority
574
+ # Service (CAS) server CA, use RotateServerCa instead.
575
+ # @param [String] project
576
+ # Required. Project ID of the project that contains the instance.
577
+ # @param [String] instance
578
+ # Required. Cloud SQL instance ID. This does not include the project ID.
579
+ # @param [Google::Apis::SqladminV1beta4::InstancesRotateServerCertificateRequest] instances_rotate_server_certificate_request_object
580
+ # @param [String] fields
581
+ # Selector specifying which fields to include in a partial response.
582
+ # @param [String] quota_user
583
+ # Available to use for quota purposes for server-side applications. Can be any
584
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
585
+ # @param [Google::Apis::RequestOptions] options
586
+ # Request-specific options
587
+ #
588
+ # @yield [result, err] Result & error if block supplied
589
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
590
+ # @yieldparam err [StandardError] error object if request failed
591
+ #
592
+ # @return [Google::Apis::SqladminV1beta4::Operation]
593
+ #
594
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
595
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
596
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
597
+ def rotate_instance_server_certificate(project, instance, instances_rotate_server_certificate_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
598
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCertificate', options)
599
+ command.request_representation = Google::Apis::SqladminV1beta4::InstancesRotateServerCertificateRequest::Representation
600
+ command.request_object = instances_rotate_server_certificate_request_object
601
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
602
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
603
+ command.params['project'] = project unless project.nil?
604
+ command.params['instance'] = instance unless instance.nil?
605
+ command.query['fields'] = fields unless fields.nil?
606
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
607
+ execute_or_queue_command(command, &block)
608
+ end
609
+
610
+ # Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
611
+ # @param [String] project
612
+ # Required. ID of the project that contains the instance (Example: project-id).
613
+ # @param [String] instance
614
+ # Required. Cloud SQL instance ID. This doesn't include the project ID. It's
615
+ # composed of lowercase letters, numbers, and hyphens, and it must start with a
616
+ # letter. The total length must be 98 characters or less (Example: instance-id).
617
+ # @param [Google::Apis::SqladminV1beta4::InstancesAcquireSsrsLeaseRequest] instances_acquire_ssrs_lease_request_object
618
+ # @param [String] fields
619
+ # Selector specifying which fields to include in a partial response.
620
+ # @param [String] quota_user
621
+ # Available to use for quota purposes for server-side applications. Can be any
622
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
623
+ # @param [Google::Apis::RequestOptions] options
624
+ # Request-specific options
625
+ #
626
+ # @yield [result, err] Result & error if block supplied
627
+ # @yieldparam result [Google::Apis::SqladminV1beta4::SqlInstancesAcquireSsrsLeaseResponse] parsed result object
628
+ # @yieldparam err [StandardError] error object if request failed
629
+ #
630
+ # @return [Google::Apis::SqladminV1beta4::SqlInstancesAcquireSsrsLeaseResponse]
631
+ #
632
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
633
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
634
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
635
+ def acquire_instance_ssrs_lease(project, instance, instances_acquire_ssrs_lease_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
636
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/acquireSsrsLease', options)
637
+ command.request_representation = Google::Apis::SqladminV1beta4::InstancesAcquireSsrsLeaseRequest::Representation
638
+ command.request_object = instances_acquire_ssrs_lease_request_object
639
+ command.response_representation = Google::Apis::SqladminV1beta4::SqlInstancesAcquireSsrsLeaseResponse::Representation
640
+ command.response_class = Google::Apis::SqladminV1beta4::SqlInstancesAcquireSsrsLeaseResponse
641
+ command.params['project'] = project unless project.nil?
642
+ command.params['instance'] = instance unless instance.nil?
643
+ command.query['fields'] = fields unless fields.nil?
644
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
645
+ execute_or_queue_command(command, &block)
646
+ end
647
+
532
648
  # Add a new trusted Certificate Authority (CA) version for the specified
533
649
  # instance. Required to prepare for a certificate rotation. If a CA version was
534
650
  # previously added but never used in a certificate rotation, this operation
535
651
  # replaces that version. There cannot be more than one CA version waiting to be
536
- # rotated in.
652
+ # rotated in. For instances that have enabled Certificate Authority Service (CAS)
653
+ # based server CA, use AddServerCertificate to add a new server certificate.
537
654
  # @param [String] project
538
655
  # Project ID of the project that contains the instance.
539
656
  # @param [String] instance
@@ -566,6 +683,44 @@ module Google
566
683
  execute_or_queue_command(command, &block)
567
684
  end
568
685
 
686
+ # Add a new trusted server certificate version for the specified instance using
687
+ # Certificate Authority Service (CAS) server CA. Required to prepare for a
688
+ # certificate rotation. If a server certificate version was previously added but
689
+ # never used in a certificate rotation, this operation replaces that version.
690
+ # There cannot be more than one certificate version waiting to be rotated in.
691
+ # For instances not using CAS server CA, use AddServerCa instead.
692
+ # @param [String] project
693
+ # Required. Project ID of the project that contains the instance.
694
+ # @param [String] instance
695
+ # Required. Cloud SQL instance ID. This does not include the project ID.
696
+ # @param [String] fields
697
+ # Selector specifying which fields to include in a partial response.
698
+ # @param [String] quota_user
699
+ # Available to use for quota purposes for server-side applications. Can be any
700
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
701
+ # @param [Google::Apis::RequestOptions] options
702
+ # Request-specific options
703
+ #
704
+ # @yield [result, err] Result & error if block supplied
705
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
706
+ # @yieldparam err [StandardError] error object if request failed
707
+ #
708
+ # @return [Google::Apis::SqladminV1beta4::Operation]
709
+ #
710
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
711
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
712
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
713
+ def add_instance_server_certificate(project, instance, fields: nil, quota_user: nil, options: nil, &block)
714
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/addServerCertificate', options)
715
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
716
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
717
+ command.params['project'] = project unless project.nil?
718
+ command.params['instance'] = instance unless instance.nil?
719
+ command.query['fields'] = fields unless fields.nil?
720
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
721
+ execute_or_queue_command(command, &block)
722
+ end
723
+
569
724
  # Creates a Cloud SQL instance as a clone of the source instance. Using this
570
725
  # operation might cause your instance to restart.
571
726
  # @param [String] project
@@ -637,6 +792,43 @@ module Google
637
792
  execute_or_queue_command(command, &block)
638
793
  end
639
794
 
795
+ # Demotes an existing standalone instance to be a Cloud SQL read replica for an
796
+ # external database server.
797
+ # @param [String] project
798
+ # Required. The project ID of the project that contains the instance.
799
+ # @param [String] instance
800
+ # Required. The name of the Cloud SQL instance.
801
+ # @param [Google::Apis::SqladminV1beta4::InstancesDemoteRequest] instances_demote_request_object
802
+ # @param [String] fields
803
+ # Selector specifying which fields to include in a partial response.
804
+ # @param [String] quota_user
805
+ # Available to use for quota purposes for server-side applications. Can be any
806
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
807
+ # @param [Google::Apis::RequestOptions] options
808
+ # Request-specific options
809
+ #
810
+ # @yield [result, err] Result & error if block supplied
811
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
812
+ # @yieldparam err [StandardError] error object if request failed
813
+ #
814
+ # @return [Google::Apis::SqladminV1beta4::Operation]
815
+ #
816
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
817
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
818
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
819
+ def demote_instance(project, instance, instances_demote_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
820
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/demote', options)
821
+ command.request_representation = Google::Apis::SqladminV1beta4::InstancesDemoteRequest::Representation
822
+ command.request_object = instances_demote_request_object
823
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
824
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
825
+ command.params['project'] = project unless project.nil?
826
+ command.params['instance'] = instance unless instance.nil?
827
+ command.query['fields'] = fields unless fields.nil?
828
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
829
+ execute_or_queue_command(command, &block)
830
+ end
831
+
640
832
  # Demotes the stand-alone instance to be a Cloud SQL read replica for an
641
833
  # external database server.
642
834
  # @param [String] project
@@ -679,7 +871,7 @@ module Google
679
871
  # @param [String] project
680
872
  # Project ID of the project that contains the instance to be exported.
681
873
  # @param [String] instance
682
- # Cloud SQL instance ID. This does not include the project ID.
874
+ # The Cloud SQL instance ID. This doesn't include the project ID.
683
875
  # @param [Google::Apis::SqladminV1beta4::ExportInstancesRequest] export_instances_request_object
684
876
  # @param [String] fields
685
877
  # Selector specifying which fields to include in a partial response.
@@ -978,12 +1170,18 @@ module Google
978
1170
  execute_or_queue_command(command, &block)
979
1171
  end
980
1172
 
981
- # Promotes the read replica instance to be a stand-alone Cloud SQL instance.
982
- # Using this operation might cause your instance to restart.
1173
+ # Promotes the read replica instance to be an independent Cloud SQL primary
1174
+ # instance. Using this operation might cause your instance to restart.
983
1175
  # @param [String] project
984
1176
  # ID of the project that contains the read replica.
985
1177
  # @param [String] instance
986
1178
  # Cloud SQL read replica instance name.
1179
+ # @param [Boolean] failover
1180
+ # Set to true to invoke a replica failover to the DR replica. As part of replica
1181
+ # failover, the promote operation attempts to add the original primary instance
1182
+ # as a replica of the promoted DR replica when the original primary instance
1183
+ # comes back online. If set to false or not specified, then the original primary
1184
+ # instance becomes an independent Cloud SQL primary instance.
987
1185
  # @param [String] fields
988
1186
  # Selector specifying which fields to include in a partial response.
989
1187
  # @param [String] quota_user
@@ -1001,12 +1199,85 @@ module Google
1001
1199
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1002
1200
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1003
1201
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1004
- def promote_instance_replica(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1202
+ def promote_instance_replica(project, instance, failover: nil, fields: nil, quota_user: nil, options: nil, &block)
1005
1203
  command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica', options)
1006
1204
  command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1007
1205
  command.response_class = Google::Apis::SqladminV1beta4::Operation
1008
1206
  command.params['project'] = project unless project.nil?
1009
1207
  command.params['instance'] = instance unless instance.nil?
1208
+ command.query['failover'] = failover unless failover.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
+ # Reencrypt CMEK instance with latest key version.
1215
+ # @param [String] project
1216
+ # ID of the project that contains the instance.
1217
+ # @param [String] instance
1218
+ # Cloud SQL instance ID. This does not include the project ID.
1219
+ # @param [Google::Apis::SqladminV1beta4::InstancesReencryptRequest] instances_reencrypt_request_object
1220
+ # @param [String] fields
1221
+ # Selector specifying which fields to include in a partial response.
1222
+ # @param [String] quota_user
1223
+ # Available to use for quota purposes for server-side applications. Can be any
1224
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1225
+ # @param [Google::Apis::RequestOptions] options
1226
+ # Request-specific options
1227
+ #
1228
+ # @yield [result, err] Result & error if block supplied
1229
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1230
+ # @yieldparam err [StandardError] error object if request failed
1231
+ #
1232
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1233
+ #
1234
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1235
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1236
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1237
+ def reencrypt_instance(project, instance, instances_reencrypt_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1238
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/reencrypt', options)
1239
+ command.request_representation = Google::Apis::SqladminV1beta4::InstancesReencryptRequest::Representation
1240
+ command.request_object = instances_reencrypt_request_object
1241
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1242
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1243
+ command.params['project'] = project unless project.nil?
1244
+ command.params['instance'] = instance unless instance.nil?
1245
+ command.query['fields'] = fields unless fields.nil?
1246
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1247
+ execute_or_queue_command(command, &block)
1248
+ end
1249
+
1250
+ # Release a lease for the setup of SQL Server Reporting Services (SSRS).
1251
+ # @param [String] project
1252
+ # Required. The ID of the project that contains the instance (Example: project-
1253
+ # id).
1254
+ # @param [String] instance
1255
+ # Required. The Cloud SQL instance ID. This doesn't include the project ID. It's
1256
+ # composed of lowercase letters, numbers, and hyphens, and it must start with a
1257
+ # letter. The total length must be 98 characters or less (Example: instance-id).
1258
+ # @param [String] fields
1259
+ # Selector specifying which fields to include in a partial response.
1260
+ # @param [String] quota_user
1261
+ # Available to use for quota purposes for server-side applications. Can be any
1262
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1263
+ # @param [Google::Apis::RequestOptions] options
1264
+ # Request-specific options
1265
+ #
1266
+ # @yield [result, err] Result & error if block supplied
1267
+ # @yieldparam result [Google::Apis::SqladminV1beta4::SqlInstancesReleaseSsrsLeaseResponse] parsed result object
1268
+ # @yieldparam err [StandardError] error object if request failed
1269
+ #
1270
+ # @return [Google::Apis::SqladminV1beta4::SqlInstancesReleaseSsrsLeaseResponse]
1271
+ #
1272
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1273
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1274
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1275
+ def release_instance_ssrs_lease(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1276
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/releaseSsrsLease', options)
1277
+ command.response_representation = Google::Apis::SqladminV1beta4::SqlInstancesReleaseSsrsLeaseResponse::Representation
1278
+ command.response_class = Google::Apis::SqladminV1beta4::SqlInstancesReleaseSsrsLeaseResponse
1279
+ command.params['project'] = project unless project.nil?
1280
+ command.params['instance'] = instance unless instance.nil?
1010
1281
  command.query['fields'] = fields unless fields.nil?
1011
1282
  command.query['quotaUser'] = quota_user unless quota_user.nil?
1012
1283
  execute_or_queue_command(command, &block)
@@ -1117,7 +1388,9 @@ module Google
1117
1388
  end
1118
1389
 
1119
1390
  # Rotates the server certificate to one signed by the Certificate Authority (CA)
1120
- # version previously added with the addServerCA method.
1391
+ # version previously added with the addServerCA method. For instances that have
1392
+ # enabled Certificate Authority Service (CAS) based server CA, use
1393
+ # RotateServerCertificate to rotate the server certificate.
1121
1394
  # @param [String] project
1122
1395
  # Project ID of the project that contains the instance.
1123
1396
  # @param [String] instance
@@ -1219,6 +1492,44 @@ module Google
1219
1492
  execute_or_queue_command(command, &block)
1220
1493
  end
1221
1494
 
1495
+ # Switches over from the primary instance to the DR replica instance.
1496
+ # @param [String] project
1497
+ # ID of the project that contains the replica.
1498
+ # @param [String] instance
1499
+ # Cloud SQL read replica instance name.
1500
+ # @param [String] db_timeout
1501
+ # Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations timeout,
1502
+ # which is a sum of all database operations. Default value is 10 minutes and can
1503
+ # be modified to a maximum value of 24 hours.
1504
+ # @param [String] fields
1505
+ # Selector specifying which fields to include in a partial response.
1506
+ # @param [String] quota_user
1507
+ # Available to use for quota purposes for server-side applications. Can be any
1508
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1509
+ # @param [Google::Apis::RequestOptions] options
1510
+ # Request-specific options
1511
+ #
1512
+ # @yield [result, err] Result & error if block supplied
1513
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1514
+ # @yieldparam err [StandardError] error object if request failed
1515
+ #
1516
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1517
+ #
1518
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1519
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1520
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1521
+ def switchover_instance(project, instance, db_timeout: nil, fields: nil, quota_user: nil, options: nil, &block)
1522
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/switchover', options)
1523
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1524
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1525
+ command.params['project'] = project unless project.nil?
1526
+ command.params['instance'] = instance unless instance.nil?
1527
+ command.query['dbTimeout'] = db_timeout unless db_timeout.nil?
1528
+ command.query['fields'] = fields unless fields.nil?
1529
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1530
+ execute_or_queue_command(command, &block)
1531
+ end
1532
+
1222
1533
  # Truncate MySQL general and slow query log tables MySQL only.
1223
1534
  # @param [String] project
1224
1535
  # Project ID of the Cloud SQL project.
@@ -1292,6 +1603,39 @@ module Google
1292
1603
  execute_or_queue_command(command, &block)
1293
1604
  end
1294
1605
 
1606
+ # Cancels an instance operation that has been performed on an instance.
1607
+ # @param [String] project
1608
+ # Project ID of the project that contains the instance.
1609
+ # @param [String] operation
1610
+ # Instance operation ID.
1611
+ # @param [String] fields
1612
+ # Selector specifying which fields to include in a partial response.
1613
+ # @param [String] quota_user
1614
+ # Available to use for quota purposes for server-side applications. Can be any
1615
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1616
+ # @param [Google::Apis::RequestOptions] options
1617
+ # Request-specific options
1618
+ #
1619
+ # @yield [result, err] Result & error if block supplied
1620
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Empty] parsed result object
1621
+ # @yieldparam err [StandardError] error object if request failed
1622
+ #
1623
+ # @return [Google::Apis::SqladminV1beta4::Empty]
1624
+ #
1625
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1626
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1627
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1628
+ def cancel_operation(project, operation, fields: nil, quota_user: nil, options: nil, &block)
1629
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/operations/{operation}/cancel', options)
1630
+ command.response_representation = Google::Apis::SqladminV1beta4::Empty::Representation
1631
+ command.response_class = Google::Apis::SqladminV1beta4::Empty
1632
+ command.params['project'] = project unless project.nil?
1633
+ command.params['operation'] = operation unless operation.nil?
1634
+ command.query['fields'] = fields unless fields.nil?
1635
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1636
+ execute_or_queue_command(command, &block)
1637
+ end
1638
+
1295
1639
  # Retrieves an instance operation that has been performed on an instance.
1296
1640
  # @param [String] project
1297
1641
  # Project ID of the project that contains the instance.
@@ -1366,6 +1710,108 @@ module Google
1366
1710
  execute_or_queue_command(command, &block)
1367
1711
  end
1368
1712
 
1713
+ # Get Disk Shrink Config for a given instance.
1714
+ # @param [String] project
1715
+ # Project ID of the project that contains the instance.
1716
+ # @param [String] instance
1717
+ # Cloud SQL instance ID. This does not include the project ID.
1718
+ # @param [String] fields
1719
+ # Selector specifying which fields to include in a partial response.
1720
+ # @param [String] quota_user
1721
+ # Available to use for quota purposes for server-side applications. Can be any
1722
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1723
+ # @param [Google::Apis::RequestOptions] options
1724
+ # Request-specific options
1725
+ #
1726
+ # @yield [result, err] Result & error if block supplied
1727
+ # @yieldparam result [Google::Apis::SqladminV1beta4::SqlInstancesGetDiskShrinkConfigResponse] parsed result object
1728
+ # @yieldparam err [StandardError] error object if request failed
1729
+ #
1730
+ # @return [Google::Apis::SqladminV1beta4::SqlInstancesGetDiskShrinkConfigResponse]
1731
+ #
1732
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1733
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1734
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1735
+ def get_project_instance_disk_shrink_config(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1736
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/getDiskShrinkConfig', options)
1737
+ command.response_representation = Google::Apis::SqladminV1beta4::SqlInstancesGetDiskShrinkConfigResponse::Representation
1738
+ command.response_class = Google::Apis::SqladminV1beta4::SqlInstancesGetDiskShrinkConfigResponse
1739
+ command.params['project'] = project unless project.nil?
1740
+ command.params['instance'] = instance unless instance.nil?
1741
+ command.query['fields'] = fields unless fields.nil?
1742
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1743
+ execute_or_queue_command(command, &block)
1744
+ end
1745
+
1746
+ # Get Latest Recovery Time for a given instance.
1747
+ # @param [String] project
1748
+ # Project ID of the project that contains the instance.
1749
+ # @param [String] instance
1750
+ # Cloud SQL instance ID. This does not include the project ID.
1751
+ # @param [String] fields
1752
+ # Selector specifying which fields to include in a partial response.
1753
+ # @param [String] quota_user
1754
+ # Available to use for quota purposes for server-side applications. Can be any
1755
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1756
+ # @param [Google::Apis::RequestOptions] options
1757
+ # Request-specific options
1758
+ #
1759
+ # @yield [result, err] Result & error if block supplied
1760
+ # @yieldparam result [Google::Apis::SqladminV1beta4::SqlInstancesGetLatestRecoveryTimeResponse] parsed result object
1761
+ # @yieldparam err [StandardError] error object if request failed
1762
+ #
1763
+ # @return [Google::Apis::SqladminV1beta4::SqlInstancesGetLatestRecoveryTimeResponse]
1764
+ #
1765
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1766
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1767
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1768
+ def get_project_instance_latest_recovery_time(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1769
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/getLatestRecoveryTime', options)
1770
+ command.response_representation = Google::Apis::SqladminV1beta4::SqlInstancesGetLatestRecoveryTimeResponse::Representation
1771
+ command.response_class = Google::Apis::SqladminV1beta4::SqlInstancesGetLatestRecoveryTimeResponse
1772
+ command.params['project'] = project unless project.nil?
1773
+ command.params['instance'] = instance unless instance.nil?
1774
+ command.query['fields'] = fields unless fields.nil?
1775
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1776
+ execute_or_queue_command(command, &block)
1777
+ end
1778
+
1779
+ # Perform Disk Shrink on primary instance.
1780
+ # @param [String] project
1781
+ # Project ID of the project that contains the instance.
1782
+ # @param [String] instance
1783
+ # Cloud SQL instance ID. This does not include the project ID.
1784
+ # @param [Google::Apis::SqladminV1beta4::PerformDiskShrinkContext] perform_disk_shrink_context_object
1785
+ # @param [String] fields
1786
+ # Selector specifying which fields to include in a partial response.
1787
+ # @param [String] quota_user
1788
+ # Available to use for quota purposes for server-side applications. Can be any
1789
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1790
+ # @param [Google::Apis::RequestOptions] options
1791
+ # Request-specific options
1792
+ #
1793
+ # @yield [result, err] Result & error if block supplied
1794
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1795
+ # @yieldparam err [StandardError] error object if request failed
1796
+ #
1797
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1798
+ #
1799
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1800
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1801
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1802
+ def perform_project_instance_disk_shrink(project, instance, perform_disk_shrink_context_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1803
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/performDiskShrink', options)
1804
+ command.request_representation = Google::Apis::SqladminV1beta4::PerformDiskShrinkContext::Representation
1805
+ command.request_object = perform_disk_shrink_context_object
1806
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1807
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1808
+ command.params['project'] = project unless project.nil?
1809
+ command.params['instance'] = instance unless instance.nil?
1810
+ command.query['fields'] = fields unless fields.nil?
1811
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1812
+ execute_or_queue_command(command, &block)
1813
+ end
1814
+
1369
1815
  # Reschedules the maintenance on the given instance.
1370
1816
  # @param [String] project
1371
1817
  # ID of the project that contains the instance.
@@ -1402,6 +1848,42 @@ module Google
1402
1848
  execute_or_queue_command(command, &block)
1403
1849
  end
1404
1850
 
1851
+ # Reset Replica Size to primary instance disk size.
1852
+ # @param [String] project
1853
+ # ID of the project that contains the read replica.
1854
+ # @param [String] instance
1855
+ # Cloud SQL read replica instance name.
1856
+ # @param [Google::Apis::SqladminV1beta4::SqlInstancesResetReplicaSizeRequest] sql_instances_reset_replica_size_request_object
1857
+ # @param [String] fields
1858
+ # Selector specifying which fields to include in a partial response.
1859
+ # @param [String] quota_user
1860
+ # Available to use for quota purposes for server-side applications. Can be any
1861
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1862
+ # @param [Google::Apis::RequestOptions] options
1863
+ # Request-specific options
1864
+ #
1865
+ # @yield [result, err] Result & error if block supplied
1866
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1867
+ # @yieldparam err [StandardError] error object if request failed
1868
+ #
1869
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1870
+ #
1871
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1872
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1873
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1874
+ def reset_project_instance_replica_size(project, instance, sql_instances_reset_replica_size_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1875
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/resetReplicaSize', options)
1876
+ command.request_representation = Google::Apis::SqladminV1beta4::SqlInstancesResetReplicaSizeRequest::Representation
1877
+ command.request_object = sql_instances_reset_replica_size_request_object
1878
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1879
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1880
+ command.params['project'] = project unless project.nil?
1881
+ command.params['instance'] = instance unless instance.nil?
1882
+ command.query['fields'] = fields unless fields.nil?
1883
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1884
+ execute_or_queue_command(command, &block)
1885
+ end
1886
+
1405
1887
  # Start External primary instance migration.
1406
1888
  # @param [String] project
1407
1889
  # ID of the project that contains the instance.