google-cloud-alloy_db-v1 0.2.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -253,6 +253,26 @@ module Google
253
253
  # @return [::Google::Cloud::AlloyDB::V1::ListClustersResponse]
254
254
  #
255
255
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
256
+ #
257
+ # @example Basic example
258
+ # require "google/cloud/alloy_db/v1"
259
+ #
260
+ # # Create a client object. The client can be reused for multiple calls.
261
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
262
+ #
263
+ # # Create a request. To set request fields, pass in keyword arguments.
264
+ # request = Google::Cloud::AlloyDB::V1::ListClustersRequest.new
265
+ #
266
+ # # Call the list_clusters method.
267
+ # result = client.list_clusters request
268
+ #
269
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
270
+ # # over elements, and API calls will be issued to fetch pages as needed.
271
+ # result.each do |item|
272
+ # # Each element is of type ::Google::Cloud::AlloyDB::V1::Cluster.
273
+ # p item
274
+ # end
275
+ #
256
276
  def list_clusters request, options = nil
257
277
  raise ::ArgumentError, "request must be provided" if request.nil?
258
278
 
@@ -301,7 +321,7 @@ module Google
301
321
  # @param options [::Gapic::CallOptions, ::Hash]
302
322
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
303
323
  #
304
- # @overload get_cluster(name: nil)
324
+ # @overload get_cluster(name: nil, view: nil)
305
325
  # Pass arguments to `get_cluster` via keyword arguments. Note that at
306
326
  # least one keyword argument is required. To specify no parameters, or to keep all
307
327
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -309,6 +329,9 @@ module Google
309
329
  # @param name [::String]
310
330
  # Required. The name of the resource. For the required format, see the
311
331
  # comment on the Cluster.name field.
332
+ # @param view [::Google::Cloud::AlloyDB::V1::ClusterView]
333
+ # Optional. The view of the cluster to return. Returns all default fields if
334
+ # not set.
312
335
  # @yield [result, operation] Access the result along with the TransportOperation object
313
336
  # @yieldparam result [::Google::Cloud::AlloyDB::V1::Cluster]
314
337
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -316,6 +339,22 @@ module Google
316
339
  # @return [::Google::Cloud::AlloyDB::V1::Cluster]
317
340
  #
318
341
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
342
+ #
343
+ # @example Basic example
344
+ # require "google/cloud/alloy_db/v1"
345
+ #
346
+ # # Create a client object. The client can be reused for multiple calls.
347
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
348
+ #
349
+ # # Create a request. To set request fields, pass in keyword arguments.
350
+ # request = Google::Cloud::AlloyDB::V1::GetClusterRequest.new
351
+ #
352
+ # # Call the get_cluster method.
353
+ # result = client.get_cluster request
354
+ #
355
+ # # The returned object is of type Google::Cloud::AlloyDB::V1::Cluster.
356
+ # p result
357
+ #
319
358
  def get_cluster request, options = nil
320
359
  raise ::ArgumentError, "request must be provided" if request.nil?
321
360
 
@@ -370,7 +409,7 @@ module Google
370
409
  # the default parameter values, pass an empty Hash as a request object (see above).
371
410
  #
372
411
  # @param parent [::String]
373
- # Required. The name of the parent resource. For the required format, see the
412
+ # Required. The location of the new cluster. For the required format, see the
374
413
  # comment on the Cluster.name field.
375
414
  # @param cluster_id [::String]
376
415
  # Required. ID of the requesting object.
@@ -401,6 +440,29 @@ module Google
401
440
  # @return [::Gapic::Operation]
402
441
  #
403
442
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
443
+ #
444
+ # @example Basic example
445
+ # require "google/cloud/alloy_db/v1"
446
+ #
447
+ # # Create a client object. The client can be reused for multiple calls.
448
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
449
+ #
450
+ # # Create a request. To set request fields, pass in keyword arguments.
451
+ # request = Google::Cloud::AlloyDB::V1::CreateClusterRequest.new
452
+ #
453
+ # # Call the create_cluster method.
454
+ # result = client.create_cluster request
455
+ #
456
+ # # The returned object is of type Gapic::Operation. You can use it to
457
+ # # check the status of an operation, cancel it, or wait for results.
458
+ # # Here is how to wait for a response.
459
+ # result.wait_until_done! timeout: 60
460
+ # if result.response?
461
+ # p result.response
462
+ # else
463
+ # puts "No response received."
464
+ # end
465
+ #
404
466
  def create_cluster request, options = nil
405
467
  raise ::ArgumentError, "request must be provided" if request.nil?
406
468
 
@@ -491,6 +553,29 @@ module Google
491
553
  # @return [::Gapic::Operation]
492
554
  #
493
555
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
556
+ #
557
+ # @example Basic example
558
+ # require "google/cloud/alloy_db/v1"
559
+ #
560
+ # # Create a client object. The client can be reused for multiple calls.
561
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
562
+ #
563
+ # # Create a request. To set request fields, pass in keyword arguments.
564
+ # request = Google::Cloud::AlloyDB::V1::UpdateClusterRequest.new
565
+ #
566
+ # # Call the update_cluster method.
567
+ # result = client.update_cluster request
568
+ #
569
+ # # The returned object is of type Gapic::Operation. You can use it to
570
+ # # check the status of an operation, cancel it, or wait for results.
571
+ # # Here is how to wait for a response.
572
+ # result.wait_until_done! timeout: 60
573
+ # if result.response?
574
+ # p result.response
575
+ # else
576
+ # puts "No response received."
577
+ # end
578
+ #
494
579
  def update_cluster request, options = nil
495
580
  raise ::ArgumentError, "request must be provided" if request.nil?
496
581
 
@@ -578,6 +663,29 @@ module Google
578
663
  # @return [::Gapic::Operation]
579
664
  #
580
665
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
666
+ #
667
+ # @example Basic example
668
+ # require "google/cloud/alloy_db/v1"
669
+ #
670
+ # # Create a client object. The client can be reused for multiple calls.
671
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
672
+ #
673
+ # # Create a request. To set request fields, pass in keyword arguments.
674
+ # request = Google::Cloud::AlloyDB::V1::DeleteClusterRequest.new
675
+ #
676
+ # # Call the delete_cluster method.
677
+ # result = client.delete_cluster request
678
+ #
679
+ # # The returned object is of type Gapic::Operation. You can use it to
680
+ # # check the status of an operation, cancel it, or wait for results.
681
+ # # Here is how to wait for a response.
682
+ # result.wait_until_done! timeout: 60
683
+ # if result.response?
684
+ # p result.response
685
+ # else
686
+ # puts "No response received."
687
+ # end
688
+ #
581
689
  def delete_cluster request, options = nil
582
690
  raise ::ArgumentError, "request must be provided" if request.nil?
583
691
 
@@ -614,6 +722,117 @@ module Google
614
722
  raise ::Google::Cloud::Error.from_error(e)
615
723
  end
616
724
 
725
+ ##
726
+ # Promotes a SECONDARY cluster. This turns down replication
727
+ # from the PRIMARY cluster and promotes a secondary cluster
728
+ # into its own standalone cluster.
729
+ # Imperative only.
730
+ #
731
+ # @overload promote_cluster(request, options = nil)
732
+ # Pass arguments to `promote_cluster` via a request object, either of type
733
+ # {::Google::Cloud::AlloyDB::V1::PromoteClusterRequest} or an equivalent Hash.
734
+ #
735
+ # @param request [::Google::Cloud::AlloyDB::V1::PromoteClusterRequest, ::Hash]
736
+ # A request object representing the call parameters. Required. To specify no
737
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
738
+ # @param options [::Gapic::CallOptions, ::Hash]
739
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
740
+ #
741
+ # @overload promote_cluster(name: nil, request_id: nil, etag: nil, validate_only: nil)
742
+ # Pass arguments to `promote_cluster` via keyword arguments. Note that at
743
+ # least one keyword argument is required. To specify no parameters, or to keep all
744
+ # the default parameter values, pass an empty Hash as a request object (see above).
745
+ #
746
+ # @param name [::String]
747
+ # Required. The name of the resource. For the required format, see the
748
+ # comment on the Cluster.name field
749
+ # @param request_id [::String]
750
+ # Optional. An optional request ID to identify requests. Specify a unique
751
+ # request ID so that if you must retry your request, the server will know to
752
+ # ignore the request if it has already been completed. The server will
753
+ # guarantee that for at least 60 minutes after the first request.
754
+ #
755
+ # For example, consider a situation where you make an initial request and
756
+ # the request times out. If you make the request again with the same request
757
+ # ID, the server can check if original operation with the same request ID
758
+ # was received, and if so, will ignore the second request. This prevents
759
+ # clients from accidentally creating duplicate commitments.
760
+ #
761
+ # The request ID must be a valid UUID with the exception that zero UUID is
762
+ # not supported (00000000-0000-0000-0000-000000000000).
763
+ # @param etag [::String]
764
+ # Optional. The current etag of the Cluster.
765
+ # If an etag is provided and does not match the current etag of the Cluster,
766
+ # deletion will be blocked and an ABORTED error will be returned.
767
+ # @param validate_only [::Boolean]
768
+ # Optional. If set, performs request validation (e.g. permission checks and
769
+ # any other type of validation), but do not actually execute the delete.
770
+ # @yield [result, operation] Access the result along with the TransportOperation object
771
+ # @yieldparam result [::Gapic::Operation]
772
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
773
+ #
774
+ # @return [::Gapic::Operation]
775
+ #
776
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
777
+ #
778
+ # @example Basic example
779
+ # require "google/cloud/alloy_db/v1"
780
+ #
781
+ # # Create a client object. The client can be reused for multiple calls.
782
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
783
+ #
784
+ # # Create a request. To set request fields, pass in keyword arguments.
785
+ # request = Google::Cloud::AlloyDB::V1::PromoteClusterRequest.new
786
+ #
787
+ # # Call the promote_cluster method.
788
+ # result = client.promote_cluster request
789
+ #
790
+ # # The returned object is of type Gapic::Operation. You can use it to
791
+ # # check the status of an operation, cancel it, or wait for results.
792
+ # # Here is how to wait for a response.
793
+ # result.wait_until_done! timeout: 60
794
+ # if result.response?
795
+ # p result.response
796
+ # else
797
+ # puts "No response received."
798
+ # end
799
+ #
800
+ def promote_cluster request, options = nil
801
+ raise ::ArgumentError, "request must be provided" if request.nil?
802
+
803
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::PromoteClusterRequest
804
+
805
+ # Converts hash and nil to an options object
806
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
807
+
808
+ # Customize the options with defaults
809
+ call_metadata = @config.rpcs.promote_cluster.metadata.to_h
810
+
811
+ # Set x-goog-api-client and x-goog-user-project headers
812
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
813
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
814
+ gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION,
815
+ transports_version_send: [:rest]
816
+
817
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
818
+
819
+ options.apply_defaults timeout: @config.rpcs.promote_cluster.timeout,
820
+ metadata: call_metadata,
821
+ retry_policy: @config.rpcs.promote_cluster.retry_policy
822
+
823
+ options.apply_defaults timeout: @config.timeout,
824
+ metadata: @config.metadata,
825
+ retry_policy: @config.retry_policy
826
+
827
+ @alloy_db_admin_stub.promote_cluster request, options do |result, operation|
828
+ result = ::Gapic::Operation.new result, @operations_client, options: options
829
+ yield result, operation if block_given?
830
+ return result
831
+ end
832
+ rescue ::Gapic::Rest::Error => e
833
+ raise ::Google::Cloud::Error.from_error(e)
834
+ end
835
+
617
836
  ##
