google-cloud-alloy_db-v1 0.9.2 → 0.10.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 +490 -143
- data/lib/google/cloud/alloy_db/v1/alloy_db_admin/rest/client.rb +469 -143
- data/lib/google/cloud/alloy_db/v1/alloy_db_admin/rest/service_stub.rb +179 -0
- data/lib/google/cloud/alloy_db/v1/version.rb +1 -1
- data/lib/google/cloud/alloydb/v1/data_model_pb.rb +45 -0
- data/lib/google/cloud/alloydb/v1/resources_pb.rb +12 -1
- data/lib/google/cloud/alloydb/v1/service_pb.rb +11 -1
- data/lib/google/cloud/alloydb/v1/service_services_pb.rb +8 -0
- data/proto_docs/google/api/client.rb +14 -0
- data/proto_docs/google/api/field_info.rb +88 -0
- data/proto_docs/google/cloud/alloydb/v1/data_model.rb +75 -0
- data/proto_docs/google/cloud/alloydb/v1/resources.rb +241 -6
- data/proto_docs/google/cloud/alloydb/v1/service.rb +304 -143
- metadata +6 -3
@@ -474,22 +474,22 @@ module Google
|
|
474
474
|
# Required. The resource being created
|
475
475
|
# @param request_id [::String]
|
476
476
|
# Optional. An optional request ID to identify requests. Specify a unique
|
477
|
-
# request ID so that if you must retry your request, the server
|
478
|
-
#
|
479
|
-
#
|
477
|
+
# request ID so that if you must retry your request, the server ignores the
|
478
|
+
# request if it has already been completed. The server guarantees that for at
|
479
|
+
# least 60 minutes since the first request.
|
480
480
|
#
|
481
481
|
# For example, consider a situation where you make an initial request and
|
482
482
|
# the request times out. If you make the request again with the same request
|
483
|
-
# ID, the server can check if original operation with the same request ID
|
484
|
-
# was received, and if so,
|
483
|
+
# ID, the server can check if the original operation with the same request ID
|
484
|
+
# was received, and if so, ignores the second request. This prevents
|
485
485
|
# clients from accidentally creating duplicate commitments.
|
486
486
|
#
|
487
487
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
488
488
|
# not supported (00000000-0000-0000-0000-000000000000).
|
489
489
|
# @param validate_only [::Boolean]
|
490
|
-
# Optional. If set, performs request validation
|
491
|
-
# any other type of validation
|
492
|
-
# request.
|
490
|
+
# Optional. If set, performs request validation, for example, permission
|
491
|
+
# checks and any other type of validation, but does not actually execute the
|
492
|
+
# create request.
|
493
493
|
#
|
494
494
|
# @yield [response, operation] Access the result along with the RPC operation
|
495
495
|
# @yieldparam response [::Gapic::Operation]
|
@@ -592,22 +592,22 @@ module Google
|
|
592
592
|
# Required. The resource being updated
|
593
593
|
# @param request_id [::String]
|
594
594
|
# Optional. An optional request ID to identify requests. Specify a unique
|
595
|
-
# request ID so that if you must retry your request, the server
|
596
|
-
#
|
597
|
-
#
|
595
|
+
# request ID so that if you must retry your request, the server ignores the
|
596
|
+
# request if it has already been completed. The server guarantees that for at
|
597
|
+
# least 60 minutes since the first request.
|
598
598
|
#
|
599
599
|
# For example, consider a situation where you make an initial request and
|
600
600
|
# the request times out. If you make the request again with the same request
|
601
|
-
# ID, the server can check if original operation with the same request ID
|
602
|
-
# was received, and if so,
|
601
|
+
# ID, the server can check if the original operation with the same request ID
|
602
|
+
# was received, and if so, ignores the second request. This prevents
|
603
603
|
# clients from accidentally creating duplicate commitments.
|
604
604
|
#
|
605
605
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
606
606
|
# not supported (00000000-0000-0000-0000-000000000000).
|
607
607
|
# @param validate_only [::Boolean]
|
608
|
-
# Optional. If set, performs request validation
|
609
|
-
# any other type of validation
|
610
|
-
# request.
|
608
|
+
# Optional. If set, performs request validation, for example, permission
|
609
|
+
# checks and any other type of validation, but does not actually execute the
|
610
|
+
# create request.
|
611
611
|
# @param allow_missing [::Boolean]
|
612
612
|
# Optional. If set to true, update succeeds even if cluster is not found. In
|
613
613
|
# that case, a new cluster is created and `update_mask` is ignored.
|
@@ -708,14 +708,14 @@ module Google
|
|
708
708
|
# comment on the Cluster.name field.
|
709
709
|
# @param request_id [::String]
|
710
710
|
# Optional. An optional request ID to identify requests. Specify a unique
|
711
|
-
# request ID so that if you must retry your request, the server
|
712
|
-
#
|
713
|
-
#
|
711
|
+
# request ID so that if you must retry your request, the server ignores the
|
712
|
+
# request if it has already been completed. The server guarantees that for at
|
713
|
+
# least 60 minutes since the first request.
|
714
714
|
#
|
715
715
|
# For example, consider a situation where you make an initial request and
|
716
716
|
# the request times out. If you make the request again with the same request
|
717
|
-
# ID, the server can check if original operation with the same request ID
|
718
|
-
# was received, and if so,
|
717
|
+
# ID, the server can check if the original operation with the same request ID
|
718
|
+
# was received, and if so, ignores the second request. This prevents
|
719
719
|
# clients from accidentally creating duplicate commitments.
|
720
720
|
#
|
721
721
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
@@ -725,8 +725,9 @@ module Google
|
|
725
725
|
# If an etag is provided and does not match the current etag of the Cluster,
|
726
726
|
# deletion will be blocked and an ABORTED error will be returned.
|
727
727
|
# @param validate_only [::Boolean]
|
728
|
-
# Optional. If set, performs request validation
|
729
|
-
# any other type of validation
|
728
|
+
# Optional. If set, performs request validation, for example, permission
|
729
|
+
# checks and any other type of validation, but does not actually execute the
|
730
|
+
# create request.
|
730
731
|
# @param force [::Boolean]
|
731
732
|
# Optional. Whether to cascade delete child instances for given cluster.
|
732
733
|
#
|
@@ -829,9 +830,9 @@ module Google
|
|
829
830
|
# comment on the Cluster.name field
|
830
831
|
# @param request_id [::String]
|
831
832
|
# Optional. An optional request ID to identify requests. Specify a unique
|
832
|
-
# request ID so that if you must retry your request, the server
|
833
|
-
#
|
834
|
-
#
|
833
|
+
# request ID so that if you must retry your request, the server ignores the
|
834
|
+
# request if it has already been completed. The server guarantees that for at
|
835
|
+
# least 60 minutes since the first request.
|
835
836
|
#
|
836
837
|
# For example, consider a situation where you make an initial request and
|
837
838
|
# the request times out. If you make the request again with the same request
|
@@ -846,8 +847,9 @@ module Google
|
|
846
847
|
# If an etag is provided and does not match the current etag of the Cluster,
|
847
848
|
# deletion will be blocked and an ABORTED error will be returned.
|
848
849
|
# @param validate_only [::Boolean]
|
849
|
-
# Optional. If set, performs request validation
|
850
|
-
# any other type of validation
|
850
|
+
# Optional. If set, performs request validation, for example, permission
|
851
|
+
# checks and any other type of validation, but does not actually execute the
|
852
|
+
# create request.
|
851
853
|
#
|
852
854
|
# @yield [response, operation] Access the result along with the RPC operation
|
853
855
|
# @yieldparam response [::Gapic::Operation]
|
@@ -922,6 +924,121 @@ module Google
|
|
922
924
|
raise ::Google::Cloud::Error.from_error(e)
|
923
925
|
end
|
924
926
|
|
927
|
+
##
|
928
|
+
# Switches the roles of PRIMARY and SECONDARY clusters without any data loss.
|
929
|
+
# This promotes the SECONDARY cluster to PRIMARY and sets up the original
|
930
|
+
# PRIMARY cluster to replicate from this newly promoted cluster.
|
931
|
+
#
|
932
|
+
# @overload switchover_cluster(request, options = nil)
|
933
|
+
# Pass arguments to `switchover_cluster` via a request object, either of type
|
934
|
+
# {::Google::Cloud::AlloyDB::V1::SwitchoverClusterRequest} or an equivalent Hash.
|
935
|
+
#
|
936
|
+
# @param request [::Google::Cloud::AlloyDB::V1::SwitchoverClusterRequest, ::Hash]
|
937
|
+
# A request object representing the call parameters. Required. To specify no
|
938
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
939
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
940
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
941
|
+
#
|
942
|
+
# @overload switchover_cluster(name: nil, request_id: nil, validate_only: nil)
|
943
|
+
# Pass arguments to `switchover_cluster` via keyword arguments. Note that at
|
944
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
945
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
946
|
+
#
|
947
|
+
# @param name [::String]
|
948
|
+
# Required. The name of the resource. For the required format, see the
|
949
|
+
# comment on the Cluster.name field
|
950
|
+
# @param request_id [::String]
|
951
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
952
|
+
# request ID so that if you must retry your request, the server ignores the
|
953
|
+
# request if it has already been completed. The server guarantees that for at
|
954
|
+
# least 60 minutes since the first request.
|
955
|
+
#
|
956
|
+
# For example, consider a situation where you make an initial request and
|
957
|
+
# the request times out. If you make the request again with the same request
|
958
|
+
# ID, the server can check if the original operation with the same request ID
|
959
|
+
# was received, and if so, ignores the second request. This prevents
|
960
|
+
# clients from accidentally creating duplicate commitments.
|
961
|
+
#
|
962
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
963
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
964
|
+
# @param validate_only [::Boolean]
|
965
|
+
# Optional. If set, performs request validation, for example, permission
|
966
|
+
# checks and any other type of validation, but does not actually execute the
|
967
|
+
# create request.
|
968
|
+
#
|
969
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
970
|
+
# @yieldparam response [::Gapic::Operation]
|
971
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
972
|
+
#
|
973
|
+
# @return [::Gapic::Operation]
|
974
|
+
#
|
975
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
976
|
+
#
|
977
|
+
# @example Basic example
|
978
|
+
# require "google/cloud/alloy_db/v1"
|
979
|
+
#
|
980
|
+
# # Create a client object. The client can be reused for multiple calls.
|
981
|
+
# client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new
|
982
|
+
#
|
983
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
984
|
+
# request = Google::Cloud::AlloyDB::V1::SwitchoverClusterRequest.new
|
985
|
+
#
|
986
|
+
# # Call the switchover_cluster method.
|
987
|
+
# result = client.switchover_cluster request
|
988
|
+
#
|
989
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
990
|
+
# # check the status of an operation, cancel it, or wait for results.
|
991
|
+
# # Here is how to wait for a response.
|
992
|
+
# result.wait_until_done! timeout: 60
|
993
|
+
# if result.response?
|
994
|
+
# p result.response
|
995
|
+
# else
|
996
|
+
# puts "No response received."
|
997
|
+
# end
|
998
|
+
#
|
999
|
+
def switchover_cluster request, options = nil
|
1000
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1001
|
+
|
1002
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::SwitchoverClusterRequest
|
1003
|
+
|
1004
|
+
# Converts hash and nil to an options object
|
1005
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1006
|
+
|
1007
|
+
# Customize the options with defaults
|
1008
|
+
metadata = @config.rpcs.switchover_cluster.metadata.to_h
|
1009
|
+
|
1010
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1011
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1012
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1013
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION
|
1014
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1015
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1016
|
+
|
1017
|
+
header_params = {}
|
1018
|
+
if request.name
|
1019
|
+
header_params["name"] = request.name
|
1020
|
+
end
|
1021
|
+
|
1022
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1023
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1024
|
+
|
1025
|
+
options.apply_defaults timeout: @config.rpcs.switchover_cluster.timeout,
|
1026
|
+
metadata: metadata,
|
1027
|
+
retry_policy: @config.rpcs.switchover_cluster.retry_policy
|
1028
|
+
|
1029
|
+
options.apply_defaults timeout: @config.timeout,
|
1030
|
+
metadata: @config.metadata,
|
1031
|
+
retry_policy: @config.retry_policy
|
1032
|
+
|
1033
|
+
@alloy_db_admin_stub.call_rpc :switchover_cluster, request, options: options do |response, operation|
|
1034
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1035
|
+
yield response, operation if block_given?
|
1036
|
+
return response
|
1037
|
+
end
|
1038
|
+
rescue ::GRPC::BadStatus => e
|
1039
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1040
|
+
end
|
1041
|
+
|
925
1042
|
##
|
926
1043
|
# Creates a new Cluster in a given project and location, with a volume
|
927
1044
|
# restored from the provided source, either a backup ID or a point-in-time
|
@@ -956,22 +1073,22 @@ module Google
|
|
956
1073
|
# Required. The resource being created
|
957
1074
|
# @param request_id [::String]
|
958
1075
|
# Optional. An optional request ID to identify requests. Specify a unique
|
959
|
-
# request ID so that if you must retry your request, the server
|
960
|
-
#
|
961
|
-
#
|
1076
|
+
# request ID so that if you must retry your request, the server ignores the
|
1077
|
+
# request if it has already been completed. The server guarantees that for at
|
1078
|
+
# least 60 minutes since the first request.
|
962
1079
|
#
|
963
1080
|
# For example, consider a situation where you make an initial request and
|
964
1081
|
# the request times out. If you make the request again with the same request
|
965
|
-
# ID, the server can check if original operation with the same request ID
|
966
|
-
# was received, and if so,
|
1082
|
+
# ID, the server can check if the original operation with the same request ID
|
1083
|
+
# was received, and if so, ignores the second request. This prevents
|
967
1084
|
# clients from accidentally creating duplicate commitments.
|
968
1085
|
#
|
969
1086
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
970
1087
|
# not supported (00000000-0000-0000-0000-000000000000).
|
971
1088
|
# @param validate_only [::Boolean]
|
972
|
-
# Optional. If set, performs request validation
|
973
|
-
# any other type of validation
|
974
|
-
# request.
|
1089
|
+
# Optional. If set, performs request validation, for example, permission
|
1090
|
+
# checks and any other type of validation, but does not actually execute the
|
1091
|
+
# create request.
|
975
1092
|
#
|
976
1093
|
# @yield [response, operation] Access the result along with the RPC operation
|
977
1094
|
# @yieldparam response [::Gapic::Operation]
|
@@ -1074,22 +1191,22 @@ module Google
|
|
1074
1191
|
# Required. Configuration of the requesting object (the secondary cluster).
|
1075
1192
|
# @param request_id [::String]
|
1076
1193
|
# Optional. An optional request ID to identify requests. Specify a unique
|
1077
|
-
# request ID so that if you must retry your request, the server
|
1078
|
-
#
|
1079
|
-
#
|
1194
|
+
# request ID so that if you must retry your request, the server ignores the
|
1195
|
+
# request if it has already been completed. The server guarantees that for at
|
1196
|
+
# least 60 minutes since the first request.
|
1080
1197
|
#
|
1081
1198
|
# For example, consider a situation where you make an initial request and
|
1082
1199
|
# the request times out. If you make the request again with the same request
|
1083
|
-
# ID, the server can check if original operation with the same request ID
|
1084
|
-
# was received, and if so,
|
1200
|
+
# ID, the server can check if the original operation with the same request ID
|
1201
|
+
# was received, and if so, ignores the second request. This prevents
|
1085
1202
|
# clients from accidentally creating duplicate commitments.
|
1086
1203
|
#
|
1087
1204
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
1088
1205
|
# not supported (00000000-0000-0000-0000-000000000000).
|
1089
1206
|
# @param validate_only [::Boolean]
|
1090
|
-
# Optional. If set, performs request validation
|
1091
|
-
# any other type of validation
|
1092
|
-
# request.
|
1207
|
+
# Optional. If set, performs request validation, for example, permission
|
1208
|
+
# checks and any other type of validation, but does not actually execute the
|
1209
|
+
# create request.
|
1093
1210
|
#
|
1094
1211
|
# @yield [response, operation] Access the result along with the RPC operation
|
1095
1212
|
# @yieldparam response [::Gapic::Operation]
|
@@ -1385,22 +1502,22 @@ module Google
|
|
1385
1502
|
# Required. The resource being created
|
1386
1503
|
# @param request_id [::String]
|
1387
1504
|
# Optional. An optional request ID to identify requests. Specify a unique
|
1388
|
-
# request ID so that if you must retry your request, the server
|
1389
|
-
#
|
1390
|
-
#
|
1505
|
+
# request ID so that if you must retry your request, the server ignores the
|
1506
|
+
# request if it has already been completed. The server guarantees that for at
|
1507
|
+
# least 60 minutes since the first request.
|
1391
1508
|
#
|
1392
1509
|
# For example, consider a situation where you make an initial request and
|
1393
1510
|
# the request times out. If you make the request again with the same request
|
1394
|
-
# ID, the server can check if original operation with the same request ID
|
1395
|
-
# was received, and if so,
|
1511
|
+
# ID, the server can check if the original operation with the same request ID
|
1512
|
+
# was received, and if so, ignores the second request. This prevents
|
1396
1513
|
# clients from accidentally creating duplicate commitments.
|
1397
1514
|
#
|
1398
1515
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
1399
1516
|
# not supported (00000000-0000-0000-0000-000000000000).
|
1400
1517
|
# @param validate_only [::Boolean]
|
1401
|
-
# Optional. If set, performs request validation
|
1402
|
-
# any other type of validation
|
1403
|
-
# request.
|
1518
|
+
# Optional. If set, performs request validation, for example, permission
|
1519
|
+
# checks and any other type of validation, but does not actually execute the
|
1520
|
+
# create request.
|
1404
1521
|
#
|
1405
1522
|
# @yield [response, operation] Access the result along with the RPC operation
|
1406
1523
|
# @yieldparam response [::Gapic::Operation]
|
@@ -1502,22 +1619,22 @@ module Google
|
|
1502
1619
|
# Required. The resource being created
|
1503
1620
|
# @param request_id [::String]
|
1504
1621
|
# Optional. An optional request ID to identify requests. Specify a unique
|
1505
|
-
# request ID so that if you must retry your request, the server
|
1506
|
-
#
|
1507
|
-
#
|
1622
|
+
# request ID so that if you must retry your request, the server ignores the
|
1623
|
+
# request if it has already been completed. The server guarantees that for at
|
1624
|
+
# least 60 minutes since the first request.
|
1508
1625
|
#
|
1509
1626
|
# For example, consider a situation where you make an initial request and
|
1510
1627
|
# the request times out. If you make the request again with the same request
|
1511
|
-
# ID, the server can check if original operation with the same request ID
|
1512
|
-
# was received, and if so,
|
1628
|
+
# ID, the server can check if the original operation with the same request ID
|
1629
|
+
# was received, and if so, ignores the second request. This prevents
|
1513
1630
|
# clients from accidentally creating duplicate commitments.
|
1514
1631
|
#
|
1515
1632
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
1516
1633
|
# not supported (00000000-0000-0000-0000-000000000000).
|
1517
1634
|
# @param validate_only [::Boolean]
|
1518
|
-
# Optional. If set, performs request validation
|
1519
|
-
# any other type of validation
|
1520
|
-
# request.
|
1635
|
+
# Optional. If set, performs request validation, for example, permission
|
1636
|
+
# checks and any other type of validation, but does not actually execute the
|
1637
|
+
# create request.
|
1521
1638
|
#
|
1522
1639
|
# @yield [response, operation] Access the result along with the RPC operation
|
1523
1640
|
# @yieldparam response [::Gapic::Operation]
|
@@ -1625,14 +1742,14 @@ module Google
|
|
1625
1742
|
# Required. Resources being created.
|
1626
1743
|
# @param request_id [::String]
|
1627
1744
|
# Optional. An optional request ID to identify requests. Specify a unique
|
1628
|
-
# request ID so that if you must retry your request, the server
|
1629
|
-
#
|
1630
|
-
#
|
1745
|
+
# request ID so that if you must retry your request, the server ignores the
|
1746
|
+
# request if it has already been completed. The server guarantees that for at
|
1747
|
+
# least 60 minutes since the first request.
|
1631
1748
|
#
|
1632
1749
|
# For example, consider a situation where you make an initial request and
|
1633
1750
|
# the request times out. If you make the request again with the same request
|
1634
|
-
# ID, the server can check if original operation with the same request ID
|
1635
|
-
# was received, and if so,
|
1751
|
+
# ID, the server can check if the original operation with the same request ID
|
1752
|
+
# was received, and if so, ignores the second request. This prevents
|
1636
1753
|
# clients from accidentally creating duplicate commitments.
|
1637
1754
|
#
|
1638
1755
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
@@ -1739,22 +1856,22 @@ module Google
|
|
1739
1856
|
# Required. The resource being updated
|
1740
1857
|
# @param request_id [::String]
|
1741
1858
|
# Optional. An optional request ID to identify requests. Specify a unique
|
1742
|
-
# request ID so that if you must retry your request, the server
|
1743
|
-
#
|
1744
|
-
#
|
1859
|
+
# request ID so that if you must retry your request, the server ignores the
|
1860
|
+
# request if it has already been completed. The server guarantees that for at
|
1861
|
+
# least 60 minutes since the first request.
|
1745
1862
|
#
|
1746
1863
|
# For example, consider a situation where you make an initial request and
|
1747
1864
|
# the request times out. If you make the request again with the same request
|
1748
|
-
# ID, the server can check if original operation with the same request ID
|
1749
|
-
# was received, and if so,
|
1865
|
+
# ID, the server can check if the original operation with the same request ID
|
1866
|
+
# was received, and if so, ignores the second request. This prevents
|
1750
1867
|
# clients from accidentally creating duplicate commitments.
|
1751
1868
|
#
|
1752
1869
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
1753
1870
|
# not supported (00000000-0000-0000-0000-000000000000).
|
1754
1871
|
# @param validate_only [::Boolean]
|
1755
|
-
# Optional. If set, performs request validation
|
1756
|
-
# any other type of validation
|
1757
|
-
# request.
|
1872
|
+
# Optional. If set, performs request validation, for example, permission
|
1873
|
+
# checks and any other type of validation, but does not actually execute the
|
1874
|
+
# create request.
|
1758
1875
|
# @param allow_missing [::Boolean]
|
1759
1876
|
# Optional. If set to true, update succeeds even if instance is not found. In
|
1760
1877
|
# that case, a new instance is created and `update_mask` is ignored.
|
@@ -1855,14 +1972,14 @@ module Google
|
|
1855
1972
|
# comment on the Instance.name field.
|
1856
1973
|
# @param request_id [::String]
|
1857
1974
|
# Optional. An optional request ID to identify requests. Specify a unique
|
1858
|
-
# request ID so that if you must retry your request, the server
|
1859
|
-
#
|
1860
|
-
#
|
1975
|
+
# request ID so that if you must retry your request, the server ignores the
|
1976
|
+
# request if it has already been completed. The server guarantees that for at
|
1977
|
+
# least 60 minutes since the first request.
|
1861
1978
|
#
|
1862
1979
|
# For example, consider a situation where you make an initial request and
|
1863
1980
|
# the request times out. If you make the request again with the same request
|
1864
|
-
# ID, the server can check if original operation with the same request ID
|
1865
|
-
# was received, and if so,
|
1981
|
+
# ID, the server can check if the original operation with the same request ID
|
1982
|
+
# was received, and if so, ignores the second request. This prevents
|
1866
1983
|
# clients from accidentally creating duplicate commitments.
|
1867
1984
|
#
|
1868
1985
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
@@ -1872,8 +1989,9 @@ module Google
|
|
1872
1989
|
# If an etag is provided and does not match the current etag of the Instance,
|
1873
1990
|
# deletion will be blocked and an ABORTED error will be returned.
|
1874
1991
|
# @param validate_only [::Boolean]
|
1875
|
-
# Optional. If set, performs request validation
|
1876
|
-
# any other type of validation
|
1992
|
+
# Optional. If set, performs request validation, for example, permission
|
1993
|
+
# checks and any other type of validation, but does not actually execute the
|
1994
|
+
# create request.
|
1877
1995
|
#
|
1878
1996
|
# @yield [response, operation] Access the result along with the RPC operation
|
1879
1997
|
# @yieldparam response [::Gapic::Operation]
|
@@ -1973,21 +2091,22 @@ module Google
|
|
1973
2091
|
# comment on the Instance.name field.
|
1974
2092
|
# @param request_id [::String]
|
1975
2093
|
# Optional. An optional request ID to identify requests. Specify a unique
|
1976
|
-
# request ID so that if you must retry your request, the server
|
1977
|
-
#
|
1978
|
-
#
|
2094
|
+
# request ID so that if you must retry your request, the server ignores the
|
2095
|
+
# request if it has already been completed. The server guarantees that for at
|
2096
|
+
# least 60 minutes since the first request.
|
1979
2097
|
#
|
1980
2098
|
# For example, consider a situation where you make an initial request and
|
1981
2099
|
# the request times out. If you make the request again with the same request
|
1982
|
-
# ID, the server can check if original operation with the same request ID
|
1983
|
-
# was received, and if so,
|
2100
|
+
# ID, the server can check if the original operation with the same request ID
|
2101
|
+
# was received, and if so, ignores the second request. This prevents
|
1984
2102
|
# clients from accidentally creating duplicate commitments.
|
1985
2103
|
#
|
1986
2104
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
1987
2105
|
# not supported (00000000-0000-0000-0000-000000000000).
|
1988
2106
|
# @param validate_only [::Boolean]
|
1989
|
-
# Optional. If set, performs request validation
|
1990
|
-
# any other type of validation
|
2107
|
+
# Optional. If set, performs request validation, for example, permission
|
2108
|
+
# checks and any other type of validation, but does not actually execute the
|
2109
|
+
# create request.
|
1991
2110
|
#
|
1992
2111
|
# @yield [response, operation] Access the result along with the RPC operation
|
1993
2112
|
# @yieldparam response [::Gapic::Operation]
|
@@ -2088,22 +2207,22 @@ module Google
|
|
2088
2207
|
# comment on the Instance.name field.
|
2089
2208
|
# @param request_id [::String]
|
2090
2209
|
# Optional. An optional request ID to identify requests. Specify a unique
|
2091
|
-
# request ID so that if you must retry your request, the server
|
2092
|
-
#
|
2093
|
-
#
|
2210
|
+
# request ID so that if you must retry your request, the server ignores the
|
2211
|
+
# request if it has already been completed. The server guarantees that for at
|
2212
|
+
# least 60 minutes since the first request.
|
2094
2213
|
#
|
2095
2214
|
# For example, consider a situation where you make an initial request and
|
2096
2215
|
# the request times out. If you make the request again with the same request
|
2097
|
-
# ID, the server can check if original operation with the same request ID
|
2098
|
-
# was received, and if so,
|
2216
|
+
# ID, the server can check if the original operation with the same request ID
|
2217
|
+
# was received, and if so, ignores the second request. This prevents
|
2099
2218
|
# clients from accidentally creating duplicate commitments.
|
2100
2219
|
#
|
2101
2220
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
2102
2221
|
# not supported (00000000-0000-0000-0000-000000000000).
|
2103
2222
|
# @param validate_only [::Boolean]
|
2104
|
-
# Optional. If set, performs request validation
|
2105
|
-
# any other type of validation
|
2106
|
-
#
|
2223
|
+
# Optional. If set, performs request validation, for example, permission
|
2224
|
+
# checks and any other type of validation, but does not actually execute the
|
2225
|
+
# create request.
|
2107
2226
|
#
|
2108
2227
|
# @yield [response, operation] Access the result along with the RPC operation
|
2109
2228
|
# @yieldparam response [::Gapic::Operation]
|
@@ -2192,7 +2311,7 @@ module Google
|
|
2192
2311
|
# @param options [::Gapic::CallOptions, ::Hash]
|
2193
2312
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2194
2313
|
#
|
2195
|
-
# @overload restart_instance(name: nil, request_id: nil, validate_only: nil)
|
2314
|
+
# @overload restart_instance(name: nil, request_id: nil, validate_only: nil, node_ids: nil)
|
2196
2315
|
# Pass arguments to `restart_instance` via keyword arguments. Note that at
|
2197
2316
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
2198
2317
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -2202,21 +2321,25 @@ module Google
|
|
2202
2321
|
# comment on the Instance.name field.
|
2203
2322
|
# @param request_id [::String]
|
2204
2323
|
# Optional. An optional request ID to identify requests. Specify a unique
|
2205
|
-
# request ID so that if you must retry your request, the server
|
2206
|
-
#
|
2207
|
-
#
|
2324
|
+
# request ID so that if you must retry your request, the server ignores the
|
2325
|
+
# request if it has already been completed. The server guarantees that for at
|
2326
|
+
# least 60 minutes since the first request.
|
2208
2327
|
#
|
2209
2328
|
# For example, consider a situation where you make an initial request and
|
2210
2329
|
# the request times out. If you make the request again with the same request
|
2211
|
-
# ID, the server can check if original operation with the same request ID
|
2212
|
-
# was received, and if so,
|
2330
|
+
# ID, the server can check if the original operation with the same request ID
|
2331
|
+
# was received, and if so, ignores the second request. This prevents
|
2213
2332
|
# clients from accidentally creating duplicate commitments.
|
2214
2333
|
#
|
2215
2334
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
2216
2335
|
# not supported (00000000-0000-0000-0000-000000000000).
|
2217
2336
|
# @param validate_only [::Boolean]
|
2218
|
-
# Optional. If set, performs request validation
|
2219
|
-
# any other type of validation
|
2337
|
+
# Optional. If set, performs request validation, for example, permission
|
2338
|
+
# checks and any other type of validation, but does not actually execute the
|
2339
|
+
# create request.
|
2340
|
+
# @param node_ids [::Array<::String>]
|
2341
|
+
# Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to
|
2342
|
+
# restart upon. Applicable only to read instances.
|
2220
2343
|
#
|
2221
2344
|
# @yield [response, operation] Access the result along with the RPC operation
|
2222
2345
|
# @yieldparam response [::Gapic::Operation]
|
@@ -2291,6 +2414,106 @@ module Google
|
|
2291
2414
|
raise ::Google::Cloud::Error.from_error(e)
|
2292
2415
|
end
|
2293
2416
|
|
2417
|
+
##
|
2418
|
+
# Executes a SQL statement in a database inside an AlloyDB instance.
|
2419
|
+
#
|
2420
|
+
# @overload execute_sql(request, options = nil)
|
2421
|
+
# Pass arguments to `execute_sql` via a request object, either of type
|
2422
|
+
# {::Google::Cloud::AlloyDB::V1::ExecuteSqlRequest} or an equivalent Hash.
|
2423
|
+
#
|
2424
|
+
# @param request [::Google::Cloud::AlloyDB::V1::ExecuteSqlRequest, ::Hash]
|
2425
|
+
# A request object representing the call parameters. Required. To specify no
|
2426
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2427
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2428
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2429
|
+
#
|
2430
|
+
# @overload execute_sql(password: nil, instance: nil, database: nil, user: nil, sql_statement: nil)
|
2431
|
+
# Pass arguments to `execute_sql` via keyword arguments. Note that at
|
2432
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2433
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2434
|
+
#
|
2435
|
+
# @param password [::String]
|
2436
|
+
# Optional. The database native user’s password.
|
2437
|
+
# @param instance [::String]
|
2438
|
+
# Required. The instance where the SQL will be executed. For the required
|
2439
|
+
# format, see the comment on the Instance.name field.
|
2440
|
+
# @param database [::String]
|
2441
|
+
# Required. Name of the database where the query will be executed.
|
2442
|
+
# Note - Value provided should be the same as expected from `SELECT
|
2443
|
+
# current_database();` and NOT as a resource reference.
|
2444
|
+
# @param user [::String]
|
2445
|
+
# Required. Database user to be used for executing the SQL.
|
2446
|
+
# Note - Value provided should be the same as expected from
|
2447
|
+
# `SELECT current_user;` and NOT as a resource reference.
|
2448
|
+
# @param sql_statement [::String]
|
2449
|
+
# Required. SQL statement to execute on database. Any valid statement is
|
2450
|
+
# permitted, including DDL, DML, DQL statements.
|
2451
|
+
#
|
2452
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2453
|
+
# @yieldparam response [::Google::Cloud::AlloyDB::V1::ExecuteSqlResponse]
|
2454
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2455
|
+
#
|
2456
|
+
# @return [::Google::Cloud::AlloyDB::V1::ExecuteSqlResponse]
|
2457
|
+
#
|
2458
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2459
|
+
#
|
2460
|
+
# @example Basic example
|
2461
|
+
# require "google/cloud/alloy_db/v1"
|
2462
|
+
#
|
2463
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2464
|
+
# client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new
|
2465
|
+
#
|
2466
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2467
|
+
# request = Google::Cloud::AlloyDB::V1::ExecuteSqlRequest.new
|
2468
|
+
#
|
2469
|
+
# # Call the execute_sql method.
|
2470
|
+
# result = client.execute_sql request
|
2471
|
+
#
|
2472
|
+
# # The returned object is of type Google::Cloud::AlloyDB::V1::ExecuteSqlResponse.
|
2473
|
+
# p result
|
2474
|
+
#
|
2475
|
+
def execute_sql request, options = nil
|
2476
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2477
|
+
|
2478
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::ExecuteSqlRequest
|
2479
|
+
|
2480
|
+
# Converts hash and nil to an options object
|
2481
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2482
|
+
|
2483
|
+
# Customize the options with defaults
|
2484
|
+
metadata = @config.rpcs.execute_sql.metadata.to_h
|
2485
|
+
|
2486
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2487
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2488
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2489
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION
|
2490
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2491
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2492
|
+
|
2493
|
+
header_params = {}
|
2494
|
+
if request.instance
|
2495
|
+
header_params["instance"] = request.instance
|
2496
|
+
end
|
2497
|
+
|
2498
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2499
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2500
|
+
|
2501
|
+
options.apply_defaults timeout: @config.rpcs.execute_sql.timeout,
|
2502
|
+
metadata: metadata,
|
2503
|
+
retry_policy: @config.rpcs.execute_sql.retry_policy
|
2504
|
+
|
2505
|
+
options.apply_defaults timeout: @config.timeout,
|
2506
|
+
metadata: @config.metadata,
|
2507
|
+
retry_policy: @config.retry_policy
|
2508
|
+
|
2509
|
+
@alloy_db_admin_stub.call_rpc :execute_sql, request, options: options do |response, operation|
|
2510
|
+
yield response, operation if block_given?
|
2511
|
+
return response
|
2512
|
+
end
|
2513
|
+
rescue ::GRPC::BadStatus => e
|
2514
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2515
|
+
end
|
2516
|
+
|
2294
2517
|
##
|
2295
2518
|
# Lists Backups in a given project and location.
|
2296
2519
|
#
|
@@ -2503,14 +2726,14 @@ module Google
|
|
2503
2726
|
# Required. The resource being created
|
2504
2727
|
# @param request_id [::String]
|
2505
2728
|
# Optional. An optional request ID to identify requests. Specify a unique
|
2506
|
-
# request ID so that if you must retry your request, the server
|
2507
|
-
#
|
2508
|
-
#
|
2729
|
+
# request ID so that if you must retry your request, the server ignores the
|
2730
|
+
# request if it has already been completed. The server guarantees that for at
|
2731
|
+
# least 60 minutes since the first request.
|
2509
2732
|
#
|
2510
2733
|
# For example, consider a situation where you make an initial request and
|
2511
2734
|
# the request times out. If you make the request again with the same request
|
2512
|
-
# ID, the server can check if original operation with the same request ID
|
2513
|
-
# was received, and if so,
|
2735
|
+
# ID, the server can check if the original operation with the same request ID
|
2736
|
+
# was received, and if so, ignores the second request. This prevents
|
2514
2737
|
# clients from accidentally creating duplicate commitments.
|
2515
2738
|
#
|
2516
2739
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
@@ -2620,14 +2843,14 @@ module Google
|
|
2620
2843
|
# Required. The resource being updated
|
2621
2844
|
# @param request_id [::String]
|
2622
2845
|
# Optional. An optional request ID to identify requests. Specify a unique
|
2623
|
-
# request ID so that if you must retry your request, the server
|
2624
|
-
#
|
2625
|
-
#
|
2846
|
+
# request ID so that if you must retry your request, the server ignores the
|
2847
|
+
# request if it has already been completed. The server guarantees that for at
|
2848
|
+
# least 60 minutes since the first request.
|
2626
2849
|
#
|
2627
2850
|
# For example, consider a situation where you make an initial request and
|
2628
2851
|
# the request times out. If you make the request again with the same request
|
2629
|
-
# ID, the server can check if original operation with the same request ID
|
2630
|
-
# was received, and if so,
|
2852
|
+
# ID, the server can check if the original operation with the same request ID
|
2853
|
+
# was received, and if so, ignores the second request. This prevents
|
2631
2854
|
# clients from accidentally creating duplicate commitments.
|
2632
2855
|
#
|
2633
2856
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
@@ -2735,14 +2958,14 @@ module Google
|
|
2735
2958
|
# the Backup.name field.
|
2736
2959
|
# @param request_id [::String]
|
2737
2960
|
# Optional. An optional request ID to identify requests. Specify a unique
|
2738
|
-
# request ID so that if you must retry your request, the server
|
2739
|
-
#
|
2740
|
-
#
|
2961
|
+
# request ID so that if you must retry your request, the server ignores the
|
2962
|
+
# request if it has already been completed. The server guarantees that for at
|
2963
|
+
# least 60 minutes since the first request.
|
2741
2964
|
#
|
2742
2965
|
# For example, consider a situation where you make an initial request and
|
2743
2966
|
# the request times out. If you make the request again with the same request
|
2744
|
-
# ID, the server can check if original operation with the same request ID
|
2745
|
-
# was received, and if so,
|
2967
|
+
# ID, the server can check if the original operation with the same request ID
|
2968
|
+
# was received, and if so, ignores the second request. This prevents
|
2746
2969
|
# clients from accidentally creating duplicate commitments.
|
2747
2970
|
#
|
2748
2971
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
@@ -2957,14 +3180,14 @@ module Google
|
|
2957
3180
|
# * projects/\\{project}/locations/\\{location}/clusters/\\{cluster}
|
2958
3181
|
# @param request_id [::String]
|
2959
3182
|
# Optional. An optional request ID to identify requests. Specify a unique
|
2960
|
-
# request ID so that if you must retry your request, the server
|
2961
|
-
#
|
2962
|
-
#
|
3183
|
+
# request ID so that if you must retry your request, the server ignores the
|
3184
|
+
# request if it has already been completed. The server guarantees that for at
|
3185
|
+
# least 60 minutes since the first request.
|
2963
3186
|
#
|
2964
3187
|
# For example, consider a situation where you make an initial request and
|
2965
3188
|
# the request times out. If you make the request again with the same request
|
2966
|
-
# ID, the server can check if original operation with the same request ID
|
2967
|
-
# was received, and if so,
|
3189
|
+
# ID, the server can check if the original operation with the same request ID
|
3190
|
+
# was received, and if so, ignores the second request. This prevents
|
2968
3191
|
# clients from accidentally creating duplicate commitments.
|
2969
3192
|
#
|
2970
3193
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
@@ -3070,14 +3293,14 @@ module Google
|
|
3070
3293
|
# projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/instances/\\{instance}
|
3071
3294
|
# @param request_id [::String]
|
3072
3295
|
# Optional. An optional request ID to identify requests. Specify a unique
|
3073
|
-
# request ID so that if you must retry your request, the server
|
3074
|
-
#
|
3075
|
-
#
|
3296
|
+
# request ID so that if you must retry your request, the server ignores the
|
3297
|
+
# request if it has already been completed. The server guarantees that for at
|
3298
|
+
# least 60 minutes since the first request.
|
3076
3299
|
#
|
3077
3300
|
# For example, consider a situation where you make an initial request and
|
3078
3301
|
# the request times out. If you make the request again with the same request
|
3079
|
-
# ID, the server can check if original operation with the same request ID
|
3080
|
-
# was received, and if so,
|
3302
|
+
# ID, the server can check if the original operation with the same request ID
|
3303
|
+
# was received, and if so, ignores the second request. This prevents
|
3081
3304
|
# clients from accidentally creating duplicate commitments.
|
3082
3305
|
#
|
3083
3306
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
@@ -3361,14 +3584,14 @@ module Google
|
|
3361
3584
|
# Required. The resource being created
|
3362
3585
|
# @param request_id [::String]
|
3363
3586
|
# Optional. An optional request ID to identify requests. Specify a unique
|
3364
|
-
# request ID so that if you must retry your request, the server
|
3365
|
-
#
|
3366
|
-
#
|
3587
|
+
# request ID so that if you must retry your request, the server ignores the
|
3588
|
+
# request if it has already been completed. The server guarantees that for at
|
3589
|
+
# least 60 minutes since the first request.
|
3367
3590
|
#
|
3368
3591
|
# For example, consider a situation where you make an initial request and
|
3369
3592
|
# the request times out. If you make the request again with the same request
|
3370
|
-
# ID, the server can check if original operation with the same request ID
|
3371
|
-
# was received, and if so,
|
3593
|
+
# ID, the server can check if the original operation with the same request ID
|
3594
|
+
# was received, and if so, ignores the second request. This prevents
|
3372
3595
|
# clients from accidentally creating duplicate commitments.
|
3373
3596
|
#
|
3374
3597
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
@@ -3470,14 +3693,14 @@ module Google
|
|
3470
3693
|
# Required. The resource being updated
|
3471
3694
|
# @param request_id [::String]
|
3472
3695
|
# Optional. An optional request ID to identify requests. Specify a unique
|
3473
|
-
# request ID so that if you must retry your request, the server
|
3474
|
-
#
|
3475
|
-
#
|
3696
|
+
# request ID so that if you must retry your request, the server ignores the
|
3697
|
+
# request if it has already been completed. The server guarantees that for at
|
3698
|
+
# least 60 minutes since the first request.
|
3476
3699
|
#
|
3477
3700
|
# For example, consider a situation where you make an initial request and
|
3478
3701
|
# the request times out. If you make the request again with the same request
|
3479
|
-
# ID, the server can check if original operation with the same request ID
|
3480
|
-
# was received, and if so,
|
3702
|
+
# ID, the server can check if the original operation with the same request ID
|
3703
|
+
# was received, and if so, ignores the second request. This prevents
|
3481
3704
|
# clients from accidentally creating duplicate commitments.
|
3482
3705
|
#
|
3483
3706
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
@@ -3576,14 +3799,14 @@ module Google
|
|
3576
3799
|
# comment on the User.name field.
|
3577
3800
|
# @param request_id [::String]
|
3578
3801
|
# Optional. An optional request ID to identify requests. Specify a unique
|
3579
|
-
# request ID so that if you must retry your request, the server
|
3580
|
-
#
|
3581
|
-
#
|
3802
|
+
# request ID so that if you must retry your request, the server ignores the
|
3803
|
+
# request if it has already been completed. The server guarantees that for at
|
3804
|
+
# least 60 minutes since the first request.
|
3582
3805
|
#
|
3583
3806
|
# For example, consider a situation where you make an initial request and
|
3584
3807
|
# the request times out. If you make the request again with the same request
|
3585
|
-
# ID, the server can check if original operation with the same request ID
|
3586
|
-
# was received, and if so,
|
3808
|
+
# ID, the server can check if the original operation with the same request ID
|
3809
|
+
# was received, and if so, ignores the second request. This prevents
|
3587
3810
|
# clients from accidentally creating duplicate commitments.
|
3588
3811
|
#
|
3589
3812
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
@@ -3657,6 +3880,109 @@ module Google
|
|
3657
3880
|
raise ::Google::Cloud::Error.from_error(e)
|
3658
3881
|
end
|
3659
3882
|
|
3883
|
+
##
|
3884
|
+
# Lists Databases in a given project and location.
|
3885
|
+
#
|
3886
|
+
# @overload list_databases(request, options = nil)
|
3887
|
+
# Pass arguments to `list_databases` via a request object, either of type
|
3888
|
+
# {::Google::Cloud::AlloyDB::V1::ListDatabasesRequest} or an equivalent Hash.
|
3889
|
+
#
|
3890
|
+
# @param request [::Google::Cloud::AlloyDB::V1::ListDatabasesRequest, ::Hash]
|
3891
|
+
# A request object representing the call parameters. Required. To specify no
|
3892
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3893
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3894
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
3895
|
+
#
|
3896
|
+
# @overload list_databases(parent: nil, page_size: nil, page_token: nil, filter: nil)
|
3897
|
+
# Pass arguments to `list_databases` via keyword arguments. Note that at
|
3898
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3899
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3900
|
+
#
|
3901
|
+
# @param parent [::String]
|
3902
|
+
# Required. Parent value for ListDatabasesRequest.
|
3903
|
+
# @param page_size [::Integer]
|
3904
|
+
# Optional. The maximum number of databases to return. The service may return
|
3905
|
+
# fewer than this value. If unspecified, 2000 is the default page_size. The
|
3906
|
+
# max value of page_size will be 4000, values above max will be coerced to
|
3907
|
+
# max.
|
3908
|
+
# @param page_token [::String]
|
3909
|
+
# Optional. A page token, received from a previous `ListDatabases` call.
|
3910
|
+
# This should be provided to retrieve the subsequent page.
|
3911
|
+
# This field is currently not supported, its value will be ignored if passed.
|
3912
|
+
# @param filter [::String]
|
3913
|
+
# Optional. Filtering results.
|
3914
|
+
# This field is currently not supported, its value will be ignored if passed.
|
3915
|
+
#
|
3916
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
3917
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1::Database>]
|
3918
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
3919
|
+
#
|
3920
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1::Database>]
|
3921
|
+
#
|
3922
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
3923
|
+
#
|
3924
|
+
# @example Basic example
|
3925
|
+
# require "google/cloud/alloy_db/v1"
|
3926
|
+
#
|
3927
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3928
|
+
# client = Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new
|
3929
|
+
#
|
3930
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3931
|
+
# request = Google::Cloud::AlloyDB::V1::ListDatabasesRequest.new
|
3932
|
+
#
|
3933
|
+
# # Call the list_databases method.
|
3934
|
+
# result = client.list_databases request
|
3935
|
+
#
|
3936
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
3937
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
3938
|
+
# result.each do |item|
|
3939
|
+
# # Each element is of type ::Google::Cloud::AlloyDB::V1::Database.
|
3940
|
+
# p item
|
3941
|
+
# end
|
3942
|
+
#
|
3943
|
+
def list_databases request, options = nil
|
3944
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3945
|
+
|
3946
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1::ListDatabasesRequest
|
3947
|
+
|
3948
|
+
# Converts hash and nil to an options object
|
3949
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3950
|
+
|
3951
|
+
# Customize the options with defaults
|
3952
|
+
metadata = @config.rpcs.list_databases.metadata.to_h
|
3953
|
+
|
3954
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3955
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3956
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3957
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1::VERSION
|
3958
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3959
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3960
|
+
|
3961
|
+
header_params = {}
|
3962
|
+
if request.parent
|
3963
|
+
header_params["parent"] = request.parent
|
3964
|
+
end
|
3965
|
+
|
3966
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
3967
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
3968
|
+
|
3969
|
+
options.apply_defaults timeout: @config.rpcs.list_databases.timeout,
|
3970
|
+
metadata: metadata,
|
3971
|
+
retry_policy: @config.rpcs.list_databases.retry_policy
|
3972
|
+
|
3973
|
+
options.apply_defaults timeout: @config.timeout,
|
3974
|
+
metadata: @config.metadata,
|
3975
|
+
retry_policy: @config.retry_policy
|
3976
|
+
|
3977
|
+
@alloy_db_admin_stub.call_rpc :list_databases, request, options: options do |response, operation|
|
3978
|
+
response = ::Gapic::PagedEnumerable.new @alloy_db_admin_stub, :list_databases, request, response, operation, options
|
3979
|
+
yield response, operation if block_given?
|
3980
|
+
return response
|
3981
|
+
end
|
3982
|
+
rescue ::GRPC::BadStatus => e
|
3983
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3984
|
+
end
|
3985
|
+
|
3660
3986
|
##
|
3661
3987
|
# Configuration class for the AlloyDBAdmin API.
|
3662
3988
|
#
|
@@ -3841,6 +4167,11 @@ module Google
|
|
3841
4167
|
#
|
3842
4168
|
attr_reader :promote_cluster
|
3843
4169
|
##
|
4170
|
+
# RPC-specific configuration for `switchover_cluster`
|
4171
|
+
# @return [::Gapic::Config::Method]
|
4172
|
+
#
|
4173
|
+
attr_reader :switchover_cluster
|
4174
|
+
##
|
3844
4175
|
# RPC-specific configuration for `restore_cluster`
|
3845
4176
|
# @return [::Gapic::Config::Method]
|
3846
4177
|
#
|
@@ -3901,6 +4232,11 @@ module Google
|
|
3901
4232
|
#
|
3902
4233
|
attr_reader :restart_instance
|
3903
4234
|
##
|
4235
|
+
# RPC-specific configuration for `execute_sql`
|
4236
|
+
# @return [::Gapic::Config::Method]
|
4237
|
+
#
|
4238
|
+
attr_reader :execute_sql
|
4239
|
+
##
|
3904
4240
|
# RPC-specific configuration for `list_backups`
|
3905
4241
|
# @return [::Gapic::Config::Method]
|
3906
4242
|
#
|
@@ -3965,6 +4301,11 @@ module Google
|
|
3965
4301
|
# @return [::Gapic::Config::Method]
|
3966
4302
|
#
|
3967
4303
|
attr_reader :delete_user
|
4304
|
+
##
|
4305
|
+
# RPC-specific configuration for `list_databases`
|
4306
|
+
# @return [::Gapic::Config::Method]
|
4307
|
+
#
|
4308
|
+
attr_reader :list_databases
|
3968
4309
|
|
3969
4310
|
# @private
|
3970
4311
|
def initialize parent_rpcs = nil
|
@@ -3980,6 +4321,8 @@ module Google
|
|
3980
4321
|
@delete_cluster = ::Gapic::Config::Method.new delete_cluster_config
|
3981
4322
|
promote_cluster_config = parent_rpcs.promote_cluster if parent_rpcs.respond_to? :promote_cluster
|
3982
4323
|
@promote_cluster = ::Gapic::Config::Method.new promote_cluster_config
|
4324
|
+
switchover_cluster_config = parent_rpcs.switchover_cluster if parent_rpcs.respond_to? :switchover_cluster
|
4325
|
+
@switchover_cluster = ::Gapic::Config::Method.new switchover_cluster_config
|
3983
4326
|
restore_cluster_config = parent_rpcs.restore_cluster if parent_rpcs.respond_to? :restore_cluster
|
3984
4327
|
@restore_cluster = ::Gapic::Config::Method.new restore_cluster_config
|
3985
4328
|
create_secondary_cluster_config = parent_rpcs.create_secondary_cluster if parent_rpcs.respond_to? :create_secondary_cluster
|
@@ -4004,6 +4347,8 @@ module Google
|
|
4004
4347
|
@inject_fault = ::Gapic::Config::Method.new inject_fault_config
|
4005
4348
|
restart_instance_config = parent_rpcs.restart_instance if parent_rpcs.respond_to? :restart_instance
|
4006
4349
|
@restart_instance = ::Gapic::Config::Method.new restart_instance_config
|
4350
|
+
execute_sql_config = parent_rpcs.execute_sql if parent_rpcs.respond_to? :execute_sql
|
4351
|
+
@execute_sql = ::Gapic::Config::Method.new execute_sql_config
|
4007
4352
|
list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
|
4008
4353
|
@list_backups = ::Gapic::Config::Method.new list_backups_config
|
4009
4354
|
get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
|
@@ -4030,6 +4375,8 @@ module Google
|
|
4030
4375
|
@update_user = ::Gapic::Config::Method.new update_user_config
|
4031
4376
|
delete_user_config = parent_rpcs.delete_user if parent_rpcs.respond_to? :delete_user
|
4032
4377
|
@delete_user = ::Gapic::Config::Method.new delete_user_config
|
4378
|
+
list_databases_config = parent_rpcs.list_databases if parent_rpcs.respond_to? :list_databases
|
4379
|
+
@list_databases = ::Gapic::Config::Method.new list_databases_config
|
4033
4380
|
|
4034
4381
|
yield self if block_given?
|
4035
4382
|
end
|