google-cloud-alloy_db-v1 0.2.0 → 0.4.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.
- checksums.yaml +4 -4
- data/lib/google/cloud/alloy_db/v1/alloy_db_admin/client.rb +1120 -72
- data/lib/google/cloud/alloy_db/v1/alloy_db_admin/operations.rb +10 -1
- data/lib/google/cloud/alloy_db/v1/alloy_db_admin/paths.rb +21 -0
- data/lib/google/cloud/alloy_db/v1/alloy_db_admin/rest/client.rb +1441 -39
- data/lib/google/cloud/alloy_db/v1/alloy_db_admin/rest/operations.rb +75 -0
- data/lib/google/cloud/alloy_db/v1/alloy_db_admin/rest/service_stub.rb +537 -0
- data/lib/google/cloud/alloy_db/v1/version.rb +1 -1
- data/lib/google/cloud/alloydb/v1/resources_pb.rb +8 -2
- data/lib/google/cloud/alloydb/v1/service_pb.rb +12 -1
- data/lib/google/cloud/alloydb/v1/service_services_pb.rb +23 -0
- data/proto_docs/google/api/field_behavior.rb +14 -0
- data/proto_docs/google/cloud/alloydb/v1/resources.rb +140 -16
- data/proto_docs/google/cloud/alloydb/v1/service.rb +307 -1
- metadata +5 -5
@@ -195,7 +195,8 @@ module Google
|
|
195
195
|
credentials: credentials,
|
196
196
|
endpoint: @config.endpoint,
|
197
197
|
channel_args: @config.channel_args,
|
198
|
-
interceptors: @config.interceptors
|
198
|
+
interceptors: @config.interceptors,
|
199
|
+
channel_pool_config: @config.channel_pool
|
199
200
|
)
|
200
201
|
end
|
201
202
|
|
@@ -337,7 +338,7 @@ module Google
|
|
337
338
|
# @param options [::Gapic::CallOptions, ::Hash]
|
338
339
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
339
340
|
#
|
340
|
-
# @overload get_cluster(name: nil)
|
341
|
+
# @overload get_cluster(name: nil, view: nil)
|
341
342
|
# Pass arguments to `get_cluster` via keyword arguments. Note that at
|
342
343
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
343
344
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -345,6 +346,9 @@ module Google
|
|
345
346
|
# @param name [::String]
|
346
347
|
# Required. The name of the resource. For the required format, see the
|
347
348
|
# comment on the Cluster.name field.
|
349
|
+
# @param view [::Google::Cloud::AlloyDB::V1::ClusterView]
|
350
|
+
# Optional. The view of the cluster to return. Returns all default fields if
|
351
|
+
# not set.
|
348
352
|
#
|
349
353
|
# @yield [response, operation] Access the result along with the RPC operation
|
350
354
|
# @yieldparam response [::Google::Cloud::AlloyDB::V1::Cluster]
|
@@ -429,7 +433,7 @@ module Google
|
|
429
433
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
430
434
|
#
|
431
435
|
# @param parent [::String]
|
432
|
-
# Required. The
|
436
|
+
# Required. The location of the new cluster. For the required format, see the
|
433
437
|
# comment on the Cluster.name field.
|
434
438
|
# @param cluster_id [::String]
|
435
439
|
# Required. ID of the requesting object.
|
@@ -763,6 +767,124 @@ module Google
|
|
763
767
|
raise ::Google::Cloud::Error.from_error(e)
|
764
768
|
end
|
765
769
|
|
770
|
+
##
|
771
|
+
# Promotes a SECONDARY cluster. This turns down replication
|
772
|
+
# from the PRIMARY cluster and promotes a secondary cluster
|
773
|
+
# into its own standalone cluster.
|
774
|
+
# Imperative only.
|
775
|
+
#
|
776
|
+
# @overload promote_cluster(request, options = nil)
|
777
|
+
# Pass arguments to `promote_cluster` via a request object, either of type
|
778
|
+
# {::Google::Cloud::AlloyDB::V1::PromoteClusterRequest} or an equivalent Hash.
|
779
|
+
#
|
780
|
+
# @param request [::Google::Cloud::AlloyDB::V1::PromoteClusterRequest, ::Hash]
|
781
|
+
# A request object representing the call parameters. Required. To specify no
|
782
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
783
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
784
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
785
|
+
#
|
786
|
+
# @overload promote_cluster(name: nil, request_id: nil, etag: nil, validate_only: nil)
|
787
|
+
# Pass arguments to `promote_cluster` via keyword arguments. Note that at
|
788
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
789
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
790
|
+
#
|
791
|
+
# @param name [::String]
|
792
|
+
# Required. The name of the resource. For the required format, see the
|
793
|
+
# comment on the Cluster.name field
|
794
|
+
# @param request_id [::String]
|
795
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
796
|
+
# request ID so that if you must retry your request, the server will know to
|
797
|
+
# ignore the request if it has already been completed. The server will
|
798
|
+
# guarantee that for at least 60 minutes after the first request.
|
799
|
+
#
|
800
|
+
# For example, consider a situation where you make an initial request and
|
801
|
+
# the request times out. If you make the request again with the same request
|
802
|
+
# ID, the server can check if original operation with the same request ID
|
803
|
+
# was received, and if so, will ignore the second request. This prevents
|
804
|
+
# clients from accidentally creating duplicate commitments.
|
805
|
+
#
|
806
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
807
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
808
|
+
# @param etag [::String]
|
809
|
+
# Optional. The current etag of the Cluster.
|
810
|
+
# If an etag is provided and does not match the current etag of the Cluster,
|
811
|
+
# deletion will be blocked and an ABORTED error will be returned.
|
812
|
+
# @param validate_only [::Boolean]
|
813
|
+
# Optional. If set, performs request validation (e.g. permission checks and
|
814
|
+
# any other type of validation), but do not actually execute the delete.
|
815
|
+
#
|
816
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
817
|
+
# @yieldparam response [::Gapic::Operation]
|
818
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
819
|
+
#
|
820
|
+
# @return [::Gapic::Operation]
|
821
|
+
#
|
822
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
823
|
+
#
|
824
|
+
# @example Basic example
|
825
|
+
# require "google/cloud/alloy_db/v1"
|
826
|
+
#
|
827
|
+
# # Create a client object. The client can be reused for multiple calls.
|
828
|
+
# client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new
|
829
|
+
#
|
830
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
831
|
+
# request = Google::Cloud::AlloyDB::V1::PromoteClusterRequest.new
|
832
|
+
#
|
833
|
+
# # Call the promote_cluster method.
|
834
|
+
# result = client.promote_cluster request
|
835
|
+
#
|
836
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
837
|
+
# # check the status of an operation, cancel it, or wait for results.
|
838
|
+
# # Here is how to wait for a response.
|
839
|
+
# result.wait_until_done! timeout: 60
|
840
|
+
# if result.response?
|
841
|
+
# p result.response
|
842
|
+
# else
|
843
|
+
# puts "No response received."
|
844
|
+
# end
|
845
|
+
#
|
846
|
+
def promote_cluster request, options = nil
|
847
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
848
|
+
|
849
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::PromoteClusterRequest
|
850
|
+
|
851
|
+
# Converts hash and nil to an options object
|
852
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
853
|
+
|
854
|
+
# Customize the options with defaults
|
855
|
+
metadata = @config.rpcs.promote_cluster.metadata.to_h
|
856
|
+
|
857
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
858
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
859
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
860
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION
|
861
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
862
|
+
|
863
|
+
header_params = {}
|
864
|
+
if request.name
|
865
|
+
header_params["name"] = request.name
|
866
|
+
end
|
867
|
+
|
868
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
869
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
870
|
+
|
871
|
+
options.apply_defaults timeout: @config.rpcs.promote_cluster.timeout,
|
872
|
+
metadata: metadata,
|
873
|
+
retry_policy: @config.rpcs.promote_cluster.retry_policy
|
874
|
+
|
875
|
+
options.apply_defaults timeout: @config.timeout,
|
876
|
+
metadata: @config.metadata,
|
877
|
+
retry_policy: @config.retry_policy
|
878
|
+
|
879
|
+
@alloy_db_admin_stub.call_rpc :promote_cluster, request, options: options do |response, operation|
|
880
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
881
|
+
yield response, operation if block_given?
|
882
|
+
return response
|
883
|
+
end
|
884
|
+
rescue ::GRPC::BadStatus => e
|
885
|
+
raise ::Google::Cloud::Error.from_error(e)
|
886
|
+
end
|
887
|
+
|
766
888
|
##
|
767
889
|
# Creates a new Cluster in a given project and location, with a volume
|
768
890
|
# restored from the provided source, either a backup ID or a point-in-time
|
@@ -778,13 +900,16 @@ module Google
|
|
778
900
|
# @param options [::Gapic::CallOptions, ::Hash]
|
779
901
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
780
902
|
#
|
781
|
-
# @overload restore_cluster(backup_source: nil, parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil)
|
903
|
+
# @overload restore_cluster(backup_source: nil, continuous_backup_source: nil, parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil)
|
782
904
|
# Pass arguments to `restore_cluster` via keyword arguments. Note that at
|
783
905
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
784
906
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
785
907
|
#
|
786
908
|
# @param backup_source [::Google::Cloud::AlloyDB::V1::BackupSource, ::Hash]
|
787
909
|
# Backup source.
|
910
|
+
# @param continuous_backup_source [::Google::Cloud::AlloyDB::V1::ContinuousBackupSource, ::Hash]
|
911
|
+
# ContinuousBackup source. Continuous backup needs to be enabled in the
|
912
|
+
# source cluster for this operation to succeed.
|
788
913
|
# @param parent [::String]
|
789
914
|
# Required. The name of the parent resource. For the required format, see the
|
790
915
|
# comment on the Cluster.name field.
|
@@ -883,6 +1008,123 @@ module Google
|
|
883
1008
|
raise ::Google::Cloud::Error.from_error(e)
|
884
1009
|
end
|
885
1010
|
|
1011
|
+
##
|
1012
|
+
# Creates a cluster of type SECONDARY in the given location using
|
1013
|
+
# the primary cluster as the source.
|
1014
|
+
#
|
1015
|
+
# @overload create_secondary_cluster(request, options = nil)
|
1016
|
+
# Pass arguments to `create_secondary_cluster` via a request object, either of type
|
1017
|
+
# {::Google::Cloud::AlloyDB::V1::CreateSecondaryClusterRequest} or an equivalent Hash.
|
1018
|
+
#
|
1019
|
+
# @param request [::Google::Cloud::AlloyDB::V1::CreateSecondaryClusterRequest, ::Hash]
|
1020
|
+
# A request object representing the call parameters. Required. To specify no
|
1021
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1022
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1023
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1024
|
+
#
|
1025
|
+
# @overload create_secondary_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil)
|
1026
|
+
# Pass arguments to `create_secondary_cluster` via keyword arguments. Note that at
|
1027
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1028
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1029
|
+
#
|
1030
|
+
# @param parent [::String]
|
1031
|
+
# Required. The location of the new cluster. For the required
|
1032
|
+
# format, see the comment on the Cluster.name field.
|
1033
|
+
# @param cluster_id [::String]
|
1034
|
+
# Required. ID of the requesting object (the secondary cluster).
|
1035
|
+
# @param cluster [::Google::Cloud::AlloyDB::V1::Cluster, ::Hash]
|
1036
|
+
# Required. Configuration of the requesting object (the secondary cluster).
|
1037
|
+
# @param request_id [::String]
|
1038
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
1039
|
+
# request ID so that if you must retry your request, the server will know to
|
1040
|
+
# ignore the request if it has already been completed. The server will
|
1041
|
+
# guarantee that for at least 60 minutes since the first request.
|
1042
|
+
#
|
1043
|
+
# For example, consider a situation where you make an initial request and
|
1044
|
+
# the request times out. If you make the request again with the same request
|
1045
|
+
# ID, the server can check if original operation with the same request ID
|
1046
|
+
# was received, and if so, will ignore the second request. This prevents
|
1047
|
+
# clients from accidentally creating duplicate commitments.
|
1048
|
+
#
|
1049
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
1050
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
1051
|
+
# @param validate_only [::Boolean]
|
1052
|
+
# Optional. If set, performs request validation (e.g. permission checks and
|
1053
|
+
# any other type of validation), but do not actually execute the create
|
1054
|
+
# request.
|
1055
|
+
#
|
1056
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1057
|
+
# @yieldparam response [::Gapic::Operation]
|
1058
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1059
|
+
#
|
1060
|
+
# @return [::Gapic::Operation]
|
1061
|
+
#
|
1062
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1063
|
+
#
|
1064
|
+
# @example Basic example
|
1065
|
+
# require "google/cloud/alloy_db/v1"
|
1066
|
+
#
|
1067
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1068
|
+
# client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new
|
1069
|
+
#
|
1070
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1071
|
+
# request = Google::Cloud::AlloyDB::V1::CreateSecondaryClusterRequest.new
|
1072
|
+
#
|
1073
|
+
# # Call the create_secondary_cluster method.
|
1074
|
+
# result = client.create_secondary_cluster request
|
1075
|
+
#
|
1076
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1077
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1078
|
+
# # Here is how to wait for a response.
|
1079
|
+
# result.wait_until_done! timeout: 60
|
1080
|
+
# if result.response?
|
1081
|
+
# p result.response
|
1082
|
+
# else
|
1083
|
+
# puts "No response received."
|
1084
|
+
# end
|
1085
|
+
#
|
1086
|
+
def create_secondary_cluster request, options = nil
|
1087
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1088
|
+
|
1089
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::CreateSecondaryClusterRequest
|
1090
|
+
|
1091
|
+
# Converts hash and nil to an options object
|
1092
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1093
|
+
|
1094
|
+
# Customize the options with defaults
|
1095
|
+
metadata = @config.rpcs.create_secondary_cluster.metadata.to_h
|
1096
|
+
|
1097
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1098
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1099
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1100
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION
|
1101
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1102
|
+
|
1103
|
+
header_params = {}
|
1104
|
+
if request.parent
|
1105
|
+
header_params["parent"] = request.parent
|
1106
|
+
end
|
1107
|
+
|
1108
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1109
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1110
|
+
|
1111
|
+
options.apply_defaults timeout: @config.rpcs.create_secondary_cluster.timeout,
|
1112
|
+
metadata: metadata,
|
1113
|
+
retry_policy: @config.rpcs.create_secondary_cluster.retry_policy
|
1114
|
+
|
1115
|
+
options.apply_defaults timeout: @config.timeout,
|
1116
|
+
metadata: @config.metadata,
|
1117
|
+
retry_policy: @config.retry_policy
|
1118
|
+
|
1119
|
+
@alloy_db_admin_stub.call_rpc :create_secondary_cluster, request, options: options do |response, operation|
|
1120
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1121
|
+
yield response, operation if block_given?
|
1122
|
+
return response
|
1123
|
+
end
|
1124
|
+
rescue ::GRPC::BadStatus => e
|
1125
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1126
|
+
end
|
1127
|
+
|
886
1128
|
##
|
887
1129
|
# Lists Instances in a given project and location.
|
888
1130
|
#
|
@@ -1192,36 +1434,30 @@ module Google
|
|
1192
1434
|
end
|
1193
1435
|
|
1194
1436
|
##
|
1195
|
-
# Creates new
|
1196
|
-
# There can be only one primary instance in a cluster. If the primary
|
1197
|
-
# instance exists in the cluster as well as this request, then API will
|
1198
|
-
# throw an error.
|
1199
|
-
# The primary instance should exist before any read pool instance is
|
1200
|
-
# created. If the primary instance is a part of the request payload, then
|
1201
|
-
# the API will take care of creating instances in the correct order.
|
1202
|
-
# This method is here to support Google-internal use cases, and is not meant
|
1203
|
-
# for external customers to consume. Please do not start relying on it; its
|
1204
|
-
# behavior is subject to change without notice.
|
1437
|
+
# Creates a new SECONDARY Instance in a given project and location.
|
1205
1438
|
#
|
1206
|
-
# @overload
|
1207
|
-
# Pass arguments to `
|
1208
|
-
# {::Google::Cloud::AlloyDB::V1::
|
1439
|
+
# @overload create_secondary_instance(request, options = nil)
|
1440
|
+
# Pass arguments to `create_secondary_instance` via a request object, either of type
|
1441
|
+
# {::Google::Cloud::AlloyDB::V1::CreateSecondaryInstanceRequest} or an equivalent Hash.
|
1209
1442
|
#
|
1210
|
-
# @param request [::Google::Cloud::AlloyDB::V1::
|
1443
|
+
# @param request [::Google::Cloud::AlloyDB::V1::CreateSecondaryInstanceRequest, ::Hash]
|
1211
1444
|
# A request object representing the call parameters. Required. To specify no
|
1212
1445
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1213
1446
|
# @param options [::Gapic::CallOptions, ::Hash]
|
1214
1447
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1215
1448
|
#
|
1216
|
-
# @overload
|
1217
|
-
# Pass arguments to `
|
1449
|
+
# @overload create_secondary_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: nil)
|
1450
|
+
# Pass arguments to `create_secondary_instance` via keyword arguments. Note that at
|
1218
1451
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
1219
1452
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1220
1453
|
#
|
1221
1454
|
# @param parent [::String]
|
1222
|
-
# Required. The name of the parent resource.
|
1223
|
-
#
|
1224
|
-
#
|
1455
|
+
# Required. The name of the parent resource. For the required format, see the
|
1456
|
+
# comment on the Instance.name field.
|
1457
|
+
# @param instance_id [::String]
|
1458
|
+
# Required. ID of the requesting object.
|
1459
|
+
# @param instance [::Google::Cloud::AlloyDB::V1::Instance, ::Hash]
|
1460
|
+
# Required. The resource being created
|
1225
1461
|
# @param request_id [::String]
|
1226
1462
|
# Optional. An optional request ID to identify requests. Specify a unique
|
1227
1463
|
# request ID so that if you must retry your request, the server will know to
|
@@ -1236,6 +1472,10 @@ module Google
|
|
1236
1472
|
#
|
1237
1473
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
1238
1474
|
# not supported (00000000-0000-0000-0000-000000000000).
|
1475
|
+
# @param validate_only [::Boolean]
|
1476
|
+
# Optional. If set, performs request validation (e.g. permission checks and
|
1477
|
+
# any other type of validation), but do not actually execute the create
|
1478
|
+
# request.
|
1239
1479
|
#
|
1240
1480
|
# @yield [response, operation] Access the result along with the RPC operation
|
1241
1481
|
# @yieldparam response [::Gapic::Operation]
|
@@ -1252,10 +1492,10 @@ module Google
|
|
1252
1492
|
# client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new
|
1253
1493
|
#
|
1254
1494
|
# # Create a request. To set request fields, pass in keyword arguments.
|
1255
|
-
# request = Google::Cloud::AlloyDB::V1::
|
1495
|
+
# request = Google::Cloud::AlloyDB::V1::CreateSecondaryInstanceRequest.new
|
1256
1496
|
#
|
1257
|
-
# # Call the
|
1258
|
-
# result = client.
|
1497
|
+
# # Call the create_secondary_instance method.
|
1498
|
+
# result = client.create_secondary_instance request
|
1259
1499
|
#
|
1260
1500
|
# # The returned object is of type Gapic::Operation. You can use it to
|
1261
1501
|
# # check the status of an operation, cancel it, or wait for results.
|
@@ -1267,16 +1507,16 @@ module Google
|
|
1267
1507
|
# puts "No response received."
|
1268
1508
|
# end
|
1269
1509
|
#
|
1270
|
-
def
|
1510
|
+
def create_secondary_instance request, options = nil
|
1271
1511
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1272
1512
|
|
1273
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::
|
1513
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::CreateSecondaryInstanceRequest
|
1274
1514
|
|
1275
1515
|
# Converts hash and nil to an options object
|
1276
1516
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1277
1517
|
|
1278
1518
|
# Customize the options with defaults
|
1279
|
-
metadata = @config.rpcs.
|
1519
|
+
metadata = @config.rpcs.create_secondary_instance.metadata.to_h
|
1280
1520
|
|
1281
1521
|
# Set x-goog-api-client and x-goog-user-project headers
|
1282
1522
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -1292,15 +1532,15 @@ module Google
|
|
1292
1532
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1293
1533
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1294
1534
|
|
1295
|
-
options.apply_defaults timeout: @config.rpcs.
|
1535
|
+
options.apply_defaults timeout: @config.rpcs.create_secondary_instance.timeout,
|
1296
1536
|
metadata: metadata,
|
1297
|
-
retry_policy: @config.rpcs.
|
1537
|
+
retry_policy: @config.rpcs.create_secondary_instance.retry_policy
|
1298
1538
|
|
1299
1539
|
options.apply_defaults timeout: @config.timeout,
|
1300
1540
|
metadata: @config.metadata,
|
1301
1541
|
retry_policy: @config.retry_policy
|
1302
1542
|
|
1303
|
-
@alloy_db_admin_stub.call_rpc :
|
1543
|
+
@alloy_db_admin_stub.call_rpc :create_secondary_instance, request, options: options do |response, operation|
|
1304
1544
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1305
1545
|
yield response, operation if block_given?
|
1306
1546
|
return response
|
@@ -1310,21 +1550,139 @@ module Google
|
|
1310
1550
|
end
|
1311
1551
|
|
1312
1552
|
##
|
1313
|
-
#
|
1553
|
+
# Creates new instances under the given project, location and cluster.
|
1554
|
+
# There can be only one primary instance in a cluster. If the primary
|
1555
|
+
# instance exists in the cluster as well as this request, then API will
|
1556
|
+
# throw an error.
|
1557
|
+
# The primary instance should exist before any read pool instance is
|
1558
|
+
# created. If the primary instance is a part of the request payload, then
|
1559
|
+
# the API will take care of creating instances in the correct order.
|
1560
|
+
# This method is here to support Google-internal use cases, and is not meant
|
1561
|
+
# for external customers to consume. Please do not start relying on it; its
|
1562
|
+
# behavior is subject to change without notice.
|
1314
1563
|
#
|
1315
|
-
# @overload
|
1316
|
-
# Pass arguments to `
|
1317
|
-
# {::Google::Cloud::AlloyDB::V1::
|
1564
|
+
# @overload batch_create_instances(request, options = nil)
|
1565
|
+
# Pass arguments to `batch_create_instances` via a request object, either of type
|
1566
|
+
# {::Google::Cloud::AlloyDB::V1::BatchCreateInstancesRequest} or an equivalent Hash.
|
1318
1567
|
#
|
1319
|
-
# @param request [::Google::Cloud::AlloyDB::V1::
|
1568
|
+
# @param request [::Google::Cloud::AlloyDB::V1::BatchCreateInstancesRequest, ::Hash]
|
1320
1569
|
# A request object representing the call parameters. Required. To specify no
|
1321
1570
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1322
1571
|
# @param options [::Gapic::CallOptions, ::Hash]
|
1323
1572
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1324
1573
|
#
|
1325
|
-
# @overload
|
1326
|
-
# Pass arguments to `
|
1327
|
-
# least one keyword argument is required. To specify no parameters, or to keep all
|
1574
|
+
# @overload batch_create_instances(parent: nil, requests: nil, request_id: nil)
|
1575
|
+
# Pass arguments to `batch_create_instances` via keyword arguments. Note that at
|
1576
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1577
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1578
|
+
#
|
1579
|
+
# @param parent [::String]
|
1580
|
+
# Required. The name of the parent resource.
|
1581
|
+
# @param requests [::Google::Cloud::AlloyDB::V1::CreateInstanceRequests, ::Hash]
|
1582
|
+
# Required. Resources being created.
|
1583
|
+
# @param request_id [::String]
|
1584
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
1585
|
+
# request ID so that if you must retry your request, the server will know to
|
1586
|
+
# ignore the request if it has already been completed. The server will
|
1587
|
+
# guarantee that for at least 60 minutes since the first request.
|
1588
|
+
#
|
1589
|
+
# For example, consider a situation where you make an initial request and
|
1590
|
+
# the request times out. If you make the request again with the same request
|
1591
|
+
# ID, the server can check if original operation with the same request ID
|
1592
|
+
# was received, and if so, will ignore the second request. This prevents
|
1593
|
+
# clients from accidentally creating duplicate commitments.
|
1594
|
+
#
|
1595
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
1596
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
1597
|
+
#
|
1598
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1599
|
+
# @yieldparam response [::Gapic::Operation]
|
1600
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1601
|
+
#
|
1602
|
+
# @return [::Gapic::Operation]
|
1603
|
+
#
|
1604
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1605
|
+
#
|
1606
|
+
# @example Basic example
|
1607
|
+
# require "google/cloud/alloy_db/v1"
|
1608
|
+
#
|
1609
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1610
|
+
# client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new
|
1611
|
+
#
|
1612
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1613
|
+
# request = Google::Cloud::AlloyDB::V1::BatchCreateInstancesRequest.new
|
1614
|
+
#
|
1615
|
+
# # Call the batch_create_instances method.
|
1616
|
+
# result = client.batch_create_instances request
|
1617
|
+
#
|
1618
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1619
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1620
|
+
# # Here is how to wait for a response.
|
1621
|
+
# result.wait_until_done! timeout: 60
|
1622
|
+
# if result.response?
|
1623
|
+
# p result.response
|
1624
|
+
# else
|
1625
|
+
# puts "No response received."
|
1626
|
+
# end
|
1627
|
+
#
|
1628
|
+
def batch_create_instances request, options = nil
|
1629
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1630
|
+
|
1631
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::BatchCreateInstancesRequest
|
1632
|
+
|
1633
|
+
# Converts hash and nil to an options object
|
1634
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1635
|
+
|
1636
|
+
# Customize the options with defaults
|
1637
|
+
metadata = @config.rpcs.batch_create_instances.metadata.to_h
|
1638
|
+
|
1639
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1640
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1641
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1642
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION
|
1643
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1644
|
+
|
1645
|
+
header_params = {}
|
1646
|
+
if request.parent
|
1647
|
+
header_params["parent"] = request.parent
|
1648
|
+
end
|
1649
|
+
|
1650
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1651
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1652
|
+
|
1653
|
+
options.apply_defaults timeout: @config.rpcs.batch_create_instances.timeout,
|
1654
|
+
metadata: metadata,
|
1655
|
+
retry_policy: @config.rpcs.batch_create_instances.retry_policy
|
1656
|
+
|
1657
|
+
options.apply_defaults timeout: @config.timeout,
|
1658
|
+
metadata: @config.metadata,
|
1659
|
+
retry_policy: @config.retry_policy
|
1660
|
+
|
1661
|
+
@alloy_db_admin_stub.call_rpc :batch_create_instances, request, options: options do |response, operation|
|
1662
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1663
|
+
yield response, operation if block_given?
|
1664
|
+
return response
|
1665
|
+
end
|
1666
|
+
rescue ::GRPC::BadStatus => e
|
1667
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1668
|
+
end
|
1669
|
+
|
1670
|
+
##
|
1671
|
+
# Updates the parameters of a single Instance.
|
1672
|
+
#
|
1673
|
+
# @overload update_instance(request, options = nil)
|
1674
|
+
# Pass arguments to `update_instance` via a request object, either of type
|
1675
|
+
# {::Google::Cloud::AlloyDB::V1::UpdateInstanceRequest} or an equivalent Hash.
|
1676
|
+
#
|
1677
|
+
# @param request [::Google::Cloud::AlloyDB::V1::UpdateInstanceRequest, ::Hash]
|
1678
|
+
# A request object representing the call parameters. Required. To specify no
|
1679
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1680
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1681
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1682
|
+
#
|
1683
|
+
# @overload update_instance(update_mask: nil, instance: nil, request_id: nil, validate_only: nil, allow_missing: nil)
|
1684
|
+
# Pass arguments to `update_instance` via keyword arguments. Note that at
|
1685
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1328
1686
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1329
1687
|
#
|
1330
1688
|
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
@@ -1657,6 +2015,121 @@ module Google
|
|
1657
2015
|
raise ::Google::Cloud::Error.from_error(e)
|
1658
2016
|
end
|
1659
2017
|
|
2018
|
+
##
|
2019
|
+
# Injects fault in an instance.
|
2020
|
+
# Imperative only.
|
2021
|
+
#
|
2022
|
+
# @overload inject_fault(request, options = nil)
|
2023
|
+
# Pass arguments to `inject_fault` via a request object, either of type
|
2024
|
+
# {::Google::Cloud::AlloyDB::V1::InjectFaultRequest} or an equivalent Hash.
|
2025
|
+
#
|
2026
|
+
# @param request [::Google::Cloud::AlloyDB::V1::InjectFaultRequest, ::Hash]
|
2027
|
+
# A request object representing the call parameters. Required. To specify no
|
2028
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2029
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2030
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2031
|
+
#
|
2032
|
+
# @overload inject_fault(fault_type: nil, name: nil, request_id: nil, validate_only: nil)
|
2033
|
+
# Pass arguments to `inject_fault` via keyword arguments. Note that at
|
2034
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2035
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2036
|
+
#
|
2037
|
+
# @param fault_type [::Google::Cloud::AlloyDB::V1::InjectFaultRequest::FaultType]
|
2038
|
+
# Required. The type of fault to be injected in an instance.
|
2039
|
+
# @param name [::String]
|
2040
|
+
# Required. The name of the resource. For the required format, see the
|
2041
|
+
# comment on the Instance.name field.
|
2042
|
+
# @param request_id [::String]
|
2043
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
2044
|
+
# request ID so that if you must retry your request, the server will know to
|
2045
|
+
# ignore the request if it has already been completed. The server will
|
2046
|
+
# guarantee that for at least 60 minutes after the first request.
|
2047
|
+
#
|
2048
|
+
# For example, consider a situation where you make an initial request and
|
2049
|
+
# the request times out. If you make the request again with the same request
|
2050
|
+
# ID, the server can check if original operation with the same request ID
|
2051
|
+
# was received, and if so, will ignore the second request. This prevents
|
2052
|
+
# clients from accidentally creating duplicate commitments.
|
2053
|
+
#
|
2054
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
2055
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
2056
|
+
# @param validate_only [::Boolean]
|
2057
|
+
# Optional. If set, performs request validation (e.g. permission checks and
|
2058
|
+
# any other type of validation), but do not actually execute the fault
|
2059
|
+
# injection.
|
2060
|
+
#
|
2061
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2062
|
+
# @yieldparam response [::Gapic::Operation]
|
2063
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2064
|
+
#
|
2065
|
+
# @return [::Gapic::Operation]
|
2066
|
+
#
|
2067
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2068
|
+
#
|
2069
|
+
# @example Basic example
|
2070
|
+
# require "google/cloud/alloy_db/v1"
|
2071
|
+
#
|
2072
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2073
|
+
# client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new
|
2074
|
+
#
|
2075
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2076
|
+
# request = Google::Cloud::AlloyDB::V1::InjectFaultRequest.new
|
2077
|
+
#
|
2078
|
+
# # Call the inject_fault method.
|
2079
|
+
# result = client.inject_fault request
|
2080
|
+
#
|
2081
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2082
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2083
|
+
# # Here is how to wait for a response.
|
2084
|
+
# result.wait_until_done! timeout: 60
|
2085
|
+
# if result.response?
|
2086
|
+
# p result.response
|
2087
|
+
# else
|
2088
|
+
# puts "No response received."
|
2089
|
+
# end
|
2090
|
+
#
|
2091
|
+
def inject_fault request, options = nil
|
2092
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2093
|
+
|
2094
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::InjectFaultRequest
|
2095
|
+
|
2096
|
+
# Converts hash and nil to an options object
|
2097
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2098
|
+
|
2099
|
+
# Customize the options with defaults
|
2100
|
+
metadata = @config.rpcs.inject_fault.metadata.to_h
|
2101
|
+
|
2102
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2103
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2104
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2105
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION
|
2106
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2107
|
+
|
2108
|
+
header_params = {}
|
2109
|
+
if request.name
|
2110
|
+
header_params["name"] = request.name
|
2111
|
+
end
|
2112
|
+
|
2113
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2114
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2115
|
+
|
2116
|
+
options.apply_defaults timeout: @config.rpcs.inject_fault.timeout,
|
2117
|
+
metadata: metadata,
|
2118
|
+
retry_policy: @config.rpcs.inject_fault.retry_policy
|
2119
|
+
|
2120
|
+
options.apply_defaults timeout: @config.timeout,
|
2121
|
+
metadata: @config.metadata,
|
2122
|
+
retry_policy: @config.retry_policy
|
2123
|
+
|
2124
|
+
@alloy_db_admin_stub.call_rpc :inject_fault, request, options: options do |response, operation|
|
2125
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2126
|
+
yield response, operation if block_given?
|
2127
|
+
return response
|
2128
|
+
end
|
2129
|
+
rescue ::GRPC::BadStatus => e
|
2130
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2131
|
+
end
|
2132
|
+
|
1660
2133
|
##
|
1661
2134
|
# Restart an Instance in a cluster.
|
1662
2135
|
# Imperative only.
|
@@ -2403,44 +2876,548 @@ module Google
|
|
2403
2876
|
end
|
2404
2877
|
|
2405
2878
|
##
|
2406
|
-
#
|
2879
|
+
# Lists Users in a given project and location.
|
2407
2880
|
#
|
2408
|
-
#
|
2409
|
-
#
|
2410
|
-
#
|
2411
|
-
# applied individually to specific RPCs. See
|
2412
|
-
# {::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client::Configuration::Rpcs}
|
2413
|
-
# for a list of RPCs that can be configured independently.
|
2881
|
+
# @overload list_users(request, options = nil)
|
2882
|
+
# Pass arguments to `list_users` via a request object, either of type
|
2883
|
+
# {::Google::Cloud::AlloyDB::V1::ListUsersRequest} or an equivalent Hash.
|
2414
2884
|
#
|
2415
|
-
#
|
2416
|
-
#
|
2885
|
+
# @param request [::Google::Cloud::AlloyDB::V1::ListUsersRequest, ::Hash]
|
2886
|
+
# A request object representing the call parameters. Required. To specify no
|
2887
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2888
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2889
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2417
2890
|
#
|
2418
|
-
# @
|
2891
|
+
# @overload list_users(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
2892
|
+
# Pass arguments to `list_users` via keyword arguments. Note that at
|
2893
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2894
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2419
2895
|
#
|
2420
|
-
#
|
2421
|
-
#
|
2422
|
-
#
|
2423
|
-
#
|
2424
|
-
#
|
2425
|
-
#
|
2426
|
-
#
|
2896
|
+
# @param parent [::String]
|
2897
|
+
# Required. Parent value for ListUsersRequest
|
2898
|
+
# @param page_size [::Integer]
|
2899
|
+
# Optional. Requested page size. Server may return fewer items than
|
2900
|
+
# requested. If unspecified, server will pick an appropriate default.
|
2901
|
+
# @param page_token [::String]
|
2902
|
+
# Optional. A token identifying a page of results the server should return.
|
2903
|
+
# @param filter [::String]
|
2904
|
+
# Optional. Filtering results
|
2905
|
+
# @param order_by [::String]
|
2906
|
+
# Optional. Hint for how to order the results
|
2427
2907
|
#
|
2428
|
-
#
|
2429
|
-
#
|
2430
|
-
#
|
2431
|
-
# config.rpcs.list_clusters.timeout = 20.0
|
2432
|
-
# end
|
2908
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2909
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1::User>]
|
2910
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2433
2911
|
#
|
2434
|
-
#
|
2435
|
-
#
|
2436
|
-
#
|
2437
|
-
#
|
2438
|
-
#
|
2439
|
-
#
|
2440
|
-
#
|
2441
|
-
#
|
2442
|
-
#
|
2443
|
-
#
|
2912
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1::User>]
|
2913
|
+
#
|
2914
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2915
|
+
#
|
2916
|
+
# @example Basic example
|
2917
|
+
# require "google/cloud/alloy_db/v1"
|
2918
|
+
#
|
2919
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2920
|
+
# client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new
|
2921
|
+
#
|
2922
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2923
|
+
# request = Google::Cloud::AlloyDB::V1::ListUsersRequest.new
|
2924
|
+
#
|
2925
|
+
# # Call the list_users method.
|
2926
|
+
# result = client.list_users request
|
2927
|
+
#
|
2928
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
2929
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
2930
|
+
# result.each do |item|
|
2931
|
+
# # Each element is of type ::Google::Cloud::AlloyDB::V1::User.
|
2932
|
+
# p item
|
2933
|
+
# end
|
2934
|
+
#
|
2935
|
+
def list_users request, options = nil
|
2936
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2937
|
+
|
2938
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::ListUsersRequest
|
2939
|
+
|
2940
|
+
# Converts hash and nil to an options object
|
2941
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2942
|
+
|
2943
|
+
# Customize the options with defaults
|
2944
|
+
metadata = @config.rpcs.list_users.metadata.to_h
|
2945
|
+
|
2946
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2947
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2948
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2949
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION
|
2950
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2951
|
+
|
2952
|
+
header_params = {}
|
2953
|
+
if request.parent
|
2954
|
+
header_params["parent"] = request.parent
|
2955
|
+
end
|
2956
|
+
|
2957
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2958
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2959
|
+
|
2960
|
+
options.apply_defaults timeout: @config.rpcs.list_users.timeout,
|
2961
|
+
metadata: metadata,
|
2962
|
+
retry_policy: @config.rpcs.list_users.retry_policy
|
2963
|
+
|
2964
|
+
options.apply_defaults timeout: @config.timeout,
|
2965
|
+
metadata: @config.metadata,
|
2966
|
+
retry_policy: @config.retry_policy
|
2967
|
+
|
2968
|
+
@alloy_db_admin_stub.call_rpc :list_users, request, options: options do |response, operation|
|
2969
|
+
response = ::Gapic::PagedEnumerable.new @alloy_db_admin_stub, :list_users, request, response, operation, options
|
2970
|
+
yield response, operation if block_given?
|
2971
|
+
return response
|
2972
|
+
end
|
2973
|
+
rescue ::GRPC::BadStatus => e
|
2974
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2975
|
+
end
|
2976
|
+
|
2977
|
+
##
|
2978
|
+
# Gets details of a single User.
|
2979
|
+
#
|
2980
|
+
# @overload get_user(request, options = nil)
|
2981
|
+
# Pass arguments to `get_user` via a request object, either of type
|
2982
|
+
# {::Google::Cloud::AlloyDB::V1::GetUserRequest} or an equivalent Hash.
|
2983
|
+
#
|
2984
|
+
# @param request [::Google::Cloud::AlloyDB::V1::GetUserRequest, ::Hash]
|
2985
|
+
# A request object representing the call parameters. Required. To specify no
|
2986
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2987
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2988
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2989
|
+
#
|
2990
|
+
# @overload get_user(name: nil)
|
2991
|
+
# Pass arguments to `get_user` via keyword arguments. Note that at
|
2992
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2993
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2994
|
+
#
|
2995
|
+
# @param name [::String]
|
2996
|
+
# Required. The name of the resource. For the required format, see the
|
2997
|
+
# comment on the User.name field.
|
2998
|
+
#
|
2999
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
3000
|
+
# @yieldparam response [::Google::Cloud::AlloyDB::V1::User]
|
3001
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
3002
|
+
#
|
3003
|
+
# @return [::Google::Cloud::AlloyDB::V1::User]
|
3004
|
+
#
|
3005
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
3006
|
+
#
|
3007
|
+
# @example Basic example
|
3008
|
+
# require "google/cloud/alloy_db/v1"
|
3009
|
+
#
|
3010
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3011
|
+
# client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new
|
3012
|
+
#
|
3013
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3014
|
+
# request = Google::Cloud::AlloyDB::V1::GetUserRequest.new
|
3015
|
+
#
|
3016
|
+
# # Call the get_user method.
|
3017
|
+
# result = client.get_user request
|
3018
|
+
#
|
3019
|
+
# # The returned object is of type Google::Cloud::AlloyDB::V1::User.
|
3020
|
+
# p result
|
3021
|
+
#
|
3022
|
+
def get_user request, options = nil
|
3023
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3024
|
+
|
3025
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::GetUserRequest
|
3026
|
+
|
3027
|
+
# Converts hash and nil to an options object
|
3028
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3029
|
+
|
3030
|
+
# Customize the options with defaults
|
3031
|
+
metadata = @config.rpcs.get_user.metadata.to_h
|
3032
|
+
|
3033
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
3034
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3035
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3036
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION
|
3037
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3038
|
+
|
3039
|
+
header_params = {}
|
3040
|
+
if request.name
|
3041
|
+
header_params["name"] = request.name
|
3042
|
+
end
|
3043
|
+
|
3044
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
3045
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
3046
|
+
|
3047
|
+
options.apply_defaults timeout: @config.rpcs.get_user.timeout,
|
3048
|
+
metadata: metadata,
|
3049
|
+
retry_policy: @config.rpcs.get_user.retry_policy
|
3050
|
+
|
3051
|
+
options.apply_defaults timeout: @config.timeout,
|
3052
|
+
metadata: @config.metadata,
|
3053
|
+
retry_policy: @config.retry_policy
|
3054
|
+
|
3055
|
+
@alloy_db_admin_stub.call_rpc :get_user, request, options: options do |response, operation|
|
3056
|
+
yield response, operation if block_given?
|
3057
|
+
return response
|
3058
|
+
end
|
3059
|
+
rescue ::GRPC::BadStatus => e
|
3060
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3061
|
+
end
|
3062
|
+
|
3063
|
+
##
|
3064
|
+
# Creates a new User in a given project, location, and cluster.
|
3065
|
+
#
|
3066
|
+
# @overload create_user(request, options = nil)
|
3067
|
+
# Pass arguments to `create_user` via a request object, either of type
|
3068
|
+
# {::Google::Cloud::AlloyDB::V1::CreateUserRequest} or an equivalent Hash.
|
3069
|
+
#
|
3070
|
+
# @param request [::Google::Cloud::AlloyDB::V1::CreateUserRequest, ::Hash]
|
3071
|
+
# A request object representing the call parameters. Required. To specify no
|
3072
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3073
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3074
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
3075
|
+
#
|
3076
|
+
# @overload create_user(parent: nil, user_id: nil, user: nil, request_id: nil, validate_only: nil)
|
3077
|
+
# Pass arguments to `create_user` via keyword arguments. Note that at
|
3078
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3079
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3080
|
+
#
|
3081
|
+
# @param parent [::String]
|
3082
|
+
# Required. Value for parent.
|
3083
|
+
# @param user_id [::String]
|
3084
|
+
# Required. ID of the requesting object.
|
3085
|
+
# @param user [::Google::Cloud::AlloyDB::V1::User, ::Hash]
|
3086
|
+
# Required. The resource being created
|
3087
|
+
# @param request_id [::String]
|
3088
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
3089
|
+
# request ID so that if you must retry your request, the server will know to
|
3090
|
+
# ignore the request if it has already been completed. The server will
|
3091
|
+
# guarantee that for at least 60 minutes since the first request.
|
3092
|
+
#
|
3093
|
+
# For example, consider a situation where you make an initial request and
|
3094
|
+
# the request times out. If you make the request again with the same request
|
3095
|
+
# ID, the server can check if original operation with the same request ID
|
3096
|
+
# was received, and if so, will ignore the second request. This prevents
|
3097
|
+
# clients from accidentally creating duplicate commitments.
|
3098
|
+
#
|
3099
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
3100
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
3101
|
+
# @param validate_only [::Boolean]
|
3102
|
+
# Optional. If set, the backend validates the request, but doesn't actually
|
3103
|
+
# execute it.
|
3104
|
+
#
|
3105
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
3106
|
+
# @yieldparam response [::Google::Cloud::AlloyDB::V1::User]
|
3107
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
3108
|
+
#
|
3109
|
+
# @return [::Google::Cloud::AlloyDB::V1::User]
|
3110
|
+
#
|
3111
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
3112
|
+
#
|
3113
|
+
# @example Basic example
|
3114
|
+
# require "google/cloud/alloy_db/v1"
|
3115
|
+
#
|
3116
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3117
|
+
# client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new
|
3118
|
+
#
|
3119
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3120
|
+
# request = Google::Cloud::AlloyDB::V1::CreateUserRequest.new
|
3121
|
+
#
|
3122
|
+
# # Call the create_user method.
|
3123
|
+
# result = client.create_user request
|
3124
|
+
#
|
3125
|
+
# # The returned object is of type Google::Cloud::AlloyDB::V1::User.
|
3126
|
+
# p result
|
3127
|
+
#
|
3128
|
+
def create_user request, options = nil
|
3129
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3130
|
+
|
3131
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::CreateUserRequest
|
3132
|
+
|
3133
|
+
# Converts hash and nil to an options object
|
3134
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3135
|
+
|
3136
|
+
# Customize the options with defaults
|
3137
|
+
metadata = @config.rpcs.create_user.metadata.to_h
|
3138
|
+
|
3139
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
3140
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3141
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3142
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION
|
3143
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3144
|
+
|
3145
|
+
header_params = {}
|
3146
|
+
if request.parent
|
3147
|
+
header_params["parent"] = request.parent
|
3148
|
+
end
|
3149
|
+
|
3150
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
3151
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
3152
|
+
|
3153
|
+
options.apply_defaults timeout: @config.rpcs.create_user.timeout,
|
3154
|
+
metadata: metadata,
|
3155
|
+
retry_policy: @config.rpcs.create_user.retry_policy
|
3156
|
+
|
3157
|
+
options.apply_defaults timeout: @config.timeout,
|
3158
|
+
metadata: @config.metadata,
|
3159
|
+
retry_policy: @config.retry_policy
|
3160
|
+
|
3161
|
+
@alloy_db_admin_stub.call_rpc :create_user, request, options: options do |response, operation|
|
3162
|
+
yield response, operation if block_given?
|
3163
|
+
return response
|
3164
|
+
end
|
3165
|
+
rescue ::GRPC::BadStatus => e
|
3166
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3167
|
+
end
|
3168
|
+
|
3169
|
+
##
|
3170
|
+
# Updates the parameters of a single User.
|
3171
|
+
#
|
3172
|
+
# @overload update_user(request, options = nil)
|
3173
|
+
# Pass arguments to `update_user` via a request object, either of type
|
3174
|
+
# {::Google::Cloud::AlloyDB::V1::UpdateUserRequest} or an equivalent Hash.
|
3175
|
+
#
|
3176
|
+
# @param request [::Google::Cloud::AlloyDB::V1::UpdateUserRequest, ::Hash]
|
3177
|
+
# A request object representing the call parameters. Required. To specify no
|
3178
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3179
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3180
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
3181
|
+
#
|
3182
|
+
# @overload update_user(update_mask: nil, user: nil, request_id: nil, validate_only: nil, allow_missing: nil)
|
3183
|
+
# Pass arguments to `update_user` via keyword arguments. Note that at
|
3184
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3185
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3186
|
+
#
|
3187
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
3188
|
+
# Optional. Field mask is used to specify the fields to be overwritten in the
|
3189
|
+
# User resource by the update.
|
3190
|
+
# The fields specified in the update_mask are relative to the resource, not
|
3191
|
+
# the full request. A field will be overwritten if it is in the mask. If the
|
3192
|
+
# user does not provide a mask then all fields will be overwritten.
|
3193
|
+
# @param user [::Google::Cloud::AlloyDB::V1::User, ::Hash]
|
3194
|
+
# Required. The resource being updated
|
3195
|
+
# @param request_id [::String]
|
3196
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
3197
|
+
# request ID so that if you must retry your request, the server will know to
|
3198
|
+
# ignore the request if it has already been completed. The server will
|
3199
|
+
# guarantee that for at least 60 minutes since the first request.
|
3200
|
+
#
|
3201
|
+
# For example, consider a situation where you make an initial request and
|
3202
|
+
# the request times out. If you make the request again with the same request
|
3203
|
+
# ID, the server can check if original operation with the same request ID
|
3204
|
+
# was received, and if so, will ignore the second request. This prevents
|
3205
|
+
# clients from accidentally creating duplicate commitments.
|
3206
|
+
#
|
3207
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
3208
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
3209
|
+
# @param validate_only [::Boolean]
|
3210
|
+
# Optional. If set, the backend validates the request, but doesn't actually
|
3211
|
+
# execute it.
|
3212
|
+
# @param allow_missing [::Boolean]
|
3213
|
+
# Optional. Allow missing fields in the update mask.
|
3214
|
+
#
|
3215
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
3216
|
+
# @yieldparam response [::Google::Cloud::AlloyDB::V1::User]
|
3217
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
3218
|
+
#
|
3219
|
+
# @return [::Google::Cloud::AlloyDB::V1::User]
|
3220
|
+
#
|
3221
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
3222
|
+
#
|
3223
|
+
# @example Basic example
|
3224
|
+
# require "google/cloud/alloy_db/v1"
|
3225
|
+
#
|
3226
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3227
|
+
# client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new
|
3228
|
+
#
|
3229
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3230
|
+
# request = Google::Cloud::AlloyDB::V1::UpdateUserRequest.new
|
3231
|
+
#
|
3232
|
+
# # Call the update_user method.
|
3233
|
+
# result = client.update_user request
|
3234
|
+
#
|
3235
|
+
# # The returned object is of type Google::Cloud::AlloyDB::V1::User.
|
3236
|
+
# p result
|
3237
|
+
#
|
3238
|
+
def update_user request, options = nil
|
3239
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3240
|
+
|
3241
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::UpdateUserRequest
|
3242
|
+
|
3243
|
+
# Converts hash and nil to an options object
|
3244
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3245
|
+
|
3246
|
+
# Customize the options with defaults
|
3247
|
+
metadata = @config.rpcs.update_user.metadata.to_h
|
3248
|
+
|
3249
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
3250
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3251
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3252
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION
|
3253
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3254
|
+
|
3255
|
+
header_params = {}
|
3256
|
+
if request.user&.name
|
3257
|
+
header_params["user.name"] = request.user.name
|
3258
|
+
end
|
3259
|
+
|
3260
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
3261
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
3262
|
+
|
3263
|
+
options.apply_defaults timeout: @config.rpcs.update_user.timeout,
|
3264
|
+
metadata: metadata,
|
3265
|
+
retry_policy: @config.rpcs.update_user.retry_policy
|
3266
|
+
|
3267
|
+
options.apply_defaults timeout: @config.timeout,
|
3268
|
+
metadata: @config.metadata,
|
3269
|
+
retry_policy: @config.retry_policy
|
3270
|
+
|
3271
|
+
@alloy_db_admin_stub.call_rpc :update_user, request, options: options do |response, operation|
|
3272
|
+
yield response, operation if block_given?
|
3273
|
+
return response
|
3274
|
+
end
|
3275
|
+
rescue ::GRPC::BadStatus => e
|
3276
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3277
|
+
end
|
3278
|
+
|
3279
|
+
##
|
3280
|
+
# Deletes a single User.
|
3281
|
+
#
|
3282
|
+
# @overload delete_user(request, options = nil)
|
3283
|
+
# Pass arguments to `delete_user` via a request object, either of type
|
3284
|
+
# {::Google::Cloud::AlloyDB::V1::DeleteUserRequest} or an equivalent Hash.
|
3285
|
+
#
|
3286
|
+
# @param request [::Google::Cloud::AlloyDB::V1::DeleteUserRequest, ::Hash]
|
3287
|
+
# A request object representing the call parameters. Required. To specify no
|
3288
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3289
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3290
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
3291
|
+
#
|
3292
|
+
# @overload delete_user(name: nil, request_id: nil, validate_only: nil)
|
3293
|
+
# Pass arguments to `delete_user` via keyword arguments. Note that at
|
3294
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3295
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3296
|
+
#
|
3297
|
+
# @param name [::String]
|
3298
|
+
# Required. The name of the resource. For the required format, see the
|
3299
|
+
# comment on the User.name field.
|
3300
|
+
# @param request_id [::String]
|
3301
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
3302
|
+
# request ID so that if you must retry your request, the server will know to
|
3303
|
+
# ignore the request if it has already been completed. The server will
|
3304
|
+
# guarantee that for at least 60 minutes after the first request.
|
3305
|
+
#
|
3306
|
+
# For example, consider a situation where you make an initial request and
|
3307
|
+
# the request times out. If you make the request again with the same request
|
3308
|
+
# ID, the server can check if original operation with the same request ID
|
3309
|
+
# was received, and if so, will ignore the second request. This prevents
|
3310
|
+
# clients from accidentally creating duplicate commitments.
|
3311
|
+
#
|
3312
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
3313
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
3314
|
+
# @param validate_only [::Boolean]
|
3315
|
+
# Optional. If set, the backend validates the request, but doesn't actually
|
3316
|
+
# execute it.
|
3317
|
+
#
|
3318
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
3319
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
3320
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
3321
|
+
#
|
3322
|
+
# @return [::Google::Protobuf::Empty]
|
3323
|
+
#
|
3324
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
3325
|
+
#
|
3326
|
+
# @example Basic example
|
3327
|
+
# require "google/cloud/alloy_db/v1"
|
3328
|
+
#
|
3329
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3330
|
+
# client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new
|
3331
|
+
#
|
3332
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3333
|
+
# request = Google::Cloud::AlloyDB::V1::DeleteUserRequest.new
|
3334
|
+
#
|
3335
|
+
# # Call the delete_user method.
|
3336
|
+
# result = client.delete_user request
|
3337
|
+
#
|
3338
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
3339
|
+
# p result
|
3340
|
+
#
|
3341
|
+
def delete_user request, options = nil
|
3342
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3343
|
+
|
3344
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::DeleteUserRequest
|
3345
|
+
|
3346
|
+
# Converts hash and nil to an options object
|
3347
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3348
|
+
|
3349
|
+
# Customize the options with defaults
|
3350
|
+
metadata = @config.rpcs.delete_user.metadata.to_h
|
3351
|
+
|
3352
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
3353
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3354
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3355
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION
|
3356
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3357
|
+
|
3358
|
+
header_params = {}
|
3359
|
+
if request.name
|
3360
|
+
header_params["name"] = request.name
|
3361
|
+
end
|
3362
|
+
|
3363
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
3364
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
3365
|
+
|
3366
|
+
options.apply_defaults timeout: @config.rpcs.delete_user.timeout,
|
3367
|
+
metadata: metadata,
|
3368
|
+
retry_policy: @config.rpcs.delete_user.retry_policy
|
3369
|
+
|
3370
|
+
options.apply_defaults timeout: @config.timeout,
|
3371
|
+
metadata: @config.metadata,
|
3372
|
+
retry_policy: @config.retry_policy
|
3373
|
+
|
3374
|
+
@alloy_db_admin_stub.call_rpc :delete_user, request, options: options do |response, operation|
|
3375
|
+
yield response, operation if block_given?
|
3376
|
+
return response
|
3377
|
+
end
|
3378
|
+
rescue ::GRPC::BadStatus => e
|
3379
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3380
|
+
end
|
3381
|
+
|
3382
|
+
##
|
3383
|
+
# Configuration class for the AlloyDBAdmin API.
|
3384
|
+
#
|
3385
|
+
# This class represents the configuration for AlloyDBAdmin,
|
3386
|
+
# providing control over timeouts, retry behavior, logging, transport
|
3387
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
3388
|
+
# applied individually to specific RPCs. See
|
3389
|
+
# {::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client::Configuration::Rpcs}
|
3390
|
+
# for a list of RPCs that can be configured independently.
|
3391
|
+
#
|
3392
|
+
# Configuration can be applied globally to all clients, or to a single client
|
3393
|
+
# on construction.
|
3394
|
+
#
|
3395
|
+
# @example
|
3396
|
+
#
|
3397
|
+
# # Modify the global config, setting the timeout for
|
3398
|
+
# # list_clusters to 20 seconds,
|
3399
|
+
# # and all remaining timeouts to 10 seconds.
|
3400
|
+
# ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.configure do |config|
|
3401
|
+
# config.timeout = 10.0
|
3402
|
+
# config.rpcs.list_clusters.timeout = 20.0
|
3403
|
+
# end
|
3404
|
+
#
|
3405
|
+
# # Apply the above configuration only to a new client.
|
3406
|
+
# client = ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new do |config|
|
3407
|
+
# config.timeout = 10.0
|
3408
|
+
# config.rpcs.list_clusters.timeout = 20.0
|
3409
|
+
# end
|
3410
|
+
#
|
3411
|
+
# @!attribute [rw] endpoint
|
3412
|
+
# The hostname or hostname:port of the service endpoint.
|
3413
|
+
# Defaults to `"alloydb.googleapis.com"`.
|
3414
|
+
# @return [::String]
|
3415
|
+
# @!attribute [rw] credentials
|
3416
|
+
# Credentials to send with calls. You may provide any of the following types:
|
3417
|
+
# * (`String`) The path to a service account key file in JSON format
|
3418
|
+
# * (`Hash`) A service account key as a Hash
|
3419
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
3420
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
2444
3421
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
2445
3422
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
2446
3423
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
@@ -2521,6 +3498,14 @@ module Google
|
|
2521
3498
|
end
|
2522
3499
|
end
|
2523
3500
|
|
3501
|
+
##
|
3502
|
+
# Configuration for the channel pool
|
3503
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
3504
|
+
#
|
3505
|
+
def channel_pool
|
3506
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
3507
|
+
end
|
3508
|
+
|
2524
3509
|
##
|
2525
3510
|
# Configuration RPC class for the AlloyDBAdmin API.
|
2526
3511
|
#
|
@@ -2565,11 +3550,21 @@ module Google
|
|
2565
3550
|
#
|
2566
3551
|
attr_reader :delete_cluster
|
2567
3552
|
##
|
3553
|
+
# RPC-specific configuration for `promote_cluster`
|
3554
|
+
# @return [::Gapic::Config::Method]
|
3555
|
+
#
|
3556
|
+
attr_reader :promote_cluster
|
3557
|
+
##
|
2568
3558
|
# RPC-specific configuration for `restore_cluster`
|
2569
3559
|
# @return [::Gapic::Config::Method]
|
2570
3560
|
#
|
2571
3561
|
attr_reader :restore_cluster
|
2572
3562
|
##
|
3563
|
+
# RPC-specific configuration for `create_secondary_cluster`
|
3564
|
+
# @return [::Gapic::Config::Method]
|
3565
|
+
#
|
3566
|
+
attr_reader :create_secondary_cluster
|
3567
|
+
##
|
2573
3568
|
# RPC-specific configuration for `list_instances`
|
2574
3569
|
# @return [::Gapic::Config::Method]
|
2575
3570
|
#
|
@@ -2585,6 +3580,11 @@ module Google
|
|
2585
3580
|
#
|
2586
3581
|
attr_reader :create_instance
|
2587
3582
|
##
|
3583
|
+
# RPC-specific configuration for `create_secondary_instance`
|
3584
|
+
# @return [::Gapic::Config::Method]
|
3585
|
+
#
|
3586
|
+
attr_reader :create_secondary_instance
|
3587
|
+
##
|
2588
3588
|
# RPC-specific configuration for `batch_create_instances`
|
2589
3589
|
# @return [::Gapic::Config::Method]
|
2590
3590
|
#
|
@@ -2605,6 +3605,11 @@ module Google
|
|
2605
3605
|
#
|
2606
3606
|
attr_reader :failover_instance
|
2607
3607
|
##
|
3608
|
+
# RPC-specific configuration for `inject_fault`
|
3609
|
+
# @return [::Gapic::Config::Method]
|
3610
|
+
#
|
3611
|
+
attr_reader :inject_fault
|
3612
|
+
##
|
2608
3613
|
# RPC-specific configuration for `restart_instance`
|
2609
3614
|
# @return [::Gapic::Config::Method]
|
2610
3615
|
#
|
@@ -2639,6 +3644,31 @@ module Google
|
|
2639
3644
|
# @return [::Gapic::Config::Method]
|
2640
3645
|
#
|
2641
3646
|
attr_reader :list_supported_database_flags
|
3647
|
+
##
|
3648
|
+
# RPC-specific configuration for `list_users`
|
3649
|
+
# @return [::Gapic::Config::Method]
|
3650
|
+
#
|
3651
|
+
attr_reader :list_users
|
3652
|
+
##
|
3653
|
+
# RPC-specific configuration for `get_user`
|
3654
|
+
# @return [::Gapic::Config::Method]
|
3655
|
+
#
|
3656
|
+
attr_reader :get_user
|
3657
|
+
##
|
3658
|
+
# RPC-specific configuration for `create_user`
|
3659
|
+
# @return [::Gapic::Config::Method]
|
3660
|
+
#
|
3661
|
+
attr_reader :create_user
|
3662
|
+
##
|
3663
|
+
# RPC-specific configuration for `update_user`
|
3664
|
+
# @return [::Gapic::Config::Method]
|
3665
|
+
#
|
3666
|
+
attr_reader :update_user
|
3667
|
+
##
|
3668
|
+
# RPC-specific configuration for `delete_user`
|
3669
|
+
# @return [::Gapic::Config::Method]
|
3670
|
+
#
|
3671
|
+
attr_reader :delete_user
|
2642
3672
|
|
2643
3673
|
# @private
|
2644
3674
|
def initialize parent_rpcs = nil
|
@@ -2652,14 +3682,20 @@ module Google
|
|
2652
3682
|
@update_cluster = ::Gapic::Config::Method.new update_cluster_config
|
2653
3683
|
delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster
|
2654
3684
|
@delete_cluster = ::Gapic::Config::Method.new delete_cluster_config
|
3685
|
+
promote_cluster_config = parent_rpcs.promote_cluster if parent_rpcs.respond_to? :promote_cluster
|
3686
|
+
@promote_cluster = ::Gapic::Config::Method.new promote_cluster_config
|
2655
3687
|
restore_cluster_config = parent_rpcs.restore_cluster if parent_rpcs.respond_to? :restore_cluster
|
2656
3688
|
@restore_cluster = ::Gapic::Config::Method.new restore_cluster_config
|
3689
|
+
create_secondary_cluster_config = parent_rpcs.create_secondary_cluster if parent_rpcs.respond_to? :create_secondary_cluster
|
3690
|
+
@create_secondary_cluster = ::Gapic::Config::Method.new create_secondary_cluster_config
|
2657
3691
|
list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
|
2658
3692
|
@list_instances = ::Gapic::Config::Method.new list_instances_config
|
2659
3693
|
get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
|
2660
3694
|
@get_instance = ::Gapic::Config::Method.new get_instance_config
|
2661
3695
|
create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
|
2662
3696
|
@create_instance = ::Gapic::Config::Method.new create_instance_config
|
3697
|
+
create_secondary_instance_config = parent_rpcs.create_secondary_instance if parent_rpcs.respond_to? :create_secondary_instance
|
3698
|
+
@create_secondary_instance = ::Gapic::Config::Method.new create_secondary_instance_config
|
2663
3699
|
batch_create_instances_config = parent_rpcs.batch_create_instances if parent_rpcs.respond_to? :batch_create_instances
|
2664
3700
|
@batch_create_instances = ::Gapic::Config::Method.new batch_create_instances_config
|
2665
3701
|
update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance
|
@@ -2668,6 +3704,8 @@ module Google
|
|
2668
3704
|
@delete_instance = ::Gapic::Config::Method.new delete_instance_config
|
2669
3705
|
failover_instance_config = parent_rpcs.failover_instance if parent_rpcs.respond_to? :failover_instance
|
2670
3706
|
@failover_instance = ::Gapic::Config::Method.new failover_instance_config
|
3707
|
+
inject_fault_config = parent_rpcs.inject_fault if parent_rpcs.respond_to? :inject_fault
|
3708
|
+
@inject_fault = ::Gapic::Config::Method.new inject_fault_config
|
2671
3709
|
restart_instance_config = parent_rpcs.restart_instance if parent_rpcs.respond_to? :restart_instance
|
2672
3710
|
@restart_instance = ::Gapic::Config::Method.new restart_instance_config
|
2673
3711
|
list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
|
@@ -2682,6 +3720,16 @@ module Google
|
|
2682
3720
|
@delete_backup = ::Gapic::Config::Method.new delete_backup_config
|
2683
3721
|
list_supported_database_flags_config = parent_rpcs.list_supported_database_flags if parent_rpcs.respond_to? :list_supported_database_flags
|
2684
3722
|
@list_supported_database_flags = ::Gapic::Config::Method.new list_supported_database_flags_config
|
3723
|
+
list_users_config = parent_rpcs.list_users if parent_rpcs.respond_to? :list_users
|
3724
|
+
@list_users = ::Gapic::Config::Method.new list_users_config
|
3725
|
+
get_user_config = parent_rpcs.get_user if parent_rpcs.respond_to? :get_user
|
3726
|
+
@get_user = ::Gapic::Config::Method.new get_user_config
|
3727
|
+
create_user_config = parent_rpcs.create_user if parent_rpcs.respond_to? :create_user
|
3728
|
+
@create_user = ::Gapic::Config::Method.new create_user_config
|
3729
|
+
update_user_config = parent_rpcs.update_user if parent_rpcs.respond_to? :update_user
|
3730
|
+
@update_user = ::Gapic::Config::Method.new update_user_config
|
3731
|
+
delete_user_config = parent_rpcs.delete_user if parent_rpcs.respond_to? :delete_user
|
3732
|
+
@delete_user = ::Gapic::Config::Method.new delete_user_config
|
2685
3733
|
|
2686
3734
|
yield self if block_given?
|
2687
3735
|
end
|