618
837
  # Creates a new Cluster in a given project and location, with a volume
619
838
  # restored from the provided source, either a backup ID or a point-in-time
@@ -629,13 +848,16 @@ module Google
629
848
  # @param options [::Gapic::CallOptions, ::Hash]
630
849
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
631
850
  #
632
- # @overload restore_cluster(backup_source: nil, parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil)
851
+ # @overload restore_cluster(backup_source: nil, continuous_backup_source: nil, parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil)
633
852
  # Pass arguments to `restore_cluster` via keyword arguments. Note that at
634
853
  # least one keyword argument is required. To specify no parameters, or to keep all
635
854
  # the default parameter values, pass an empty Hash as a request object (see above).
636
855
  #
637
856
  # @param backup_source [::Google::Cloud::AlloyDB::V1::BackupSource, ::Hash]
638
857
  # Backup source.
858
+ # @param continuous_backup_source [::Google::Cloud::AlloyDB::V1::ContinuousBackupSource, ::Hash]
859
+ # ContinuousBackup source. Continuous backup needs to be enabled in the
860
+ # source cluster for this operation to succeed.
639
861
  # @param parent [::String]
640
862
  # Required. The name of the parent resource. For the required format, see the
641
863
  # comment on the Cluster.name field.
@@ -668,6 +890,29 @@ module Google
668
890
  # @return [::Gapic::Operation]
669
891
  #
670
892
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
893
+ #
894
+ # @example Basic example
895
+ # require "google/cloud/alloy_db/v1"
896
+ #
897
+ # # Create a client object. The client can be reused for multiple calls.
898
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
899
+ #
900
+ # # Create a request. To set request fields, pass in keyword arguments.
901
+ # request = Google::Cloud::AlloyDB::V1::RestoreClusterRequest.new
902
+ #
903
+ # # Call the restore_cluster method.
904
+ # result = client.restore_cluster request
905
+ #
906
+ # # The returned object is of type Gapic::Operation. You can use it to
907
+ # # check the status of an operation, cancel it, or wait for results.
908
+ # # Here is how to wait for a response.
909
+ # result.wait_until_done! timeout: 60
910
+ # if result.response?
911
+ # p result.response
912
+ # else
913
+ # puts "No response received."
914
+ # end
915
+ #
671
916
  def restore_cluster request, options = nil
672
917
  raise ::ArgumentError, "request must be provided" if request.nil?
673
918
 
@@ -704,6 +949,116 @@ module Google
704
949
  raise ::Google::Cloud::Error.from_error(e)
705
950
  end
706
951
 
952
+ ##
953
+ # Creates a cluster of type SECONDARY in the given location using
954
+ # the primary cluster as the source.
955
+ #
956
+ # @overload create_secondary_cluster(request, options = nil)
957
+ # Pass arguments to `create_secondary_cluster` via a request object, either of type
958
+ # {::Google::Cloud::AlloyDB::V1::CreateSecondaryClusterRequest} or an equivalent Hash.
959
+ #
960
+ # @param request [::Google::Cloud::AlloyDB::V1::CreateSecondaryClusterRequest, ::Hash]
961
+ # A request object representing the call parameters. Required. To specify no
962
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
963
+ # @param options [::Gapic::CallOptions, ::Hash]
964
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
965
+ #
966
+ # @overload create_secondary_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil)
967
+ # Pass arguments to `create_secondary_cluster` via keyword arguments. Note that at
968
+ # least one keyword argument is required. To specify no parameters, or to keep all
969
+ # the default parameter values, pass an empty Hash as a request object (see above).
970
+ #
971
+ # @param parent [::String]
972
+ # Required. The location of the new cluster. For the required
973
+ # format, see the comment on the Cluster.name field.
974
+ # @param cluster_id [::String]
975
+ # Required. ID of the requesting object (the secondary cluster).
976
+ # @param cluster [::Google::Cloud::AlloyDB::V1::Cluster, ::Hash]
977
+ # Required. Configuration of the requesting object (the secondary cluster).
978
+ # @param request_id [::String]
979
+ # Optional. An optional request ID to identify requests. Specify a unique
980
+ # request ID so that if you must retry your request, the server will know to
981
+ # ignore the request if it has already been completed. The server will
982
+ # guarantee that for at least 60 minutes since the first request.
983
+ #
984
+ # For example, consider a situation where you make an initial request and
985
+ # the request times out. If you make the request again with the same request
986
+ # ID, the server can check if original operation with the same request ID
987
+ # was received, and if so, will ignore the second request. This prevents
988
+ # clients from accidentally creating duplicate commitments.
989
+ #
990
+ # The request ID must be a valid UUID with the exception that zero UUID is
991
+ # not supported (00000000-0000-0000-0000-000000000000).
992
+ # @param validate_only [::Boolean]
993
+ # Optional. If set, performs request validation (e.g. permission checks and
994
+ # any other type of validation), but do not actually execute the create
995
+ # request.
996
+ # @yield [result, operation] Access the result along with the TransportOperation object
997
+ # @yieldparam result [::Gapic::Operation]
998
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
999
+ #
1000
+ # @return [::Gapic::Operation]
1001
+ #
1002
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1003
+ #
1004
+ # @example Basic example
1005
+ # require "google/cloud/alloy_db/v1"
1006
+ #
1007
+ # # Create a client object. The client can be reused for multiple calls.
1008
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
1009
+ #
1010
+ # # Create a request. To set request fields, pass in keyword arguments.
1011
+ # request = Google::Cloud::AlloyDB::V1::CreateSecondaryClusterRequest.new
1012
+ #
1013
+ # # Call the create_secondary_cluster method.
1014
+ # result = client.create_secondary_cluster request
1015
+ #
1016
+ # # The returned object is of type Gapic::Operation. You can use it to
1017
+ # # check the status of an operation, cancel it, or wait for results.
1018
+ # # Here is how to wait for a response.
1019
+ # result.wait_until_done! timeout: 60
1020
+ # if result.response?
1021
+ # p result.response
1022
+ # else
1023
+ # puts "No response received."
1024
+ # end
1025
+ #
1026
+ def create_secondary_cluster request, options = nil
1027
+ raise ::ArgumentError, "request must be provided" if request.nil?
1028
+
1029
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::CreateSecondaryClusterRequest
1030
+
1031
+ # Converts hash and nil to an options object
1032
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1033
+
1034
+ # Customize the options with defaults
1035
+ call_metadata = @config.rpcs.create_secondary_cluster.metadata.to_h
1036
+
1037
+ # Set x-goog-api-client and x-goog-user-project headers
1038
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1039
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1040
+ gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION,
1041
+ transports_version_send: [:rest]
1042
+
1043
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1044
+
1045
+ options.apply_defaults timeout: @config.rpcs.create_secondary_cluster.timeout,
1046
+ metadata: call_metadata,
1047
+ retry_policy: @config.rpcs.create_secondary_cluster.retry_policy
1048
+
1049
+ options.apply_defaults timeout: @config.timeout,
1050
+ metadata: @config.metadata,
1051
+ retry_policy: @config.retry_policy
1052
+
1053
+ @alloy_db_admin_stub.create_secondary_cluster request, options do |result, operation|
1054
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1055
+ yield result, operation if block_given?
1056
+ return result
1057
+ end
1058
+ rescue ::Gapic::Rest::Error => e
1059
+ raise ::Google::Cloud::Error.from_error(e)
1060
+ end
1061
+
707
1062
  ##
708
1063
  # Lists Instances in a given project and location.
709
1064
  #
@@ -745,6 +1100,26 @@ module Google
745
1100
  # @return [::Google::Cloud::AlloyDB::V1::ListInstancesResponse]
746
1101
  #
747
1102
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1103
+ #
1104
+ # @example Basic example
1105
+ # require "google/cloud/alloy_db/v1"
1106
+ #
1107
+ # # Create a client object. The client can be reused for multiple calls.
1108
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
1109
+ #
1110
+ # # Create a request. To set request fields, pass in keyword arguments.
1111
+ # request = Google::Cloud::AlloyDB::V1::ListInstancesRequest.new
1112
+ #
1113
+ # # Call the list_instances method.
1114
+ # result = client.list_instances request
1115
+ #
1116
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1117
+ # # over elements, and API calls will be issued to fetch pages as needed.
1118
+ # result.each do |item|
1119
+ # # Each element is of type ::Google::Cloud::AlloyDB::V1::Instance.
1120
+ # p item
1121
+ # end
1122
+ #
748
1123
  def list_instances request, options = nil
749
1124
  raise ::ArgumentError, "request must be provided" if request.nil?
750
1125
 
@@ -810,6 +1185,22 @@ module Google
810
1185
  # @return [::Google::Cloud::AlloyDB::V1::Instance]
811
1186
  #
812
1187
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1188
+ #
1189
+ # @example Basic example
1190
+ # require "google/cloud/alloy_db/v1"
1191
+ #
1192
+ # # Create a client object. The client can be reused for multiple calls.
1193
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
1194
+ #
1195
+ # # Create a request. To set request fields, pass in keyword arguments.
1196
+ # request = Google::Cloud::AlloyDB::V1::GetInstanceRequest.new
1197
+ #
1198
+ # # Call the get_instance method.
1199
+ # result = client.get_instance request
1200
+ #
1201
+ # # The returned object is of type Google::Cloud::AlloyDB::V1::Instance.
1202
+ # p result
1203
+ #
813
1204
  def get_instance request, options = nil
814
1205
  raise ::ArgumentError, "request must be provided" if request.nil?
815
1206
 
@@ -895,6 +1286,29 @@ module Google
895
1286
  # @return [::Gapic::Operation]
896
1287
  #
897
1288
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1289
+ #
1290
+ # @example Basic example
1291
+ # require "google/cloud/alloy_db/v1"
1292
+ #
1293
+ # # Create a client object. The client can be reused for multiple calls.
1294
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
1295
+ #
1296
+ # # Create a request. To set request fields, pass in keyword arguments.
1297
+ # request = Google::Cloud::AlloyDB::V1::CreateInstanceRequest.new
1298
+ #
1299
+ # # Call the create_instance method.
1300
+ # result = client.create_instance request
1301
+ #
1302
+ # # The returned object is of type Gapic::Operation. You can use it to
1303
+ # # check the status of an operation, cancel it, or wait for results.
1304
+ # # Here is how to wait for a response.
1305
+ # result.wait_until_done! timeout: 60
1306
+ # if result.response?
1307
+ # p result.response
1308
+ # else
1309
+ # puts "No response received."
1310
+ # end
1311
+ #
898
1312
  def create_instance request, options = nil
899
1313
  raise ::ArgumentError, "request must be provided" if request.nil?
900
1314
 
@@ -932,36 +1346,30 @@ module Google
932
1346
  end
933
1347
 
934
1348
  ##
935
- # Creates new instances under the given project, location and cluster.
936
- # There can be only one primary instance in a cluster. If the primary
937
- # instance exists in the cluster as well as this request, then API will
938
- # throw an error.
939
- # The primary instance should exist before any read pool instance is
940
- # created. If the primary instance is a part of the request payload, then
941
- # the API will take care of creating instances in the correct order.
942
- # This method is here to support Google-internal use cases, and is not meant
943
- # for external customers to consume. Please do not start relying on it; its
944
- # behavior is subject to change without notice.
1349
+ # Creates a new SECONDARY Instance in a given project and location.
945
1350
  #
946
- # @overload batch_create_instances(request, options = nil)
947
- # Pass arguments to `batch_create_instances` via a request object, either of type
948
- # {::Google::Cloud::AlloyDB::V1::BatchCreateInstancesRequest} or an equivalent Hash.
1351
+ # @overload create_secondary_instance(request, options = nil)
1352
+ # Pass arguments to `create_secondary_instance` via a request object, either of type
1353
+ # {::Google::Cloud::AlloyDB::V1::CreateSecondaryInstanceRequest} or an equivalent Hash.
949
1354
  #
950
- # @param request [::Google::Cloud::AlloyDB::V1::BatchCreateInstancesRequest, ::Hash]
1355
+ # @param request [::Google::Cloud::AlloyDB::V1::CreateSecondaryInstanceRequest, ::Hash]
951
1356
  # A request object representing the call parameters. Required. To specify no
952
1357
  # parameters, or to keep all the default parameter values, pass an empty Hash.
953
1358
  # @param options [::Gapic::CallOptions, ::Hash]
954
1359
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
955
1360
  #
956
- # @overload batch_create_instances(parent: nil, requests: nil, request_id: nil)
957
- # Pass arguments to `batch_create_instances` via keyword arguments. Note that at
1361
+ # @overload create_secondary_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: nil)
1362
+ # Pass arguments to `create_secondary_instance` via keyword arguments. Note that at
958
1363
  # least one keyword argument is required. To specify no parameters, or to keep all
959
1364
  # the default parameter values, pass an empty Hash as a request object (see above).
960
1365
  #
961
1366
  # @param parent [::String]
962
- # Required. The name of the parent resource.
963
- # @param requests [::Google::Cloud::AlloyDB::V1::CreateInstanceRequests, ::Hash]
964
- # Required. Resources being created.
1367
+ # Required. The name of the parent resource. For the required format, see the
1368
+ # comment on the Instance.name field.
1369
+ # @param instance_id [::String]
1370
+ # Required. ID of the requesting object.
1371
+ # @param instance [::Google::Cloud::AlloyDB::V1::Instance, ::Hash]
1372
+ # Required. The resource being created
965
1373
  # @param request_id [::String]
966
1374
  # Optional. An optional request ID to identify requests. Specify a unique
967
1375
  # request ID so that if you must retry your request, the server will know to
@@ -976,6 +1384,10 @@ module Google
976
1384
  #
977
1385
  # The request ID must be a valid UUID with the exception that zero UUID is
978
1386
  # not supported (00000000-0000-0000-0000-000000000000).
1387
+ # @param validate_only [::Boolean]
1388
+ # Optional. If set, performs request validation (e.g. permission checks and
1389
+ # any other type of validation), but do not actually execute the create
1390
+ # request.
979
1391
  # @yield [result, operation] Access the result along with the TransportOperation object
980
1392
  # @yieldparam result [::Gapic::Operation]
981
1393
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -983,16 +1395,150 @@ module Google
983
1395
  # @return [::Gapic::Operation]
984
1396
  #
985
1397
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
986
- def batch_create_instances request, options = nil
1398
+ #
1399
+ # @example Basic example
1400
+ # require "google/cloud/alloy_db/v1"
1401
+ #
1402
+ # # Create a client object. The client can be reused for multiple calls.
1403
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
1404
+ #
1405
+ # # Create a request. To set request fields, pass in keyword arguments.
1406
+ # request = Google::Cloud::AlloyDB::V1::CreateSecondaryInstanceRequest.new
1407
+ #
1408
+ # # Call the create_secondary_instance method.
1409
+ # result = client.create_secondary_instance request
1410
+ #
1411
+ # # The returned object is of type Gapic::Operation. You can use it to
1412
+ # # check the status of an operation, cancel it, or wait for results.
1413
+ # # Here is how to wait for a response.
1414
+ # result.wait_until_done! timeout: 60
1415
+ # if result.response?
1416
+ # p result.response
1417
+ # else
1418
+ # puts "No response received."
1419
+ # end
1420
+ #
1421
+ def create_secondary_instance request, options = nil
987
1422
  raise ::ArgumentError, "request must be provided" if request.nil?
988
1423
 
989
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::BatchCreateInstancesRequest
1424
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::CreateSecondaryInstanceRequest
990
1425
 
991
1426
  # Converts hash and nil to an options object
992
1427
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
993
1428
 
994
1429
  # Customize the options with defaults
995
- call_metadata = @config.rpcs.batch_create_instances.metadata.to_h
1430
+ call_metadata = @config.rpcs.create_secondary_instance.metadata.to_h
1431
+
1432
+ # Set x-goog-api-client and x-goog-user-project headers
1433
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1434
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1435
+ gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION,
1436
+ transports_version_send: [:rest]
1437
+
1438
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1439
+
1440
+ options.apply_defaults timeout: @config.rpcs.create_secondary_instance.timeout,
1441
+ metadata: call_metadata,
1442
+ retry_policy: @config.rpcs.create_secondary_instance.retry_policy
1443
+
1444
+ options.apply_defaults timeout: @config.timeout,
1445
+ metadata: @config.metadata,
1446
+ retry_policy: @config.retry_policy
1447
+
1448
+ @alloy_db_admin_stub.create_secondary_instance request, options do |result, operation|
1449
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1450
+ yield result, operation if block_given?
1451
+ return result
1452
+ end
1453
+ rescue ::Gapic::Rest::Error => e
1454
+ raise ::Google::Cloud::Error.from_error(e)
1455
+ end
1456
+
1457
+ ##
1458
+ # Creates new instances under the given project, location and cluster.
1459
+ # There can be only one primary instance in a cluster. If the primary
1460
+ # instance exists in the cluster as well as this request, then API will
1461
+ # throw an error.
1462
+ # The primary instance should exist before any read pool instance is
1463
+ # created. If the primary instance is a part of the request payload, then
1464
+ # the API will take care of creating instances in the correct order.
1465
+ # This method is here to support Google-internal use cases, and is not meant
1466
+ # for external customers to consume. Please do not start relying on it; its
1467
+ # behavior is subject to change without notice.
1468
+ #
1469
+ # @overload batch_create_instances(request, options = nil)
1470
+ # Pass arguments to `batch_create_instances` via a request object, either of type
1471
+ # {::Google::Cloud::AlloyDB::V1::BatchCreateInstancesRequest} or an equivalent Hash.
1472
+ #
1473
+ # @param request [::Google::Cloud::AlloyDB::V1::BatchCreateInstancesRequest, ::Hash]
1474
+ # A request object representing the call parameters. Required. To specify no
1475
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1476
+ # @param options [::Gapic::CallOptions, ::Hash]
1477
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1478
+ #
1479
+ # @overload batch_create_instances(parent: nil, requests: nil, request_id: nil)
1480
+ # Pass arguments to `batch_create_instances` via keyword arguments. Note that at
1481
+ # least one keyword argument is required. To specify no parameters, or to keep all
1482
+ # the default parameter values, pass an empty Hash as a request object (see above).
1483
+ #
1484
+ # @param parent [::String]
1485
+ # Required. The name of the parent resource.
1486
+ # @param requests [::Google::Cloud::AlloyDB::V1::CreateInstanceRequests, ::Hash]
1487
+ # Required. Resources being created.
1488
+ # @param request_id [::String]
1489
+ # Optional. An optional request ID to identify requests. Specify a unique
1490
+ # request ID so that if you must retry your request, the server will know to
1491
+ # ignore the request if it has already been completed. The server will
1492
+ # guarantee that for at least 60 minutes since the first request.
1493
+ #
1494
+ # For example, consider a situation where you make an initial request and
1495
+ # the request times out. If you make the request again with the same request
1496
+ # ID, the server can check if original operation with the same request ID
1497
+ # was received, and if so, will ignore the second request. This prevents
1498
+ # clients from accidentally creating duplicate commitments.
1499
+ #
1500
+ # The request ID must be a valid UUID with the exception that zero UUID is
1501
+ # not supported (00000000-0000-0000-0000-000000000000).
1502
+ # @yield [result, operation] Access the result along with the TransportOperation object
1503
+ # @yieldparam result [::Gapic::Operation]
1504
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1505
+ #
1506
+ # @return [::Gapic::Operation]
1507
+ #
1508
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1509
+ #
1510
+ # @example Basic example
1511
+ # require "google/cloud/alloy_db/v1"
1512
+ #
1513
+ # # Create a client object. The client can be reused for multiple calls.
1514
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
1515
+ #
1516
+ # # Create a request. To set request fields, pass in keyword arguments.
1517
+ # request = Google::Cloud::AlloyDB::V1::BatchCreateInstancesRequest.new
1518
+ #
1519
+ # # Call the batch_create_instances method.
1520
+ # result = client.batch_create_instances request
1521
+ #
1522
+ # # The returned object is of type Gapic::Operation. You can use it to
1523
+ # # check the status of an operation, cancel it, or wait for results.
1524
+ # # Here is how to wait for a response.
1525
+ # result.wait_until_done! timeout: 60
1526
+ # if result.response?
1527
+ # p result.response
1528
+ # else
1529
+ # puts "No response received."
1530
+ # end
1531
+ #
1532
+ def batch_create_instances request, options = nil
1533
+ raise ::ArgumentError, "request must be provided" if request.nil?
1534
+
1535
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::BatchCreateInstancesRequest
1536
+
1537
+ # Converts hash and nil to an options object
1538
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1539
+
1540
+ # Customize the options with defaults
1541
+ call_metadata = @config.rpcs.batch_create_instances.metadata.to_h
996
1542
 
997
1543
  # Set x-goog-api-client and x-goog-user-project headers
998
1544
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -1073,6 +1619,29 @@ module Google
1073
1619
  # @return [::Gapic::Operation]
1074
1620
  #
1075
1621
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1622
+ #
1623
+ # @example Basic example
1624
+ # require "google/cloud/alloy_db/v1"
1625
+ #
1626
+ # # Create a client object. The client can be reused for multiple calls.
1627
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
1628
+ #
1629
+ # # Create a request. To set request fields, pass in keyword arguments.
1630
+ # request = Google::Cloud::AlloyDB::V1::UpdateInstanceRequest.new
1631
+ #
1632
+ # # Call the update_instance method.
1633
+ # result = client.update_instance request
1634
+ #
1635
+ # # The returned object is of type Gapic::Operation. You can use it to
1636
+ # # check the status of an operation, cancel it, or wait for results.
1637
+ # # Here is how to wait for a response.
1638
+ # result.wait_until_done! timeout: 60
1639
+ # if result.response?
1640
+ # p result.response
1641
+ # else
1642
+ # puts "No response received."
1643
+ # end
1644
+ #
1076
1645
  def update_instance request, options = nil
1077
1646
  raise ::ArgumentError, "request must be provided" if request.nil?
1078
1647
 
@@ -1158,6 +1727,29 @@ module Google
1158
1727
  # @return [::Gapic::Operation]
1159
1728
  #
1160
1729
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1730
+ #
1731
+ # @example Basic example
1732
+ # require "google/cloud/alloy_db/v1"
1733
+ #
1734
+ # # Create a client object. The client can be reused for multiple calls.
1735
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
1736
+ #
1737
+ # # Create a request. To set request fields, pass in keyword arguments.
1738
+ # request = Google::Cloud::AlloyDB::V1::DeleteInstanceRequest.new
1739
+ #
1740
+ # # Call the delete_instance method.
1741
+ # result = client.delete_instance request
1742
+ #
1743
+ # # The returned object is of type Gapic::Operation. You can use it to
1744
+ # # check the status of an operation, cancel it, or wait for results.
1745
+ # # Here is how to wait for a response.
1746
+ # result.wait_until_done! timeout: 60
1747
+ # if result.response?
1748
+ # p result.response
1749
+ # else
1750
+ # puts "No response received."
1751
+ # end
1752
+ #
1161
1753
  def delete_instance request, options = nil
1162
1754
  raise ::ArgumentError, "request must be provided" if request.nil?
1163
1755
 
@@ -1241,6 +1833,29 @@ module Google
1241
1833
  # @return [::Gapic::Operation]
1242
1834
  #
1243
1835
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1836
+ #
1837
+ # @example Basic example
1838
+ # require "google/cloud/alloy_db/v1"
1839
+ #
1840
+ # # Create a client object. The client can be reused for multiple calls.
1841
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
1842
+ #
1843
+ # # Create a request. To set request fields, pass in keyword arguments.
1844
+ # request = Google::Cloud::AlloyDB::V1::FailoverInstanceRequest.new
1845
+ #
1846
+ # # Call the failover_instance method.
1847
+ # result = client.failover_instance request
1848
+ #
1849
+ # # The returned object is of type Gapic::Operation. You can use it to
1850
+ # # check the status of an operation, cancel it, or wait for results.
1851
+ # # Here is how to wait for a response.
1852
+ # result.wait_until_done! timeout: 60
1853
+ # if result.response?
1854
+ # p result.response
1855
+ # else
1856
+ # puts "No response received."
1857
+ # end
1858
+ #
1244
1859
  def failover_instance request, options = nil
1245
1860
  raise ::ArgumentError, "request must be provided" if request.nil?
1246
1861
 
@@ -1277,6 +1892,114 @@ module Google
1277
1892
  raise ::Google::Cloud::Error.from_error(e)
1278
1893
  end
1279
1894
 
1895
+ ##
1896
+ # Injects fault in an instance.
1897
+ # Imperative only.
1898
+ #
1899
+ # @overload inject_fault(request, options = nil)
1900
+ # Pass arguments to `inject_fault` via a request object, either of type
1901
+ # {::Google::Cloud::AlloyDB::V1::InjectFaultRequest} or an equivalent Hash.
1902
+ #
1903
+ # @param request [::Google::Cloud::AlloyDB::V1::InjectFaultRequest, ::Hash]
1904
+ # A request object representing the call parameters. Required. To specify no
1905
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1906
+ # @param options [::Gapic::CallOptions, ::Hash]
1907
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1908
+ #
1909
+ # @overload inject_fault(fault_type: nil, name: nil, request_id: nil, validate_only: nil)
1910
+ # Pass arguments to `inject_fault` via keyword arguments. Note that at
1911
+ # least one keyword argument is required. To specify no parameters, or to keep all
1912
+ # the default parameter values, pass an empty Hash as a request object (see above).
1913
+ #
1914
+ # @param fault_type [::Google::Cloud::AlloyDB::V1::InjectFaultRequest::FaultType]
1915
+ # Required. The type of fault to be injected in an instance.
1916
+ # @param name [::String]
1917
+ # Required. The name of the resource. For the required format, see the
1918
+ # comment on the Instance.name field.
1919
+ # @param request_id [::String]
1920
+ # Optional. An optional request ID to identify requests. Specify a unique
1921
+ # request ID so that if you must retry your request, the server will know to
1922
+ # ignore the request if it has already been completed. The server will
1923
+ # guarantee that for at least 60 minutes after the first request.
1924
+ #
1925
+ # For example, consider a situation where you make an initial request and
1926
+ # the request times out. If you make the request again with the same request
1927
+ # ID, the server can check if original operation with the same request ID
1928
+ # was received, and if so, will ignore the second request. This prevents
1929
+ # clients from accidentally creating duplicate commitments.
1930
+ #
1931
+ # The request ID must be a valid UUID with the exception that zero UUID is
1932
+ # not supported (00000000-0000-0000-0000-000000000000).
1933
+ # @param validate_only [::Boolean]
1934
+ # Optional. If set, performs request validation (e.g. permission checks and
1935
+ # any other type of validation), but do not actually execute the fault
1936
+ # injection.
1937
+ # @yield [result, operation] Access the result along with the TransportOperation object
1938
+ # @yieldparam result [::Gapic::Operation]
1939
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1940
+ #
1941
+ # @return [::Gapic::Operation]
1942
+ #
1943
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1944
+ #
1945
+ # @example Basic example
1946
+ # require "google/cloud/alloy_db/v1"
1947
+ #
1948
+ # # Create a client object. The client can be reused for multiple calls.
1949
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
1950
+ #
1951
+ # # Create a request. To set request fields, pass in keyword arguments.
1952
+ # request = Google::Cloud::AlloyDB::V1::InjectFaultRequest.new
1953
+ #
1954
+ # # Call the inject_fault method.
1955
+ # result = client.inject_fault request
1956
+ #
1957
+ # # The returned object is of type Gapic::Operation. You can use it to
1958
+ # # check the status of an operation, cancel it, or wait for results.
1959
+ # # Here is how to wait for a response.
1960
+ # result.wait_until_done! timeout: 60
1961
+ # if result.response?
1962
+ # p result.response
1963
+ # else
1964
+ # puts "No response received."
1965
+ # end
1966
+ #
1967
+ def inject_fault request, options = nil
1968
+ raise ::ArgumentError, "request must be provided" if request.nil?
1969
+
1970
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::InjectFaultRequest
1971
+
1972
+ # Converts hash and nil to an options object
1973
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1974
+
1975
+ # Customize the options with defaults
1976
+ call_metadata = @config.rpcs.inject_fault.metadata.to_h
1977
+
1978
+ # Set x-goog-api-client and x-goog-user-project headers
1979
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1980
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1981
+ gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION,
1982
+ transports_version_send: [:rest]
1983
+
1984
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1985
+
1986
+ options.apply_defaults timeout: @config.rpcs.inject_fault.timeout,
1987
+ metadata: call_metadata,
1988
+ retry_policy: @config.rpcs.inject_fault.retry_policy
1989
+
1990
+ options.apply_defaults timeout: @config.timeout,
1991
+ metadata: @config.metadata,
1992
+ retry_policy: @config.retry_policy
1993
+
1994
+ @alloy_db_admin_stub.inject_fault request, options do |result, operation|
1995
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1996
+ yield result, operation if block_given?
1997
+ return result
1998
+ end
1999
+ rescue ::Gapic::Rest::Error => e
2000
+ raise ::Google::Cloud::Error.from_error(e)
2001
+ end
2002
+
1280
2003
  ##
1281
2004
  # Restart an Instance in a cluster.
1282
2005
  # Imperative only.
@@ -1323,6 +2046,29 @@ module Google
1323
2046
  # @return [::Gapic::Operation]
1324
2047
  #
1325
2048
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2049
+ #
2050
+ # @example Basic example
2051
+ # require "google/cloud/alloy_db/v1"
2052
+ #
2053
+ # # Create a client object. The client can be reused for multiple calls.
2054
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
2055
+ #
2056
+ # # Create a request. To set request fields, pass in keyword arguments.
2057
+ # request = Google::Cloud::AlloyDB::V1::RestartInstanceRequest.new
2058
+ #
2059
+ # # Call the restart_instance method.
2060
+ # result = client.restart_instance request
2061
+ #
2062
+ # # The returned object is of type Gapic::Operation. You can use it to
2063
+ # # check the status of an operation, cancel it, or wait for results.
2064
+ # # Here is how to wait for a response.
2065
+ # result.wait_until_done! timeout: 60
2066
+ # if result.response?
2067
+ # p result.response
2068
+ # else
2069
+ # puts "No response received."
2070
+ # end
2071
+ #
1326
2072
  def restart_instance request, options = nil
1327
2073
  raise ::ArgumentError, "request must be provided" if request.nil?
1328
2074
 
@@ -1395,6 +2141,26 @@ module Google
1395
2141
  # @return [::Google::Cloud::AlloyDB::V1::ListBackupsResponse]
1396
2142
  #
1397
2143
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2144
+ #
2145
+ # @example Basic example
2146
+ # require "google/cloud/alloy_db/v1"
2147
+ #
2148
+ # # Create a client object. The client can be reused for multiple calls.
2149
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
2150
+ #
2151
+ # # Create a request. To set request fields, pass in keyword arguments.
2152
+ # request = Google::Cloud::AlloyDB::V1::ListBackupsRequest.new
2153
+ #
2154
+ # # Call the list_backups method.
2155
+ # result = client.list_backups request
2156
+ #
2157
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2158
+ # # over elements, and API calls will be issued to fetch pages as needed.
2159
+ # result.each do |item|
2160
+ # # Each element is of type ::Google::Cloud::AlloyDB::V1::Backup.
2161
+ # p item
2162
+ # end
2163
+ #
1398
2164
  def list_backups request, options = nil
1399
2165
  raise ::ArgumentError, "request must be provided" if request.nil?
1400
2166
 
@@ -1457,6 +2223,22 @@ module Google
1457
2223
  # @return [::Google::Cloud::AlloyDB::V1::Backup]
1458
2224
  #
1459
2225
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2226
+ #
2227
+ # @example Basic example
2228
+ # require "google/cloud/alloy_db/v1"
2229
+ #
2230
+ # # Create a client object. The client can be reused for multiple calls.
2231
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
2232
+ #
2233
+ # # Create a request. To set request fields, pass in keyword arguments.
2234
+ # request = Google::Cloud::AlloyDB::V1::GetBackupRequest.new
2235
+ #
2236
+ # # Call the get_backup method.
2237
+ # result = client.get_backup request
2238
+ #
2239
+ # # The returned object is of type Google::Cloud::AlloyDB::V1::Backup.
2240
+ # p result
2241
+ #
1460
2242
  def get_backup request, options = nil
1461
2243
  raise ::ArgumentError, "request must be provided" if request.nil?
1462
2244
 
@@ -1540,6 +2322,29 @@ module Google
1540
2322
  # @return [::Gapic::Operation]
1541
2323
  #
1542
2324
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2325
+ #
2326
+ # @example Basic example
2327
+ # require "google/cloud/alloy_db/v1"
2328
+ #
2329
+ # # Create a client object. The client can be reused for multiple calls.
2330
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
2331
+ #
2332
+ # # Create a request. To set request fields, pass in keyword arguments.
2333
+ # request = Google::Cloud::AlloyDB::V1::CreateBackupRequest.new
2334
+ #
2335
+ # # Call the create_backup method.
2336
+ # result = client.create_backup request
2337
+ #
2338
+ # # The returned object is of type Gapic::Operation. You can use it to
2339
+ # # check the status of an operation, cancel it, or wait for results.
2340
+ # # Here is how to wait for a response.
2341
+ # result.wait_until_done! timeout: 60
2342
+ # if result.response?
2343
+ # p result.response
2344
+ # else
2345
+ # puts "No response received."
2346
+ # end
2347
+ #
1543
2348
  def create_backup request, options = nil
1544
2349
  raise ::ArgumentError, "request must be provided" if request.nil?
1545
2350
 
@@ -1629,6 +2434,29 @@ module Google
1629
2434
  # @return [::Gapic::Operation]
1630
2435
  #
1631
2436
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2437
+ #
2438
+ # @example Basic example
2439
+ # require "google/cloud/alloy_db/v1"
2440
+ #
2441
+ # # Create a client object. The client can be reused for multiple calls.
2442
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
2443
+ #
2444
+ # # Create a request. To set request fields, pass in keyword arguments.
2445
+ # request = Google::Cloud::AlloyDB::V1::UpdateBackupRequest.new
2446
+ #
2447
+ # # Call the update_backup method.
2448
+ # result = client.update_backup request
2449
+ #
2450
+ # # The returned object is of type Gapic::Operation. You can use it to
2451
+ # # check the status of an operation, cancel it, or wait for results.
2452
+ # # Here is how to wait for a response.
2453
+ # result.wait_until_done! timeout: 60
2454
+ # if result.response?
2455
+ # p result.response
2456
+ # else
2457
+ # puts "No response received."
2458
+ # end
2459
+ #
1632
2460
  def update_backup request, options = nil
1633
2461
  raise ::ArgumentError, "request must be provided" if request.nil?
1634
2462
 
@@ -1714,6 +2542,29 @@ module Google
1714
2542
  # @return [::Gapic::Operation]
1715
2543
  #
1716
2544
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2545
+ #
2546
+ # @example Basic example
2547
+ # require "google/cloud/alloy_db/v1"
2548
+ #
2549
+ # # Create a client object. The client can be reused for multiple calls.
2550
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
2551
+ #
2552
+ # # Create a request. To set request fields, pass in keyword arguments.
2553
+ # request = Google::Cloud::AlloyDB::V1::DeleteBackupRequest.new
2554
+ #
2555
+ # # Call the delete_backup method.
2556
+ # result = client.delete_backup request
2557
+ #
2558
+ # # The returned object is of type Gapic::Operation. You can use it to
2559
+ # # check the status of an operation, cancel it, or wait for results.
2560
+ # # Here is how to wait for a response.
2561
+ # result.wait_until_done! timeout: 60
2562
+ # if result.response?
2563
+ # p result.response
2564
+ # else
2565
+ # puts "No response received."
2566
+ # end
2567
+ #
1717
2568
  def delete_backup request, options = nil
1718
2569
  raise ::ArgumentError, "request must be provided" if request.nil?
1719
2570
 
@@ -1788,6 +2639,26 @@ module Google
1788
2639
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1::SupportedDatabaseFlag>]
1789
2640
  #
1790
2641
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2642
+ #
2643
+ # @example Basic example
2644
+ # require "google/cloud/alloy_db/v1"
2645
+ #
2646
+ # # Create a client object. The client can be reused for multiple calls.
2647
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
2648
+ #
2649
+ # # Create a request. To set request fields, pass in keyword arguments.
2650
+ # request = Google::Cloud::AlloyDB::V1::ListSupportedDatabaseFlagsRequest.new
2651
+ #
2652
+ # # Call the list_supported_database_flags method.
2653
+ # result = client.list_supported_database_flags request
2654
+ #
2655
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2656
+ # # over elements, and API calls will be issued to fetch pages as needed.
2657
+ # result.each do |item|
2658
+ # # Each element is of type ::Google::Cloud::AlloyDB::V1::SupportedDatabaseFlag.
2659
+ # p item
2660
+ # end
2661
+ #
1791
2662
  def list_supported_database_flags request, options = nil
1792
2663
  raise ::ArgumentError, "request must be provided" if request.nil?
1793
2664
 
@@ -1825,24 +2696,492 @@ module Google
1825
2696
  end
1826
2697
 
1827
2698
  ##
1828
- # Configuration class for the AlloyDBAdmin REST API.
2699
+ # Lists Users in a given project and location.
1829
2700
  #
1830
- # This class represents the configuration for AlloyDBAdmin REST,
1831
- # providing control over timeouts, retry behavior, logging, transport
1832
- # parameters, and other low-level controls. Certain parameters can also be
1833
- # applied individually to specific RPCs. See
1834
- # {::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client::Configuration::Rpcs}
1835
- # for a list of RPCs that can be configured independently.
2701
+ # @overload list_users(request, options = nil)
2702
+ # Pass arguments to `list_users` via a request object, either of type
2703
+ # {::Google::Cloud::AlloyDB::V1::ListUsersRequest} or an equivalent Hash.
1836
2704
  #
1837
- # Configuration can be applied globally to all clients, or to a single client
1838
- # on construction.
2705
+ # @param request [::Google::Cloud::AlloyDB::V1::ListUsersRequest, ::Hash]
2706
+ # A request object representing the call parameters. Required. To specify no
2707
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2708
+ # @param options [::Gapic::CallOptions, ::Hash]
2709
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1839
2710
  #
1840
- # @example
2711
+ # @overload list_users(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
2712
+ # Pass arguments to `list_users` via keyword arguments. Note that at
2713
+ # least one keyword argument is required. To specify no parameters, or to keep all
2714
+ # the default parameter values, pass an empty Hash as a request object (see above).
1841
2715
  #
1842
- # # Modify the global config, setting the timeout for
1843
- # # list_clusters to 20 seconds,
1844
- # # and all remaining timeouts to 10 seconds.
1845
- # ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.configure do |config|
2716
+ # @param parent [::String]
2717
+ # Required. Parent value for ListUsersRequest
2718
+ # @param page_size [::Integer]
2719
+ # Optional. Requested page size. Server may return fewer items than
2720
+ # requested. If unspecified, server will pick an appropriate default.
2721
+ # @param page_token [::String]
2722
+ # Optional. A token identifying a page of results the server should return.
2723
+ # @param filter [::String]
2724
+ # Optional. Filtering results
2725
+ # @param order_by [::String]
2726
+ # Optional. Hint for how to order the results
2727
+ # @yield [result, operation] Access the result along with the TransportOperation object
2728
+ # @yieldparam result [::Google::Cloud::AlloyDB::V1::ListUsersResponse]
2729
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2730
+ #
2731
+ # @return [::Google::Cloud::AlloyDB::V1::ListUsersResponse]
2732
+ #
2733
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2734
+ #
2735
+ # @example Basic example
2736
+ # require "google/cloud/alloy_db/v1"
2737
+ #
2738
+ # # Create a client object. The client can be reused for multiple calls.
2739
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
2740
+ #
2741
+ # # Create a request. To set request fields, pass in keyword arguments.
2742
+ # request = Google::Cloud::AlloyDB::V1::ListUsersRequest.new
2743
+ #
2744
+ # # Call the list_users method.
2745
+ # result = client.list_users request
2746
+ #
2747
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2748
+ # # over elements, and API calls will be issued to fetch pages as needed.
2749
+ # result.each do |item|
2750
+ # # Each element is of type ::Google::Cloud::AlloyDB::V1::User.
2751
+ # p item
2752
+ # end
2753
+ #
2754
+ def list_users request, options = nil
2755
+ raise ::ArgumentError, "request must be provided" if request.nil?
2756
+
2757
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::ListUsersRequest
2758
+
2759
+ # Converts hash and nil to an options object
2760
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2761
+
2762
+ # Customize the options with defaults
2763
+ call_metadata = @config.rpcs.list_users.metadata.to_h
2764
+
2765
+ # Set x-goog-api-client and x-goog-user-project headers
2766
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2767
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2768
+ gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION,
2769
+ transports_version_send: [:rest]
2770
+
2771
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2772
+
2773
+ options.apply_defaults timeout: @config.rpcs.list_users.timeout,
2774
+ metadata: call_metadata,
2775
+ retry_policy: @config.rpcs.list_users.retry_policy
2776
+
2777
+ options.apply_defaults timeout: @config.timeout,
2778
+ metadata: @config.metadata,
2779
+ retry_policy: @config.retry_policy
2780
+
2781
+ @alloy_db_admin_stub.list_users request, options do |result, operation|
2782
+ yield result, operation if block_given?
2783
+ return result
2784
+ end
2785
+ rescue ::Gapic::Rest::Error => e
2786
+ raise ::Google::Cloud::Error.from_error(e)
2787
+ end
2788
+
2789
+ ##
2790
+ # Gets details of a single User.
2791
+ #
2792
+ # @overload get_user(request, options = nil)
2793
+ # Pass arguments to `get_user` via a request object, either of type
2794
+ # {::Google::Cloud::AlloyDB::V1::GetUserRequest} or an equivalent Hash.
2795
+ #
2796
+ # @param request [::Google::Cloud::AlloyDB::V1::GetUserRequest, ::Hash]
2797
+ # A request object representing the call parameters. Required. To specify no
2798
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2799
+ # @param options [::Gapic::CallOptions, ::Hash]
2800
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2801
+ #
2802
+ # @overload get_user(name: nil)
2803
+ # Pass arguments to `get_user` via keyword arguments. Note that at
2804
+ # least one keyword argument is required. To specify no parameters, or to keep all
2805
+ # the default parameter values, pass an empty Hash as a request object (see above).
2806
+ #
2807
+ # @param name [::String]
2808
+ # Required. The name of the resource. For the required format, see the
2809
+ # comment on the User.name field.
2810
+ # @yield [result, operation] Access the result along with the TransportOperation object
2811
+ # @yieldparam result [::Google::Cloud::AlloyDB::V1::User]
2812
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2813
+ #
2814
+ # @return [::Google::Cloud::AlloyDB::V1::User]
2815
+ #
2816
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2817
+ #
2818
+ # @example Basic example
2819
+ # require "google/cloud/alloy_db/v1"
2820
+ #
2821
+ # # Create a client object. The client can be reused for multiple calls.
2822
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
2823
+ #
2824
+ # # Create a request. To set request fields, pass in keyword arguments.
2825
+ # request = Google::Cloud::AlloyDB::V1::GetUserRequest.new
2826
+ #
2827
+ # # Call the get_user method.
2828
+ # result = client.get_user request
2829
+ #
2830
+ # # The returned object is of type Google::Cloud::AlloyDB::V1::User.
2831
+ # p result
2832
+ #
2833
+ def get_user request, options = nil
2834
+ raise ::ArgumentError, "request must be provided" if request.nil?
2835
+
2836
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::GetUserRequest
2837
+
2838
+ # Converts hash and nil to an options object
2839
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2840
+
2841
+ # Customize the options with defaults
2842
+ call_metadata = @config.rpcs.get_user.metadata.to_h
2843
+
2844
+ # Set x-goog-api-client and x-goog-user-project headers
2845
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2846
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2847
+ gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION,
2848
+ transports_version_send: [:rest]
2849
+
2850
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2851
+
2852
+ options.apply_defaults timeout: @config.rpcs.get_user.timeout,
2853
+ metadata: call_metadata,
2854
+ retry_policy: @config.rpcs.get_user.retry_policy
2855
+
2856
+ options.apply_defaults timeout: @config.timeout,
2857
+ metadata: @config.metadata,
2858
+ retry_policy: @config.retry_policy
2859
+
2860
+ @alloy_db_admin_stub.get_user request, options do |result, operation|
2861
+ yield result, operation if block_given?
2862
+ return result
2863
+ end
2864
+ rescue ::Gapic::Rest::Error => e
2865
+ raise ::Google::Cloud::Error.from_error(e)
2866
+ end
2867
+
2868
+ ##
2869
+ # Creates a new User in a given project, location, and cluster.
2870
+ #
2871
+ # @overload create_user(request, options = nil)
2872
+ # Pass arguments to `create_user` via a request object, either of type
2873
+ # {::Google::Cloud::AlloyDB::V1::CreateUserRequest} or an equivalent Hash.
2874
+ #
2875
+ # @param request [::Google::Cloud::AlloyDB::V1::CreateUserRequest, ::Hash]
2876
+ # A request object representing the call parameters. Required. To specify no
2877
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2878
+ # @param options [::Gapic::CallOptions, ::Hash]
2879
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2880
+ #
2881
+ # @overload create_user(parent: nil, user_id: nil, user: nil, request_id: nil, validate_only: nil)
2882
+ # Pass arguments to `create_user` via keyword arguments. Note that at
2883
+ # least one keyword argument is required. To specify no parameters, or to keep all
2884
+ # the default parameter values, pass an empty Hash as a request object (see above).
2885
+ #
2886
+ # @param parent [::String]
2887
+ # Required. Value for parent.
2888
+ # @param user_id [::String]
2889
+ # Required. ID of the requesting object.
2890
+ # @param user [::Google::Cloud::AlloyDB::V1::User, ::Hash]
2891
+ # Required. The resource being created
2892
+ # @param request_id [::String]
2893
+ # Optional. An optional request ID to identify requests. Specify a unique
2894
+ # request ID so that if you must retry your request, the server will know to
2895
+ # ignore the request if it has already been completed. The server will
2896
+ # guarantee that for at least 60 minutes since the first request.
2897
+ #
2898
+ # For example, consider a situation where you make an initial request and
2899
+ # the request times out. If you make the request again with the same request
2900
+ # ID, the server can check if original operation with the same request ID
2901
+ # was received, and if so, will ignore the second request. This prevents
2902
+ # clients from accidentally creating duplicate commitments.
2903
+ #
2904
+ # The request ID must be a valid UUID with the exception that zero UUID is
2905
+ # not supported (00000000-0000-0000-0000-000000000000).
2906
+ # @param validate_only [::Boolean]
2907
+ # Optional. If set, the backend validates the request, but doesn't actually
2908
+ # execute it.
2909
+ # @yield [result, operation] Access the result along with the TransportOperation object
2910
+ # @yieldparam result [::Google::Cloud::AlloyDB::V1::User]
2911
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2912
+ #
2913
+ # @return [::Google::Cloud::AlloyDB::V1::User]
2914
+ #
2915
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2916
+ #
2917
+ # @example Basic example
2918
+ # require "google/cloud/alloy_db/v1"
2919
+ #
2920
+ # # Create a client object. The client can be reused for multiple calls.
2921
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
2922
+ #
2923
+ # # Create a request. To set request fields, pass in keyword arguments.
2924
+ # request = Google::Cloud::AlloyDB::V1::CreateUserRequest.new
2925
+ #
2926
+ # # Call the create_user method.
2927
+ # result = client.create_user request
2928
+ #
2929
+ # # The returned object is of type Google::Cloud::AlloyDB::V1::User.
2930
+ # p result
2931
+ #
2932
+ def create_user request, options = nil
2933
+ raise ::ArgumentError, "request must be provided" if request.nil?
2934
+
2935
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::CreateUserRequest
2936
+
2937
+ # Converts hash and nil to an options object
2938
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2939
+
2940
+ # Customize the options with defaults
2941
+ call_metadata = @config.rpcs.create_user.metadata.to_h
2942
+
2943
+ # Set x-goog-api-client and x-goog-user-project headers
2944
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2945
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2946
+ gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION,
2947
+ transports_version_send: [:rest]
2948
+
2949
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2950
+
2951
+ options.apply_defaults timeout: @config.rpcs.create_user.timeout,
2952
+ metadata: call_metadata,
2953
+ retry_policy: @config.rpcs.create_user.retry_policy
2954
+
2955
+ options.apply_defaults timeout: @config.timeout,
2956
+ metadata: @config.metadata,
2957
+ retry_policy: @config.retry_policy
2958
+
2959
+ @alloy_db_admin_stub.create_user request, options do |result, operation|
2960
+ yield result, operation if block_given?
2961
+ return result
2962
+ end
2963
+ rescue ::Gapic::Rest::Error => e
2964
+ raise ::Google::Cloud::Error.from_error(e)
2965
+ end
2966
+
2967
+ ##
2968
+ # Updates the parameters of a single User.
2969
+ #
2970
+ # @overload update_user(request, options = nil)
2971
+ # Pass arguments to `update_user` via a request object, either of type
2972
+ # {::Google::Cloud::AlloyDB::V1::UpdateUserRequest} or an equivalent Hash.
2973
+ #
2974
+ # @param request [::Google::Cloud::AlloyDB::V1::UpdateUserRequest, ::Hash]
2975
+ # A request object representing the call parameters. Required. To specify no
2976
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2977
+ # @param options [::Gapic::CallOptions, ::Hash]
2978
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2979
+ #
2980
+ # @overload update_user(update_mask: nil, user: nil, request_id: nil, validate_only: nil, allow_missing: nil)
2981
+ # Pass arguments to `update_user` via keyword arguments. Note that at
2982
+ # least one keyword argument is required. To specify no parameters, or to keep all
2983
+ # the default parameter values, pass an empty Hash as a request object (see above).
2984
+ #
2985
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2986
+ # Optional. Field mask is used to specify the fields to be overwritten in the
2987
+ # User resource by the update.
2988
+ # The fields specified in the update_mask are relative to the resource, not
2989
+ # the full request. A field will be overwritten if it is in the mask. If the
2990
+ # user does not provide a mask then all fields will be overwritten.
2991
+ # @param user [::Google::Cloud::AlloyDB::V1::User, ::Hash]
2992
+ # Required. The resource being updated
2993
+ # @param request_id [::String]
2994
+ # Optional. An optional request ID to identify requests. Specify a unique
2995
+ # request ID so that if you must retry your request, the server will know to
2996
+ # ignore the request if it has already been completed. The server will
2997
+ # guarantee that for at least 60 minutes since the first request.
2998
+ #
2999
+ # For example, consider a situation where you make an initial request and
3000
+ # the request times out. If you make the request again with the same request
3001
+ # ID, the server can check if original operation with the same request ID
3002
+ # was received, and if so, will ignore the second request. This prevents
3003
+ # clients from accidentally creating duplicate commitments.
3004
+ #
3005
+ # The request ID must be a valid UUID with the exception that zero UUID is
3006
+ # not supported (00000000-0000-0000-0000-000000000000).
3007
+ # @param validate_only [::Boolean]
3008
+ # Optional. If set, the backend validates the request, but doesn't actually
3009
+ # execute it.
3010
+ # @param allow_missing [::Boolean]
3011
+ # Optional. Allow missing fields in the update mask.
3012
+ # @yield [result, operation] Access the result along with the TransportOperation object
3013
+ # @yieldparam result [::Google::Cloud::AlloyDB::V1::User]
3014
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3015
+ #
3016
+ # @return [::Google::Cloud::AlloyDB::V1::User]
3017
+ #
3018
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3019
+ #
3020
+ # @example Basic example
3021
+ # require "google/cloud/alloy_db/v1"
3022
+ #
3023
+ # # Create a client object. The client can be reused for multiple calls.
3024
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
3025
+ #
3026
+ # # Create a request. To set request fields, pass in keyword arguments.
3027
+ # request = Google::Cloud::AlloyDB::V1::UpdateUserRequest.new
3028
+ #
3029
+ # # Call the update_user method.
3030
+ # result = client.update_user request
3031
+ #
3032
+ # # The returned object is of type Google::Cloud::AlloyDB::V1::User.
3033
+ # p result
3034
+ #
3035
+ def update_user request, options = nil
3036
+ raise ::ArgumentError, "request must be provided" if request.nil?
3037
+
3038
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::UpdateUserRequest
3039
+
3040
+ # Converts hash and nil to an options object
3041
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3042
+
3043
+ # Customize the options with defaults
3044
+ call_metadata = @config.rpcs.update_user.metadata.to_h
3045
+
3046
+ # Set x-goog-api-client and x-goog-user-project headers
3047
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3048
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3049
+ gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION,
3050
+ transports_version_send: [:rest]
3051
+
3052
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3053
+
3054
+ options.apply_defaults timeout: @config.rpcs.update_user.timeout,
3055
+ metadata: call_metadata,
3056
+ retry_policy: @config.rpcs.update_user.retry_policy
3057
+
3058
+ options.apply_defaults timeout: @config.timeout,
3059
+ metadata: @config.metadata,
3060
+ retry_policy: @config.retry_policy
3061
+
3062
+ @alloy_db_admin_stub.update_user request, options do |result, operation|
3063
+ yield result, operation if block_given?
3064
+ return result
3065
+ end
3066
+ rescue ::Gapic::Rest::Error => e
3067
+ raise ::Google::Cloud::Error.from_error(e)
3068
+ end
3069
+
3070
+ ##
3071
+ # Deletes a single User.
3072
+ #
3073
+ # @overload delete_user(request, options = nil)
3074
+ # Pass arguments to `delete_user` via a request object, either of type
3075
+ # {::Google::Cloud::AlloyDB::V1::DeleteUserRequest} or an equivalent Hash.
3076
+ #
3077
+ # @param request [::Google::Cloud::AlloyDB::V1::DeleteUserRequest, ::Hash]
3078
+ # A request object representing the call parameters. Required. To specify no
3079
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3080
+ # @param options [::Gapic::CallOptions, ::Hash]
3081
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3082
+ #
3083
+ # @overload delete_user(name: nil, request_id: nil, validate_only: nil)
3084
+ # Pass arguments to `delete_user` via keyword arguments. Note that at
3085
+ # least one keyword argument is required. To specify no parameters, or to keep all
3086
+ # the default parameter values, pass an empty Hash as a request object (see above).
3087
+ #
3088
+ # @param name [::String]
3089
+ # Required. The name of the resource. For the required format, see the
3090
+ # comment on the User.name field.
3091
+ # @param request_id [::String]
3092
+ # Optional. An optional request ID to identify requests. Specify a unique
3093
+ # request ID so that if you must retry your request, the server will know to
3094
+ # ignore the request if it has already been completed. The server will
3095
+ # guarantee that for at least 60 minutes after the first request.
3096
+ #
3097
+ # For example, consider a situation where you make an initial request and
3098
+ # the request times out. If you make the request again with the same request
3099
+ # ID, the server can check if original operation with the same request ID
3100
+ # was received, and if so, will ignore the second request. This prevents
3101
+ # clients from accidentally creating duplicate commitments.
3102
+ #
3103
+ # The request ID must be a valid UUID with the exception that zero UUID is
3104
+ # not supported (00000000-0000-0000-0000-000000000000).
3105
+ # @param validate_only [::Boolean]
3106
+ # Optional. If set, the backend validates the request, but doesn't actually
3107
+ # execute it.
3108
+ # @yield [result, operation] Access the result along with the TransportOperation object
3109
+ # @yieldparam result [::Google::Protobuf::Empty]
3110
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3111
+ #
3112
+ # @return [::Google::Protobuf::Empty]
3113
+ #
3114
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3115
+ #
3116
+ # @example Basic example
3117
+ # require "google/cloud/alloy_db/v1"
3118
+ #
3119
+ # # Create a client object. The client can be reused for multiple calls.
3120
+ # client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new
3121
+ #
3122
+ # # Create a request. To set request fields, pass in keyword arguments.
3123
+ # request = Google::Cloud::AlloyDB::V1::DeleteUserRequest.new
3124
+ #
3125
+ # # Call the delete_user method.
3126
+ # result = client.delete_user request
3127
+ #
3128
+ # # The returned object is of type Google::Protobuf::Empty.
3129
+ # p result
3130
+ #
3131
+ def delete_user request, options = nil
3132
+ raise ::ArgumentError, "request must be provided" if request.nil?
3133
+
3134
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::DeleteUserRequest
3135
+
3136
+ # Converts hash and nil to an options object
3137
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3138
+
3139
+ # Customize the options with defaults
3140
+ call_metadata = @config.rpcs.delete_user.metadata.to_h
3141
+
3142
+ # Set x-goog-api-client and x-goog-user-project headers
3143
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3144
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3145
+ gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION,
3146
+ transports_version_send: [:rest]
3147
+
3148
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3149
+
3150
+ options.apply_defaults timeout: @config.rpcs.delete_user.timeout,
3151
+ metadata: call_metadata,
3152
+ retry_policy: @config.rpcs.delete_user.retry_policy
3153
+
3154
+ options.apply_defaults timeout: @config.timeout,
3155
+ metadata: @config.metadata,
3156
+ retry_policy: @config.retry_policy
3157
+
3158
+ @alloy_db_admin_stub.delete_user request, options do |result, operation|
3159
+ yield result, operation if block_given?
3160
+ return result
3161
+ end
3162
+ rescue ::Gapic::Rest::Error => e
3163
+ raise ::Google::Cloud::Error.from_error(e)
3164
+ end
3165
+
3166
+ ##
3167
+ # Configuration class for the AlloyDBAdmin REST API.
3168
+ #
3169
+ # This class represents the configuration for AlloyDBAdmin REST,
3170
+ # providing control over timeouts, retry behavior, logging, transport
3171
+ # parameters, and other low-level controls. Certain parameters can also be
3172
+ # applied individually to specific RPCs. See
3173
+ # {::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client::Configuration::Rpcs}
3174
+ # for a list of RPCs that can be configured independently.
3175
+ #
3176
+ # Configuration can be applied globally to all clients, or to a single client
3177
+ # on construction.
3178
+ #
3179
+ # @example
3180
+ #
3181
+ # # Modify the global config, setting the timeout for
3182
+ # # list_clusters to 20 seconds,
3183
+ # # and all remaining timeouts to 10 seconds.
3184
+ # ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.configure do |config|
1846
3185
  # config.timeout = 10.0
1847
3186
  # config.rpcs.list_clusters.timeout = 20.0
1848
3187
  # end
@@ -1982,11 +3321,21 @@ module Google
1982
3321
  #
1983
3322
  attr_reader :delete_cluster
1984
3323
  ##
3324
+ # RPC-specific configuration for `promote_cluster`
3325
+ # @return [::Gapic::Config::Method]
3326
+ #
3327
+ attr_reader :promote_cluster
3328
+ ##
1985
3329
  # RPC-specific configuration for `restore_cluster`
1986
3330
  # @return [::Gapic::Config::Method]
1987
3331
  #
1988
3332
  attr_reader :restore_cluster
1989
3333
  ##
3334
+ # RPC-specific configuration for `create_secondary_cluster`
3335
+ # @return [::Gapic::Config::Method]
3336
+ #
3337
+ attr_reader :create_secondary_cluster
3338
+ ##
1990
3339
  # RPC-specific configuration for `list_instances`
1991
3340
  # @return [::Gapic::Config::Method]
1992
3341
  #
@@ -2002,6 +3351,11 @@ module Google
2002
3351
  #
2003
3352
  attr_reader :create_instance
2004
3353
  ##
3354
+ # RPC-specific configuration for `create_secondary_instance`
3355
+ # @return [::Gapic::Config::Method]
3356
+ #
3357
+ attr_reader :create_secondary_instance
3358
+ ##
2005
3359
  # RPC-specific configuration for `batch_create_instances`
2006
3360
  # @return [::Gapic::Config::Method]
2007
3361
  #
@@ -2022,6 +3376,11 @@ module Google
2022
3376
  #
2023
3377
  attr_reader :failover_instance
2024
3378
  ##
3379
+ # RPC-specific configuration for `inject_fault`
3380
+ # @return [::Gapic::Config::Method]
3381
+ #
3382
+ attr_reader :inject_fault
3383
+ ##
2025
3384
  # RPC-specific configuration for `restart_instance`
2026
3385
  # @return [::Gapic::Config::Method]
2027
3386
  #
@@ -2056,6 +3415,31 @@ module Google
2056
3415
  # @return [::Gapic::Config::Method]
2057
3416
  #
2058
3417
  attr_reader :list_supported_database_flags
3418
+ ##
3419
+ # RPC-specific configuration for `list_users`
3420
+ # @return [::Gapic::Config::Method]
3421
+ #
3422
+ attr_reader :list_users
3423
+ ##
3424
+ # RPC-specific configuration for `get_user`
3425
+ # @return [::Gapic::Config::Method]
3426
+ #
3427
+ attr_reader :get_user
3428
+ ##
3429
+ # RPC-specific configuration for `create_user`
3430
+ # @return [::Gapic::Config::Method]
3431
+ #
3432
+ attr_reader :create_user
3433
+ ##
3434
+ # RPC-specific configuration for `update_user`
3435
+ # @return [::Gapic::Config::Method]
3436
+ #
3437
+ attr_reader :update_user
3438
+ ##
3439
+ # RPC-specific configuration for `delete_user`
3440
+ # @return [::Gapic::Config::Method]
3441
+ #
3442
+ attr_reader :delete_user
2059
3443
 
2060
3444
  # @private
2061
3445
  def initialize parent_rpcs = nil
@@ -2069,14 +3453,20 @@ module Google
2069
3453
  @update_cluster = ::Gapic::Config::Method.new update_cluster_config
2070
3454
  delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster
2071
3455
  @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config
3456
+ promote_cluster_config = parent_rpcs.promote_cluster if parent_rpcs.respond_to? :promote_cluster
3457
+ @promote_cluster = ::Gapic::Config::Method.new promote_cluster_config
2072
3458
  restore_cluster_config = parent_rpcs.restore_cluster if parent_rpcs.respond_to? :restore_cluster
2073
3459
  @restore_cluster = ::Gapic::Config::Method.new restore_cluster_config
3460
+ create_secondary_cluster_config = parent_rpcs.create_secondary_cluster if parent_rpcs.respond_to? :create_secondary_cluster
3461
+ @create_secondary_cluster = ::Gapic::Config::Method.new create_secondary_cluster_config
2074
3462
  list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
2075
3463
  @list_instances = ::Gapic::Config::Method.new list_instances_config
2076
3464
  get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
2077
3465
  @get_instance = ::Gapic::Config::Method.new get_instance_config
2078
3466
  create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
2079
3467
  @create_instance = ::Gapic::Config::Method.new create_instance_config
3468
+ create_secondary_instance_config = parent_rpcs.create_secondary_instance if parent_rpcs.respond_to? :create_secondary_instance
3469
+ @create_secondary_instance = ::Gapic::Config::Method.new create_secondary_instance_config
2080
3470
  batch_create_instances_config = parent_rpcs.batch_create_instances if parent_rpcs.respond_to? :batch_create_instances
2081
3471
  @batch_create_instances = ::Gapic::Config::Method.new batch_create_instances_config
2082
3472
  update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance
@@ -2085,6 +3475,8 @@ module Google
2085
3475
  @delete_instance = ::Gapic::Config::Method.new delete_instance_config
2086
3476
  failover_instance_config = parent_rpcs.failover_instance if parent_rpcs.respond_to? :failover_instance
2087
3477
  @failover_instance = ::Gapic::Config::Method.new failover_instance_config
3478
+ inject_fault_config = parent_rpcs.inject_fault if parent_rpcs.respond_to? :inject_fault
3479
+ @inject_fault = ::Gapic::Config::Method.new inject_fault_config
2088
3480
  restart_instance_config = parent_rpcs.restart_instance if parent_rpcs.respond_to? :restart_instance
2089
3481
  @restart_instance = ::Gapic::Config::Method.new restart_instance_config
2090
3482
  list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
@@ -2099,6 +3491,16 @@ module Google
2099
3491
  @delete_backup = ::Gapic::Config::Method.new delete_backup_config
2100
3492
  list_supported_database_flags_config = parent_rpcs.list_supported_database_flags if parent_rpcs.respond_to? :list_supported_database_flags
2101
3493
  @list_supported_database_flags = ::Gapic::Config::Method.new list_supported_database_flags_config
3494
+ list_users_config = parent_rpcs.list_users if parent_rpcs.respond_to? :list_users
3495
+ @list_users = ::Gapic::Config::Method.new list_users_config
3496
+ get_user_config = parent_rpcs.get_user if parent_rpcs.respond_to? :get_user
3497
+ @get_user = ::Gapic::Config::Method.new get_user_config
3498
+ create_user_config = parent_rpcs.create_user if parent_rpcs.respond_to? :create_user
3499
+ @create_user = ::Gapic::Config::Method.new create_user_config
3500
+ update_user_config = parent_rpcs.update_user if parent_rpcs.respond_to? :update_user
3501
+ @update_user = ::Gapic::Config::Method.new update_user_config
3502
+ delete_user_config = parent_rpcs.delete_user if parent_rpcs.respond_to? :delete_user
3503
+ @delete_user = ::Gapic::Config::Method.new delete_user_config
2102
3504
 
2103
3505
  yield self if block_given?
2104
3506
  end