google-cloud-alloy_db-v1beta 0.a → 0.1.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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/client.rb +3304 -0
  6. data/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/credentials.rb +47 -0
  7. data/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/operations.rb +768 -0
  8. data/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/paths.rb +149 -0
  9. data/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/client.rb +2586 -0
  10. data/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/operations.rb +792 -0
  11. data/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/service_stub.rb +1537 -0
  12. data/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest.rb +54 -0
  13. data/lib/google/cloud/alloy_db/v1beta/alloy_db_admin.rb +56 -0
  14. data/lib/google/cloud/alloy_db/v1beta/bindings_override.rb +102 -0
  15. data/lib/google/cloud/alloy_db/v1beta/rest.rb +38 -0
  16. data/lib/google/cloud/alloy_db/v1beta/version.rb +8 -3
  17. data/lib/google/cloud/alloy_db/v1beta.rb +45 -0
  18. data/lib/google/cloud/alloydb/v1beta/resources_pb.rb +338 -0
  19. data/lib/google/cloud/alloydb/v1beta/service_pb.rb +279 -0
  20. data/lib/google/cloud/alloydb/v1beta/service_services_pb.rb +115 -0
  21. data/lib/google-cloud-alloy_db-v1beta.rb +21 -0
  22. data/proto_docs/README.md +4 -0
  23. data/proto_docs/google/api/client.rb +324 -0
  24. data/proto_docs/google/api/field_behavior.rb +71 -0
  25. data/proto_docs/google/api/launch_stage.rb +71 -0
  26. data/proto_docs/google/api/resource.rb +222 -0
  27. data/proto_docs/google/cloud/alloydb/v1beta/resources.rb +1068 -0
  28. data/proto_docs/google/cloud/alloydb/v1beta/service.rb +998 -0
  29. data/proto_docs/google/longrunning/operations.rb +164 -0
  30. data/proto_docs/google/protobuf/any.rb +141 -0
  31. data/proto_docs/google/protobuf/duration.rb +98 -0
  32. data/proto_docs/google/protobuf/empty.rb +34 -0
  33. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  34. data/proto_docs/google/protobuf/timestamp.rb +129 -0
  35. data/proto_docs/google/protobuf/wrappers.rb +121 -0
  36. data/proto_docs/google/rpc/status.rb +48 -0
  37. data/proto_docs/google/type/dayofweek.rb +49 -0
  38. data/proto_docs/google/type/expr.rb +75 -0
  39. data/proto_docs/google/type/timeofday.rb +45 -0
  40. metadata +250 -12
@@ -0,0 +1,2586 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/alloydb/v1beta/service_pb"
21
+ require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+ require "google/iam/v1/rest"
24
+
25
+ module Google
26
+ module Cloud
27
+ module AlloyDB
28
+ module V1beta
29
+ module AlloyDBAdmin
30
+ module Rest
31
+ ##
32
+ # REST client for the AlloyDBAdmin service.
33
+ #
34
+ # Service describing handlers for resources
35
+ #
36
+ class Client
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :alloy_db_admin_stub
41
+
42
+ ##
43
+ # Configure the AlloyDBAdmin Client class.
44
+ #
45
+ # See {::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all AlloyDBAdmin clients
51
+ # ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "AlloyDB", "V1beta"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config.timeout = 60.0
72
+
73
+ default_config.rpcs.list_clusters.timeout = 60.0
74
+ default_config.rpcs.list_clusters.retry_policy = {
75
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
76
+ }
77
+
78
+ default_config.rpcs.get_cluster.timeout = 60.0
79
+ default_config.rpcs.get_cluster.retry_policy = {
80
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
81
+ }
82
+
83
+ default_config.rpcs.list_instances.timeout = 60.0
84
+ default_config.rpcs.list_instances.retry_policy = {
85
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
86
+ }
87
+
88
+ default_config.rpcs.get_instance.timeout = 60.0
89
+ default_config.rpcs.get_instance.retry_policy = {
90
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
91
+ }
92
+
93
+ default_config.rpcs.list_backups.timeout = 60.0
94
+ default_config.rpcs.list_backups.retry_policy = {
95
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
96
+ }
97
+
98
+ default_config.rpcs.get_backup.timeout = 60.0
99
+ default_config.rpcs.get_backup.retry_policy = {
100
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
101
+ }
102
+
103
+ default_config.rpcs.list_supported_database_flags.timeout = 60.0
104
+ default_config.rpcs.list_supported_database_flags.retry_policy = {
105
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
106
+ }
107
+
108
+ default_config.rpcs.generate_client_certificate.timeout = 60.0
109
+ default_config.rpcs.generate_client_certificate.retry_policy = {
110
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
111
+ }
112
+
113
+ default_config.rpcs.get_connection_info.timeout = 60.0
114
+ default_config.rpcs.get_connection_info.retry_policy = {
115
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
116
+ }
117
+
118
+ default_config
119
+ end
120
+ yield @configure if block_given?
121
+ @configure
122
+ end
123
+
124
+ ##
125
+ # Configure the AlloyDBAdmin Client instance.
126
+ #
127
+ # The configuration is set to the derived mode, meaning that values can be changed,
128
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
129
+ # should be made on {Client.configure}.
130
+ #
131
+ # See {::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client::Configuration}
132
+ # for a description of the configuration fields.
133
+ #
134
+ # @yield [config] Configure the Client client.
135
+ # @yieldparam config [Client::Configuration]
136
+ #
137
+ # @return [Client::Configuration]
138
+ #
139
+ def configure
140
+ yield @config if block_given?
141
+ @config
142
+ end
143
+
144
+ ##
145
+ # Create a new AlloyDBAdmin REST client object.
146
+ #
147
+ # @example
148
+ #
149
+ # # Create a client using the default configuration
150
+ # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new
151
+ #
152
+ # # Create a client using a custom configuration
153
+ # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config|
154
+ # config.timeout = 10.0
155
+ # end
156
+ #
157
+ # @yield [config] Configure the AlloyDBAdmin client.
158
+ # @yieldparam config [Client::Configuration]
159
+ #
160
+ def initialize
161
+ # Create the configuration object
162
+ @config = Configuration.new Client.configure
163
+
164
+ # Yield the configuration if needed
165
+ yield @config if block_given?
166
+
167
+ # Create credentials
168
+ credentials = @config.credentials
169
+ # Use self-signed JWT if the endpoint is unchanged from default,
170
+ # but only if the default endpoint does not have a region prefix.
171
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
172
+ !@config.endpoint.split(".").first.include?("-")
173
+ credentials ||= Credentials.default scope: @config.scope,
174
+ enable_self_signed_jwt: enable_self_signed_jwt
175
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
176
+ credentials = Credentials.new credentials, scope: @config.scope
177
+ end
178
+
179
+ @quota_project_id = @config.quota_project
180
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
181
+
182
+ @operations_client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Operations.new do |config|
183
+ config.credentials = credentials
184
+ config.quota_project = @quota_project_id
185
+ config.endpoint = @config.endpoint
186
+ end
187
+
188
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
189
+ config.credentials = credentials
190
+ config.quota_project = @quota_project_id
191
+ config.endpoint = @config.endpoint
192
+ config.bindings_override = @config.bindings_override
193
+ end
194
+
195
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
196
+ config.credentials = credentials
197
+ config.quota_project = @quota_project_id
198
+ config.endpoint = @config.endpoint
199
+ end
200
+
201
+ @alloy_db_admin_stub = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
202
+ end
203
+
204
+ ##
205
+ # Get the associated client for long-running operations.
206
+ #
207
+ # @return [::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Operations]
208
+ #
209
+ attr_reader :operations_client
210
+
211
+ ##
212
+ # Get the associated client for mix-in of the Locations.
213
+ #
214
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
215
+ #
216
+ attr_reader :location_client
217
+
218
+ ##
219
+ # Get the associated client for mix-in of the IAMPolicy.
220
+ #
221
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
222
+ #
223
+ attr_reader :iam_policy_client
224
+
225
+ # Service calls
226
+
227
+ ##
228
+ # Lists Clusters in a given project and location.
229
+ #
230
+ # @overload list_clusters(request, options = nil)
231
+ # Pass arguments to `list_clusters` via a request object, either of type
232
+ # {::Google::Cloud::AlloyDB::V1beta::ListClustersRequest} or an equivalent Hash.
233
+ #
234
+ # @param request [::Google::Cloud::AlloyDB::V1beta::ListClustersRequest, ::Hash]
235
+ # A request object representing the call parameters. Required. To specify no
236
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
237
+ # @param options [::Gapic::CallOptions, ::Hash]
238
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
239
+ #
240
+ # @overload list_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
241
+ # Pass arguments to `list_clusters` via keyword arguments. Note that at
242
+ # least one keyword argument is required. To specify no parameters, or to keep all
243
+ # the default parameter values, pass an empty Hash as a request object (see above).
244
+ #
245
+ # @param parent [::String]
246
+ # Required. The name of the parent resource. For the required format, see the
247
+ # comment on the Cluster.name field. Additionally, you can perform an
248
+ # aggregated list operation by specifying a value with the following format:
249
+ # * projects/\\{project}/locations/-
250
+ # @param page_size [::Integer]
251
+ # Optional. Requested page size. Server may return fewer items than
252
+ # requested. If unspecified, server will pick an appropriate default.
253
+ # @param page_token [::String]
254
+ # A token identifying a page of results the server should return.
255
+ # @param filter [::String]
256
+ # Optional. Filtering results
257
+ # @param order_by [::String]
258
+ # Optional. Hint for how to order the results
259
+ # @yield [result, operation] Access the result along with the TransportOperation object
260
+ # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::ListClustersResponse]
261
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
262
+ #
263
+ # @return [::Google::Cloud::AlloyDB::V1beta::ListClustersResponse]
264
+ #
265
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
266
+ def list_clusters request, options = nil
267
+ raise ::ArgumentError, "request must be provided" if request.nil?
268
+
269
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ListClustersRequest
270
+
271
+ # Converts hash and nil to an options object
272
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
273
+
274
+ # Customize the options with defaults
275
+ call_metadata = @config.rpcs.list_clusters.metadata.to_h
276
+
277
+ # Set x-goog-api-client and x-goog-user-project headers
278
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
279
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
280
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
281
+ transports_version_send: [:rest]
282
+
283
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
284
+
285
+ options.apply_defaults timeout: @config.rpcs.list_clusters.timeout,
286
+ metadata: call_metadata,
287
+ retry_policy: @config.rpcs.list_clusters.retry_policy
288
+
289
+ options.apply_defaults timeout: @config.timeout,
290
+ metadata: @config.metadata,
291
+ retry_policy: @config.retry_policy
292
+
293
+ @alloy_db_admin_stub.list_clusters request, options do |result, operation|
294
+ yield result, operation if block_given?
295
+ return result
296
+ end
297
+ rescue ::Gapic::Rest::Error => e
298
+ raise ::Google::Cloud::Error.from_error(e)
299
+ end
300
+
301
+ ##
302
+ # Gets details of a single Cluster.
303
+ #
304
+ # @overload get_cluster(request, options = nil)
305
+ # Pass arguments to `get_cluster` via a request object, either of type
306
+ # {::Google::Cloud::AlloyDB::V1beta::GetClusterRequest} or an equivalent Hash.
307
+ #
308
+ # @param request [::Google::Cloud::AlloyDB::V1beta::GetClusterRequest, ::Hash]
309
+ # A request object representing the call parameters. Required. To specify no
310
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
311
+ # @param options [::Gapic::CallOptions, ::Hash]
312
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
313
+ #
314
+ # @overload get_cluster(name: nil)
315
+ # Pass arguments to `get_cluster` via keyword arguments. Note that at
316
+ # least one keyword argument is required. To specify no parameters, or to keep all
317
+ # the default parameter values, pass an empty Hash as a request object (see above).
318
+ #
319
+ # @param name [::String]
320
+ # Required. The name of the resource. For the required format, see the
321
+ # comment on the Cluster.name field.
322
+ # @yield [result, operation] Access the result along with the TransportOperation object
323
+ # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::Cluster]
324
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
325
+ #
326
+ # @return [::Google::Cloud::AlloyDB::V1beta::Cluster]
327
+ #
328
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
329
+ def get_cluster request, options = nil
330
+ raise ::ArgumentError, "request must be provided" if request.nil?
331
+
332
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GetClusterRequest
333
+
334
+ # Converts hash and nil to an options object
335
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
336
+
337
+ # Customize the options with defaults
338
+ call_metadata = @config.rpcs.get_cluster.metadata.to_h
339
+
340
+ # Set x-goog-api-client and x-goog-user-project headers
341
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
342
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
343
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
344
+ transports_version_send: [:rest]
345
+
346
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
347
+
348
+ options.apply_defaults timeout: @config.rpcs.get_cluster.timeout,
349
+ metadata: call_metadata,
350
+ retry_policy: @config.rpcs.get_cluster.retry_policy
351
+
352
+ options.apply_defaults timeout: @config.timeout,
353
+ metadata: @config.metadata,
354
+ retry_policy: @config.retry_policy
355
+
356
+ @alloy_db_admin_stub.get_cluster request, options do |result, operation|
357
+ yield result, operation if block_given?
358
+ return result
359
+ end
360
+ rescue ::Gapic::Rest::Error => e
361
+ raise ::Google::Cloud::Error.from_error(e)
362
+ end
363
+
364
+ ##
365
+ # Creates a new Cluster in a given project and location.
366
+ #
367
+ # @overload create_cluster(request, options = nil)
368
+ # Pass arguments to `create_cluster` via a request object, either of type
369
+ # {::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest} or an equivalent Hash.
370
+ #
371
+ # @param request [::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest, ::Hash]
372
+ # A request object representing the call parameters. Required. To specify no
373
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
374
+ # @param options [::Gapic::CallOptions, ::Hash]
375
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
376
+ #
377
+ # @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil)
378
+ # Pass arguments to `create_cluster` via keyword arguments. Note that at
379
+ # least one keyword argument is required. To specify no parameters, or to keep all
380
+ # the default parameter values, pass an empty Hash as a request object (see above).
381
+ #
382
+ # @param parent [::String]
383
+ # Required. The name of the parent resource. For the required format, see the
384
+ # comment on the Cluster.name field.
385
+ # @param cluster_id [::String]
386
+ # Required. ID of the requesting object.
387
+ # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::Hash]
388
+ # Required. The resource being created
389
+ # @param request_id [::String]
390
+ # Optional. An optional request ID to identify requests. Specify a unique
391
+ # request ID so that if you must retry your request, the server will know to
392
+ # ignore the request if it has already been completed. The server will
393
+ # guarantee that for at least 60 minutes since the first request.
394
+ #
395
+ # For example, consider a situation where you make an initial request and
396
+ # the request times out. If you make the request again with the same request
397
+ # ID, the server can check if original operation with the same request ID
398
+ # was received, and if so, will ignore the second request. This prevents
399
+ # clients from accidentally creating duplicate commitments.
400
+ #
401
+ # The request ID must be a valid UUID with the exception that zero UUID is
402
+ # not supported (00000000-0000-0000-0000-000000000000).
403
+ # @param validate_only [::Boolean]
404
+ # Optional. If set, performs request validation (e.g. permission checks and
405
+ # any other type of validation), but do not actually execute the create
406
+ # request.
407
+ # @yield [result, operation] Access the result along with the TransportOperation object
408
+ # @yieldparam result [::Gapic::Operation]
409
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
410
+ #
411
+ # @return [::Gapic::Operation]
412
+ #
413
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
414
+ def create_cluster request, options = nil
415
+ raise ::ArgumentError, "request must be provided" if request.nil?
416
+
417
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest
418
+
419
+ # Converts hash and nil to an options object
420
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
421
+
422
+ # Customize the options with defaults
423
+ call_metadata = @config.rpcs.create_cluster.metadata.to_h
424
+
425
+ # Set x-goog-api-client and x-goog-user-project headers
426
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
427
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
428
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
429
+ transports_version_send: [:rest]
430
+
431
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
432
+
433
+ options.apply_defaults timeout: @config.rpcs.create_cluster.timeout,
434
+ metadata: call_metadata,
435
+ retry_policy: @config.rpcs.create_cluster.retry_policy
436
+
437
+ options.apply_defaults timeout: @config.timeout,
438
+ metadata: @config.metadata,
439
+ retry_policy: @config.retry_policy
440
+
441
+ @alloy_db_admin_stub.create_cluster request, options do |result, operation|
442
+ result = ::Gapic::Operation.new result, @operations_client, options: options
443
+ yield result, operation if block_given?
444
+ return result
445
+ end
446
+ rescue ::Gapic::Rest::Error => e
447
+ raise ::Google::Cloud::Error.from_error(e)
448
+ end
449
+
450
+ ##
451
+ # Updates the parameters of a single Cluster.
452
+ #
453
+ # @overload update_cluster(request, options = nil)
454
+ # Pass arguments to `update_cluster` via a request object, either of type
455
+ # {::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest} or an equivalent Hash.
456
+ #
457
+ # @param request [::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest, ::Hash]
458
+ # A request object representing the call parameters. Required. To specify no
459
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
460
+ # @param options [::Gapic::CallOptions, ::Hash]
461
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
462
+ #
463
+ # @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil, validate_only: nil, allow_missing: nil)
464
+ # Pass arguments to `update_cluster` via keyword arguments. Note that at
465
+ # least one keyword argument is required. To specify no parameters, or to keep all
466
+ # the default parameter values, pass an empty Hash as a request object (see above).
467
+ #
468
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
469
+ # Optional. Field mask is used to specify the fields to be overwritten in the
470
+ # Cluster resource by the update.
471
+ # The fields specified in the update_mask are relative to the resource, not
472
+ # the full request. A field will be overwritten if it is in the mask. If the
473
+ # user does not provide a mask then all fields will be overwritten.
474
+ # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::Hash]
475
+ # Required. The resource being updated
476
+ # @param request_id [::String]
477
+ # Optional. An optional request ID to identify requests. Specify a unique
478
+ # request ID so that if you must retry your request, the server will know to
479
+ # ignore the request if it has already been completed. The server will
480
+ # guarantee that for at least 60 minutes since the first request.
481
+ #
482
+ # For example, consider a situation where you make an initial request and
483
+ # the request times out. If you make the request again with the same request
484
+ # ID, the server can check if original operation with the same request ID
485
+ # was received, and if so, will ignore the second request. This prevents
486
+ # clients from accidentally creating duplicate commitments.
487
+ #
488
+ # The request ID must be a valid UUID with the exception that zero UUID is
489
+ # not supported (00000000-0000-0000-0000-000000000000).
490
+ # @param validate_only [::Boolean]
491
+ # Optional. If set, performs request validation (e.g. permission checks and
492
+ # any other type of validation), but do not actually execute the update
493
+ # request.
494
+ # @param allow_missing [::Boolean]
495
+ # Optional. If set to true, update succeeds even if cluster is not found. In
496
+ # that case, a new cluster is created and `update_mask` is ignored.
497
+ # @yield [result, operation] Access the result along with the TransportOperation object
498
+ # @yieldparam result [::Gapic::Operation]
499
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
500
+ #
501
+ # @return [::Gapic::Operation]
502
+ #
503
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
504
+ def update_cluster request, options = nil
505
+ raise ::ArgumentError, "request must be provided" if request.nil?
506
+
507
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest
508
+
509
+ # Converts hash and nil to an options object
510
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
511
+
512
+ # Customize the options with defaults
513
+ call_metadata = @config.rpcs.update_cluster.metadata.to_h
514
+
515
+ # Set x-goog-api-client and x-goog-user-project headers
516
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
517
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
518
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
519
+ transports_version_send: [:rest]
520
+
521
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
522
+
523
+ options.apply_defaults timeout: @config.rpcs.update_cluster.timeout,
524
+ metadata: call_metadata,
525
+ retry_policy: @config.rpcs.update_cluster.retry_policy
526
+
527
+ options.apply_defaults timeout: @config.timeout,
528
+ metadata: @config.metadata,
529
+ retry_policy: @config.retry_policy
530
+
531
+ @alloy_db_admin_stub.update_cluster request, options do |result, operation|
532
+ result = ::Gapic::Operation.new result, @operations_client, options: options
533
+ yield result, operation if block_given?
534
+ return result
535
+ end
536
+ rescue ::Gapic::Rest::Error => e
537
+ raise ::Google::Cloud::Error.from_error(e)
538
+ end
539
+
540
+ ##
541
+ # Deletes a single Cluster.
542
+ #
543
+ # @overload delete_cluster(request, options = nil)
544
+ # Pass arguments to `delete_cluster` via a request object, either of type
545
+ # {::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest} or an equivalent Hash.
546
+ #
547
+ # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest, ::Hash]
548
+ # A request object representing the call parameters. Required. To specify no
549
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
550
+ # @param options [::Gapic::CallOptions, ::Hash]
551
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
552
+ #
553
+ # @overload delete_cluster(name: nil, request_id: nil, etag: nil, validate_only: nil, force: nil)
554
+ # Pass arguments to `delete_cluster` via keyword arguments. Note that at
555
+ # least one keyword argument is required. To specify no parameters, or to keep all
556
+ # the default parameter values, pass an empty Hash as a request object (see above).
557
+ #
558
+ # @param name [::String]
559
+ # Required. The name of the resource. For the required format, see the
560
+ # comment on the Cluster.name field.
561
+ # @param request_id [::String]
562
+ # Optional. An optional request ID to identify requests. Specify a unique
563
+ # request ID so that if you must retry your request, the server will know to
564
+ # ignore the request if it has already been completed. The server will
565
+ # guarantee that for at least 60 minutes after the first request.
566
+ #
567
+ # For example, consider a situation where you make an initial request and
568
+ # the request times out. If you make the request again with the same request
569
+ # ID, the server can check if original operation with the same request ID
570
+ # was received, and if so, will ignore the second request. This prevents
571
+ # clients from accidentally creating duplicate commitments.
572
+ #
573
+ # The request ID must be a valid UUID with the exception that zero UUID is
574
+ # not supported (00000000-0000-0000-0000-000000000000).
575
+ # @param etag [::String]
576
+ # Optional. The current etag of the Cluster.
577
+ # If an etag is provided and does not match the current etag of the Cluster,
578
+ # deletion will be blocked and an ABORTED error will be returned.
579
+ # @param validate_only [::Boolean]
580
+ # Optional. If set, performs request validation (e.g. permission checks and
581
+ # any other type of validation), but do not actually execute the delete.
582
+ # @param force [::Boolean]
583
+ # Optional. Whether to cascade delete child instances for given cluster.
584
+ # @yield [result, operation] Access the result along with the TransportOperation object
585
+ # @yieldparam result [::Gapic::Operation]
586
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
587
+ #
588
+ # @return [::Gapic::Operation]
589
+ #
590
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
591
+ def delete_cluster request, options = nil
592
+ raise ::ArgumentError, "request must be provided" if request.nil?
593
+
594
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest
595
+
596
+ # Converts hash and nil to an options object
597
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
598
+
599
+ # Customize the options with defaults
600
+ call_metadata = @config.rpcs.delete_cluster.metadata.to_h
601
+
602
+ # Set x-goog-api-client and x-goog-user-project headers
603
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
604
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
605
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
606
+ transports_version_send: [:rest]
607
+
608
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
609
+
610
+ options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout,
611
+ metadata: call_metadata,
612
+ retry_policy: @config.rpcs.delete_cluster.retry_policy
613
+
614
+ options.apply_defaults timeout: @config.timeout,
615
+ metadata: @config.metadata,
616
+ retry_policy: @config.retry_policy
617
+
618
+ @alloy_db_admin_stub.delete_cluster request, options do |result, operation|
619
+ result = ::Gapic::Operation.new result, @operations_client, options: options
620
+ yield result, operation if block_given?
621
+ return result
622
+ end
623
+ rescue ::Gapic::Rest::Error => e
624
+ raise ::Google::Cloud::Error.from_error(e)
625
+ end
626
+
627
+ ##
628
+ # Promotes a SECONDARY cluster. This turns down replication
629
+ # from the PRIMARY cluster and promotes a secondary cluster
630
+ # into its own standalone cluster.
631
+ # Imperative only.
632
+ #
633
+ # @overload promote_cluster(request, options = nil)
634
+ # Pass arguments to `promote_cluster` via a request object, either of type
635
+ # {::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest} or an equivalent Hash.
636
+ #
637
+ # @param request [::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest, ::Hash]
638
+ # A request object representing the call parameters. Required. To specify no
639
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
640
+ # @param options [::Gapic::CallOptions, ::Hash]
641
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
642
+ #
643
+ # @overload promote_cluster(name: nil, request_id: nil, etag: nil, validate_only: nil)
644
+ # Pass arguments to `promote_cluster` via keyword arguments. Note that at
645
+ # least one keyword argument is required. To specify no parameters, or to keep all
646
+ # the default parameter values, pass an empty Hash as a request object (see above).
647
+ #
648
+ # @param name [::String]
649
+ # Required. The name of the resource. For the required format, see the
650
+ # comment on the Cluster.name field
651
+ # @param request_id [::String]
652
+ # Optional. An optional request ID to identify requests. Specify a unique
653
+ # request ID so that if you must retry your request, the server will know to
654
+ # ignore the request if it has already been completed. The server will
655
+ # guarantee that for at least 60 minutes after the first request.
656
+ #
657
+ # For example, consider a situation where you make an initial request and
658
+ # the request times out. If you make the request again with the same request
659
+ # ID, the server can check if original operation with the same request ID
660
+ # was received, and if so, will ignore the second request. This prevents
661
+ # clients from accidentally creating duplicate commitments.
662
+ #
663
+ # The request ID must be a valid UUID with the exception that zero UUID is
664
+ # not supported (00000000-0000-0000-0000-000000000000).
665
+ # @param etag [::String]
666
+ # Optional. The current etag of the Cluster.
667
+ # If an etag is provided and does not match the current etag of the Cluster,
668
+ # deletion will be blocked and an ABORTED error will be returned.
669
+ # @param validate_only [::Boolean]
670
+ # Optional. If set, performs request validation (e.g. permission checks and
671
+ # any other type of validation), but do not actually execute the delete.
672
+ # @yield [result, operation] Access the result along with the TransportOperation object
673
+ # @yieldparam result [::Gapic::Operation]
674
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
675
+ #
676
+ # @return [::Gapic::Operation]
677
+ #
678
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
679
+ def promote_cluster request, options = nil
680
+ raise ::ArgumentError, "request must be provided" if request.nil?
681
+
682
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest
683
+
684
+ # Converts hash and nil to an options object
685
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
686
+
687
+ # Customize the options with defaults
688
+ call_metadata = @config.rpcs.promote_cluster.metadata.to_h
689
+
690
+ # Set x-goog-api-client and x-goog-user-project headers
691
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
692
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
693
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
694
+ transports_version_send: [:rest]
695
+
696
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
697
+
698
+ options.apply_defaults timeout: @config.rpcs.promote_cluster.timeout,
699
+ metadata: call_metadata,
700
+ retry_policy: @config.rpcs.promote_cluster.retry_policy
701
+
702
+ options.apply_defaults timeout: @config.timeout,
703
+ metadata: @config.metadata,
704
+ retry_policy: @config.retry_policy
705
+
706
+ @alloy_db_admin_stub.promote_cluster request, options do |result, operation|
707
+ result = ::Gapic::Operation.new result, @operations_client, options: options
708
+ yield result, operation if block_given?
709
+ return result
710
+ end
711
+ rescue ::Gapic::Rest::Error => e
712
+ raise ::Google::Cloud::Error.from_error(e)
713
+ end
714
+
715
+ ##
716
+ # Creates a new Cluster in a given project and location, with a volume
717
+ # restored from the provided source, either a backup ID or a point-in-time
718
+ # and a source cluster.
719
+ #
720
+ # @overload restore_cluster(request, options = nil)
721
+ # Pass arguments to `restore_cluster` via a request object, either of type
722
+ # {::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest} or an equivalent Hash.
723
+ #
724
+ # @param request [::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest, ::Hash]
725
+ # A request object representing the call parameters. Required. To specify no
726
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
727
+ # @param options [::Gapic::CallOptions, ::Hash]
728
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
729
+ #
730
+ # @overload restore_cluster(backup_source: nil, continuous_backup_source: nil, parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil)
731
+ # Pass arguments to `restore_cluster` via keyword arguments. Note that at
732
+ # least one keyword argument is required. To specify no parameters, or to keep all
733
+ # the default parameter values, pass an empty Hash as a request object (see above).
734
+ #
735
+ # @param backup_source [::Google::Cloud::AlloyDB::V1beta::BackupSource, ::Hash]
736
+ # Backup source.
737
+ # @param continuous_backup_source [::Google::Cloud::AlloyDB::V1beta::ContinuousBackupSource, ::Hash]
738
+ # ContinuousBackup source. Continuous backup needs to be enabled in the
739
+ # source cluster for this operation to succeed.
740
+ # @param parent [::String]
741
+ # Required. The name of the parent resource. For the required format, see the
742
+ # comment on the Cluster.name field.
743
+ # @param cluster_id [::String]
744
+ # Required. ID of the requesting object.
745
+ # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::Hash]
746
+ # Required. The resource being created
747
+ # @param request_id [::String]
748
+ # Optional. An optional request ID to identify requests. Specify a unique
749
+ # request ID so that if you must retry your request, the server will know to
750
+ # ignore the request if it has already been completed. The server will
751
+ # guarantee that for at least 60 minutes since the first request.
752
+ #
753
+ # For example, consider a situation where you make an initial request and
754
+ # the request times out. If you make the request again with the same request
755
+ # ID, the server can check if original operation with the same request ID
756
+ # was received, and if so, will ignore the second request. This prevents
757
+ # clients from accidentally creating duplicate commitments.
758
+ #
759
+ # The request ID must be a valid UUID with the exception that zero UUID is
760
+ # not supported (00000000-0000-0000-0000-000000000000).
761
+ # @param validate_only [::Boolean]
762
+ # Optional. If set, performs request validation (e.g. permission checks and
763
+ # any other type of validation), but do not actually execute the import
764
+ # request.
765
+ # @yield [result, operation] Access the result along with the TransportOperation object
766
+ # @yieldparam result [::Gapic::Operation]
767
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
768
+ #
769
+ # @return [::Gapic::Operation]
770
+ #
771
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
772
+ def restore_cluster request, options = nil
773
+ raise ::ArgumentError, "request must be provided" if request.nil?
774
+
775
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest
776
+
777
+ # Converts hash and nil to an options object
778
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
779
+
780
+ # Customize the options with defaults
781
+ call_metadata = @config.rpcs.restore_cluster.metadata.to_h
782
+
783
+ # Set x-goog-api-client and x-goog-user-project headers
784
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
785
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
786
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
787
+ transports_version_send: [:rest]
788
+
789
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
790
+
791
+ options.apply_defaults timeout: @config.rpcs.restore_cluster.timeout,
792
+ metadata: call_metadata,
793
+ retry_policy: @config.rpcs.restore_cluster.retry_policy
794
+
795
+ options.apply_defaults timeout: @config.timeout,
796
+ metadata: @config.metadata,
797
+ retry_policy: @config.retry_policy
798
+
799
+ @alloy_db_admin_stub.restore_cluster request, options do |result, operation|
800
+ result = ::Gapic::Operation.new result, @operations_client, options: options
801
+ yield result, operation if block_given?
802
+ return result
803
+ end
804
+ rescue ::Gapic::Rest::Error => e
805
+ raise ::Google::Cloud::Error.from_error(e)
806
+ end
807
+
808
+ ##
809
+ # Creates a cluster of type SECONDARY in the given location using
810
+ # the primary cluster as the source.
811
+ #
812
+ # @overload create_secondary_cluster(request, options = nil)
813
+ # Pass arguments to `create_secondary_cluster` via a request object, either of type
814
+ # {::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest} or an equivalent Hash.
815
+ #
816
+ # @param request [::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest, ::Hash]
817
+ # A request object representing the call parameters. Required. To specify no
818
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
819
+ # @param options [::Gapic::CallOptions, ::Hash]
820
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
821
+ #
822
+ # @overload create_secondary_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil)
823
+ # Pass arguments to `create_secondary_cluster` via keyword arguments. Note that at
824
+ # least one keyword argument is required. To specify no parameters, or to keep all
825
+ # the default parameter values, pass an empty Hash as a request object (see above).
826
+ #
827
+ # @param parent [::String]
828
+ # Required. The name of the parent resource (the primary cluster). For the
829
+ # required format, see the comment on the Cluster.name field.
830
+ # @param cluster_id [::String]
831
+ # Required. ID of the requesting object (the secondary cluster).
832
+ # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::Hash]
833
+ # Required. Configuration of the requesting object (the secondary cluster).
834
+ # @param request_id [::String]
835
+ # Optional. An optional request ID to identify requests. Specify a unique
836
+ # request ID so that if you must retry your request, the server will know to
837
+ # ignore the request if it has already been completed. The server will
838
+ # guarantee that for at least 60 minutes since the first request.
839
+ #
840
+ # For example, consider a situation where you make an initial request and
841
+ # the request times out. If you make the request again with the same request
842
+ # ID, the server can check if original operation with the same request ID
843
+ # was received, and if so, will ignore the second request. This prevents
844
+ # clients from accidentally creating duplicate commitments.
845
+ #
846
+ # The request ID must be a valid UUID with the exception that zero UUID is
847
+ # not supported (00000000-0000-0000-0000-000000000000).
848
+ # @param validate_only [::Boolean]
849
+ # Optional. If set, performs request validation (e.g. permission checks and
850
+ # any other type of validation), but do not actually execute the create
851
+ # request.
852
+ # @yield [result, operation] Access the result along with the TransportOperation object
853
+ # @yieldparam result [::Gapic::Operation]
854
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
855
+ #
856
+ # @return [::Gapic::Operation]
857
+ #
858
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
859
+ def create_secondary_cluster request, options = nil
860
+ raise ::ArgumentError, "request must be provided" if request.nil?
861
+
862
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest
863
+
864
+ # Converts hash and nil to an options object
865
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
866
+
867
+ # Customize the options with defaults
868
+ call_metadata = @config.rpcs.create_secondary_cluster.metadata.to_h
869
+
870
+ # Set x-goog-api-client and x-goog-user-project headers
871
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
872
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
873
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
874
+ transports_version_send: [:rest]
875
+
876
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
877
+
878
+ options.apply_defaults timeout: @config.rpcs.create_secondary_cluster.timeout,
879
+ metadata: call_metadata,
880
+ retry_policy: @config.rpcs.create_secondary_cluster.retry_policy
881
+
882
+ options.apply_defaults timeout: @config.timeout,
883
+ metadata: @config.metadata,
884
+ retry_policy: @config.retry_policy
885
+
886
+ @alloy_db_admin_stub.create_secondary_cluster request, options do |result, operation|
887
+ result = ::Gapic::Operation.new result, @operations_client, options: options
888
+ yield result, operation if block_given?
889
+ return result
890
+ end
891
+ rescue ::Gapic::Rest::Error => e
892
+ raise ::Google::Cloud::Error.from_error(e)
893
+ end
894
+
895
+ ##
896
+ # Lists Instances in a given project and location.
897
+ #
898
+ # @overload list_instances(request, options = nil)
899
+ # Pass arguments to `list_instances` via a request object, either of type
900
+ # {::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest} or an equivalent Hash.
901
+ #
902
+ # @param request [::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest, ::Hash]
903
+ # A request object representing the call parameters. Required. To specify no
904
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
905
+ # @param options [::Gapic::CallOptions, ::Hash]
906
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
907
+ #
908
+ # @overload list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
909
+ # Pass arguments to `list_instances` via keyword arguments. Note that at
910
+ # least one keyword argument is required. To specify no parameters, or to keep all
911
+ # the default parameter values, pass an empty Hash as a request object (see above).
912
+ #
913
+ # @param parent [::String]
914
+ # Required. The name of the parent resource. For the required format, see the
915
+ # comment on the Instance.name field. Additionally, you can perform an
916
+ # aggregated list operation by specifying a value with one of the following
917
+ # formats:
918
+ # * projects/\\{project}/locations/-/clusters/-
919
+ # * projects/\\{project}/locations/\\{region}/clusters/-
920
+ # @param page_size [::Integer]
921
+ # Optional. Requested page size. Server may return fewer items than
922
+ # requested. If unspecified, server will pick an appropriate default.
923
+ # @param page_token [::String]
924
+ # A token identifying a page of results the server should return.
925
+ # @param filter [::String]
926
+ # Optional. Filtering results
927
+ # @param order_by [::String]
928
+ # Optional. Hint for how to order the results
929
+ # @yield [result, operation] Access the result along with the TransportOperation object
930
+ # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::ListInstancesResponse]
931
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
932
+ #
933
+ # @return [::Google::Cloud::AlloyDB::V1beta::ListInstancesResponse]
934
+ #
935
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
936
+ def list_instances request, options = nil
937
+ raise ::ArgumentError, "request must be provided" if request.nil?
938
+
939
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest
940
+
941
+ # Converts hash and nil to an options object
942
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
943
+
944
+ # Customize the options with defaults
945
+ call_metadata = @config.rpcs.list_instances.metadata.to_h
946
+
947
+ # Set x-goog-api-client and x-goog-user-project headers
948
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
949
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
950
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
951
+ transports_version_send: [:rest]
952
+
953
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
954
+
955
+ options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
956
+ metadata: call_metadata,
957
+ retry_policy: @config.rpcs.list_instances.retry_policy
958
+
959
+ options.apply_defaults timeout: @config.timeout,
960
+ metadata: @config.metadata,
961
+ retry_policy: @config.retry_policy
962
+
963
+ @alloy_db_admin_stub.list_instances request, options do |result, operation|
964
+ yield result, operation if block_given?
965
+ return result
966
+ end
967
+ rescue ::Gapic::Rest::Error => e
968
+ raise ::Google::Cloud::Error.from_error(e)
969
+ end
970
+
971
+ ##
972
+ # Gets details of a single Instance.
973
+ #
974
+ # @overload get_instance(request, options = nil)
975
+ # Pass arguments to `get_instance` via a request object, either of type
976
+ # {::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest} or an equivalent Hash.
977
+ #
978
+ # @param request [::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest, ::Hash]
979
+ # A request object representing the call parameters. Required. To specify no
980
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
981
+ # @param options [::Gapic::CallOptions, ::Hash]
982
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
983
+ #
984
+ # @overload get_instance(name: nil, view: nil)
985
+ # Pass arguments to `get_instance` via keyword arguments. Note that at
986
+ # least one keyword argument is required. To specify no parameters, or to keep all
987
+ # the default parameter values, pass an empty Hash as a request object (see above).
988
+ #
989
+ # @param name [::String]
990
+ # Required. The name of the resource. For the required format, see the
991
+ # comment on the Instance.name field.
992
+ # @param view [::Google::Cloud::AlloyDB::V1beta::InstanceView]
993
+ # The view of the instance to return.
994
+ # @yield [result, operation] Access the result along with the TransportOperation object
995
+ # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::Instance]
996
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
997
+ #
998
+ # @return [::Google::Cloud::AlloyDB::V1beta::Instance]
999
+ #
1000
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1001
+ def get_instance request, options = nil
1002
+ raise ::ArgumentError, "request must be provided" if request.nil?
1003
+
1004
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest
1005
+
1006
+ # Converts hash and nil to an options object
1007
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1008
+
1009
+ # Customize the options with defaults
1010
+ call_metadata = @config.rpcs.get_instance.metadata.to_h
1011
+
1012
+ # Set x-goog-api-client and x-goog-user-project headers
1013
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1014
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1015
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
1016
+ transports_version_send: [:rest]
1017
+
1018
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1019
+
1020
+ options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
1021
+ metadata: call_metadata,
1022
+ retry_policy: @config.rpcs.get_instance.retry_policy
1023
+
1024
+ options.apply_defaults timeout: @config.timeout,
1025
+ metadata: @config.metadata,
1026
+ retry_policy: @config.retry_policy
1027
+
1028
+ @alloy_db_admin_stub.get_instance request, options do |result, operation|
1029
+ yield result, operation if block_given?
1030
+ return result
1031
+ end
1032
+ rescue ::Gapic::Rest::Error => e
1033
+ raise ::Google::Cloud::Error.from_error(e)
1034
+ end
1035
+
1036
+ ##
1037
+ # Creates a new Instance in a given project and location.
1038
+ #
1039
+ # @overload create_instance(request, options = nil)
1040
+ # Pass arguments to `create_instance` via a request object, either of type
1041
+ # {::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest} or an equivalent Hash.
1042
+ #
1043
+ # @param request [::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest, ::Hash]
1044
+ # A request object representing the call parameters. Required. To specify no
1045
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1046
+ # @param options [::Gapic::CallOptions, ::Hash]
1047
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1048
+ #
1049
+ # @overload create_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: nil)
1050
+ # Pass arguments to `create_instance` via keyword arguments. Note that at
1051
+ # least one keyword argument is required. To specify no parameters, or to keep all
1052
+ # the default parameter values, pass an empty Hash as a request object (see above).
1053
+ #
1054
+ # @param parent [::String]
1055
+ # Required. The name of the parent resource. For the required format, see the
1056
+ # comment on the Instance.name field.
1057
+ # @param instance_id [::String]
1058
+ # Required. ID of the requesting object.
1059
+ # @param instance [::Google::Cloud::AlloyDB::V1beta::Instance, ::Hash]
1060
+ # Required. The resource being created
1061
+ # @param request_id [::String]
1062
+ # Optional. An optional request ID to identify requests. Specify a unique
1063
+ # request ID so that if you must retry your request, the server will know to
1064
+ # ignore the request if it has already been completed. The server will
1065
+ # guarantee that for at least 60 minutes since the first request.
1066
+ #
1067
+ # For example, consider a situation where you make an initial request and
1068
+ # the request times out. If you make the request again with the same request
1069
+ # ID, the server can check if original operation with the same request ID
1070
+ # was received, and if so, will ignore the second request. This prevents
1071
+ # clients from accidentally creating duplicate commitments.
1072
+ #
1073
+ # The request ID must be a valid UUID with the exception that zero UUID is
1074
+ # not supported (00000000-0000-0000-0000-000000000000).
1075
+ # @param validate_only [::Boolean]
1076
+ # Optional. If set, performs request validation (e.g. permission checks and
1077
+ # any other type of validation), but do not actually execute the create
1078
+ # request.
1079
+ # @yield [result, operation] Access the result along with the TransportOperation object
1080
+ # @yieldparam result [::Gapic::Operation]
1081
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1082
+ #
1083
+ # @return [::Gapic::Operation]
1084
+ #
1085
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1086
+ def create_instance request, options = nil
1087
+ raise ::ArgumentError, "request must be provided" if request.nil?
1088
+
1089
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest
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
+ call_metadata = @config.rpcs.create_instance.metadata.to_h
1096
+
1097
+ # Set x-goog-api-client and x-goog-user-project headers
1098
+ call_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::V1beta::VERSION,
1101
+ transports_version_send: [:rest]
1102
+
1103
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1104
+
1105
+ options.apply_defaults timeout: @config.rpcs.create_instance.timeout,
1106
+ metadata: call_metadata,
1107
+ retry_policy: @config.rpcs.create_instance.retry_policy
1108
+
1109
+ options.apply_defaults timeout: @config.timeout,
1110
+ metadata: @config.metadata,
1111
+ retry_policy: @config.retry_policy
1112
+
1113
+ @alloy_db_admin_stub.create_instance request, options do |result, operation|
1114
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1115
+ yield result, operation if block_given?
1116
+ return result
1117
+ end
1118
+ rescue ::Gapic::Rest::Error => e
1119
+ raise ::Google::Cloud::Error.from_error(e)
1120
+ end
1121
+
1122
+ ##
1123
+ # Creates a new SECONDARY Instance in a given project and location.
1124
+ #
1125
+ # @overload create_secondary_instance(request, options = nil)
1126
+ # Pass arguments to `create_secondary_instance` via a request object, either of type
1127
+ # {::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest} or an equivalent Hash.
1128
+ #
1129
+ # @param request [::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest, ::Hash]
1130
+ # A request object representing the call parameters. Required. To specify no
1131
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1132
+ # @param options [::Gapic::CallOptions, ::Hash]
1133
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1134
+ #
1135
+ # @overload create_secondary_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: nil)
1136
+ # Pass arguments to `create_secondary_instance` via keyword arguments. Note that at
1137
+ # least one keyword argument is required. To specify no parameters, or to keep all
1138
+ # the default parameter values, pass an empty Hash as a request object (see above).
1139
+ #
1140
+ # @param parent [::String]
1141
+ # Required. The name of the parent resource. For the required format, see the
1142
+ # comment on the Instance.name field.
1143
+ # @param instance_id [::String]
1144
+ # Required. ID of the requesting object.
1145
+ # @param instance [::Google::Cloud::AlloyDB::V1beta::Instance, ::Hash]
1146
+ # Required. The resource being created
1147
+ # @param request_id [::String]
1148
+ # Optional. An optional request ID to identify requests. Specify a unique
1149
+ # request ID so that if you must retry your request, the server will know to
1150
+ # ignore the request if it has already been completed. The server will
1151
+ # guarantee that for at least 60 minutes since the first request.
1152
+ #
1153
+ # For example, consider a situation where you make an initial request and
1154
+ # the request times out. If you make the request again with the same request
1155
+ # ID, the server can check if original operation with the same request ID
1156
+ # was received, and if so, will ignore the second request. This prevents
1157
+ # clients from accidentally creating duplicate commitments.
1158
+ #
1159
+ # The request ID must be a valid UUID with the exception that zero UUID is
1160
+ # not supported (00000000-0000-0000-0000-000000000000).
1161
+ # @param validate_only [::Boolean]
1162
+ # Optional. If set, performs request validation (e.g. permission checks and
1163
+ # any other type of validation), but do not actually execute the create
1164
+ # request.
1165
+ # @yield [result, operation] Access the result along with the TransportOperation object
1166
+ # @yieldparam result [::Gapic::Operation]
1167
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1168
+ #
1169
+ # @return [::Gapic::Operation]
1170
+ #
1171
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1172
+ def create_secondary_instance request, options = nil
1173
+ raise ::ArgumentError, "request must be provided" if request.nil?
1174
+
1175
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest
1176
+
1177
+ # Converts hash and nil to an options object
1178
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1179
+
1180
+ # Customize the options with defaults
1181
+ call_metadata = @config.rpcs.create_secondary_instance.metadata.to_h
1182
+
1183
+ # Set x-goog-api-client and x-goog-user-project headers
1184
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1185
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1186
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
1187
+ transports_version_send: [:rest]
1188
+
1189
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1190
+
1191
+ options.apply_defaults timeout: @config.rpcs.create_secondary_instance.timeout,
1192
+ metadata: call_metadata,
1193
+ retry_policy: @config.rpcs.create_secondary_instance.retry_policy
1194
+
1195
+ options.apply_defaults timeout: @config.timeout,
1196
+ metadata: @config.metadata,
1197
+ retry_policy: @config.retry_policy
1198
+
1199
+ @alloy_db_admin_stub.create_secondary_instance request, options do |result, operation|
1200
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1201
+ yield result, operation if block_given?
1202
+ return result
1203
+ end
1204
+ rescue ::Gapic::Rest::Error => e
1205
+ raise ::Google::Cloud::Error.from_error(e)
1206
+ end
1207
+
1208
+ ##
1209
+ # Creates new instances under the given project, location and cluster.
1210
+ # There can be only one primary instance in a cluster. If the primary
1211
+ # instance exists in the cluster as well as this request, then API will
1212
+ # throw an error.
1213
+ # The primary instance should exist before any read pool instance is
1214
+ # created. If the primary instance is a part of the request payload, then
1215
+ # the API will take care of creating instances in the correct order.
1216
+ # This method is here to support Google-internal use cases, and is not meant
1217
+ # for external customers to consume. Please do not start relying on it; its
1218
+ # behavior is subject to change without notice.
1219
+ #
1220
+ # @overload batch_create_instances(request, options = nil)
1221
+ # Pass arguments to `batch_create_instances` via a request object, either of type
1222
+ # {::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest} or an equivalent Hash.
1223
+ #
1224
+ # @param request [::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest, ::Hash]
1225
+ # A request object representing the call parameters. Required. To specify no
1226
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1227
+ # @param options [::Gapic::CallOptions, ::Hash]
1228
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1229
+ #
1230
+ # @overload batch_create_instances(parent: nil, requests: nil, request_id: nil)
1231
+ # Pass arguments to `batch_create_instances` via keyword arguments. Note that at
1232
+ # least one keyword argument is required. To specify no parameters, or to keep all
1233
+ # the default parameter values, pass an empty Hash as a request object (see above).
1234
+ #
1235
+ # @param parent [::String]
1236
+ # Required. The name of the parent resource.
1237
+ # @param requests [::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequests, ::Hash]
1238
+ # Required. Resources being created.
1239
+ # @param request_id [::String]
1240
+ # Optional. An optional request ID to identify requests. Specify a unique
1241
+ # request ID so that if you must retry your request, the server will know to
1242
+ # ignore the request if it has already been completed. The server will
1243
+ # guarantee that for at least 60 minutes since the first request.
1244
+ #
1245
+ # For example, consider a situation where you make an initial request and
1246
+ # the request times out. If you make the request again with the same request
1247
+ # ID, the server can check if original operation with the same request ID
1248
+ # was received, and if so, will ignore the second request. This prevents
1249
+ # clients from accidentally creating duplicate commitments.
1250
+ #
1251
+ # The request ID must be a valid UUID with the exception that zero UUID is
1252
+ # not supported (00000000-0000-0000-0000-000000000000).
1253
+ # @yield [result, operation] Access the result along with the TransportOperation object
1254
+ # @yieldparam result [::Gapic::Operation]
1255
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1256
+ #
1257
+ # @return [::Gapic::Operation]
1258
+ #
1259
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1260
+ def batch_create_instances request, options = nil
1261
+ raise ::ArgumentError, "request must be provided" if request.nil?
1262
+
1263
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest
1264
+
1265
+ # Converts hash and nil to an options object
1266
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1267
+
1268
+ # Customize the options with defaults
1269
+ call_metadata = @config.rpcs.batch_create_instances.metadata.to_h
1270
+
1271
+ # Set x-goog-api-client and x-goog-user-project headers
1272
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1273
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1274
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
1275
+ transports_version_send: [:rest]
1276
+
1277
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1278
+
1279
+ options.apply_defaults timeout: @config.rpcs.batch_create_instances.timeout,
1280
+ metadata: call_metadata,
1281
+ retry_policy: @config.rpcs.batch_create_instances.retry_policy
1282
+
1283
+ options.apply_defaults timeout: @config.timeout,
1284
+ metadata: @config.metadata,
1285
+ retry_policy: @config.retry_policy
1286
+
1287
+ @alloy_db_admin_stub.batch_create_instances request, options do |result, operation|
1288
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1289
+ yield result, operation if block_given?
1290
+ return result
1291
+ end
1292
+ rescue ::Gapic::Rest::Error => e
1293
+ raise ::Google::Cloud::Error.from_error(e)
1294
+ end
1295
+
1296
+ ##
1297
+ # Updates the parameters of a single Instance.
1298
+ #
1299
+ # @overload update_instance(request, options = nil)
1300
+ # Pass arguments to `update_instance` via a request object, either of type
1301
+ # {::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest} or an equivalent Hash.
1302
+ #
1303
+ # @param request [::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest, ::Hash]
1304
+ # A request object representing the call parameters. Required. To specify no
1305
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1306
+ # @param options [::Gapic::CallOptions, ::Hash]
1307
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1308
+ #
1309
+ # @overload update_instance(update_mask: nil, instance: nil, request_id: nil, validate_only: nil, allow_missing: nil)
1310
+ # Pass arguments to `update_instance` via keyword arguments. Note that at
1311
+ # least one keyword argument is required. To specify no parameters, or to keep all
1312
+ # the default parameter values, pass an empty Hash as a request object (see above).
1313
+ #
1314
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1315
+ # Optional. Field mask is used to specify the fields to be overwritten in the
1316
+ # Instance resource by the update.
1317
+ # The fields specified in the update_mask are relative to the resource, not
1318
+ # the full request. A field will be overwritten if it is in the mask. If the
1319
+ # user does not provide a mask then all fields will be overwritten.
1320
+ # @param instance [::Google::Cloud::AlloyDB::V1beta::Instance, ::Hash]
1321
+ # Required. The resource being updated
1322
+ # @param request_id [::String]
1323
+ # Optional. An optional request ID to identify requests. Specify a unique
1324
+ # request ID so that if you must retry your request, the server will know to
1325
+ # ignore the request if it has already been completed. The server will
1326
+ # guarantee that for at least 60 minutes since the first request.
1327
+ #
1328
+ # For example, consider a situation where you make an initial request and
1329
+ # the request times out. If you make the request again with the same request
1330
+ # ID, the server can check if original operation with the same request ID
1331
+ # was received, and if so, will ignore the second request. This prevents
1332
+ # clients from accidentally creating duplicate commitments.
1333
+ #
1334
+ # The request ID must be a valid UUID with the exception that zero UUID is
1335
+ # not supported (00000000-0000-0000-0000-000000000000).
1336
+ # @param validate_only [::Boolean]
1337
+ # Optional. If set, performs request validation (e.g. permission checks and
1338
+ # any other type of validation), but do not actually execute the update
1339
+ # request.
1340
+ # @param allow_missing [::Boolean]
1341
+ # Optional. If set to true, update succeeds even if instance is not found. In
1342
+ # that case, a new instance is created and `update_mask` is ignored.
1343
+ # @yield [result, operation] Access the result along with the TransportOperation object
1344
+ # @yieldparam result [::Gapic::Operation]
1345
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1346
+ #
1347
+ # @return [::Gapic::Operation]
1348
+ #
1349
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1350
+ def update_instance request, options = nil
1351
+ raise ::ArgumentError, "request must be provided" if request.nil?
1352
+
1353
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest
1354
+
1355
+ # Converts hash and nil to an options object
1356
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1357
+
1358
+ # Customize the options with defaults
1359
+ call_metadata = @config.rpcs.update_instance.metadata.to_h
1360
+
1361
+ # Set x-goog-api-client and x-goog-user-project headers
1362
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1363
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1364
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
1365
+ transports_version_send: [:rest]
1366
+
1367
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1368
+
1369
+ options.apply_defaults timeout: @config.rpcs.update_instance.timeout,
1370
+ metadata: call_metadata,
1371
+ retry_policy: @config.rpcs.update_instance.retry_policy
1372
+
1373
+ options.apply_defaults timeout: @config.timeout,
1374
+ metadata: @config.metadata,
1375
+ retry_policy: @config.retry_policy
1376
+
1377
+ @alloy_db_admin_stub.update_instance request, options do |result, operation|
1378
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1379
+ yield result, operation if block_given?
1380
+ return result
1381
+ end
1382
+ rescue ::Gapic::Rest::Error => e
1383
+ raise ::Google::Cloud::Error.from_error(e)
1384
+ end
1385
+
1386
+ ##
1387
+ # Deletes a single Instance.
1388
+ #
1389
+ # @overload delete_instance(request, options = nil)
1390
+ # Pass arguments to `delete_instance` via a request object, either of type
1391
+ # {::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest} or an equivalent Hash.
1392
+ #
1393
+ # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest, ::Hash]
1394
+ # A request object representing the call parameters. Required. To specify no
1395
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1396
+ # @param options [::Gapic::CallOptions, ::Hash]
1397
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1398
+ #
1399
+ # @overload delete_instance(name: nil, request_id: nil, etag: nil, validate_only: nil)
1400
+ # Pass arguments to `delete_instance` via keyword arguments. Note that at
1401
+ # least one keyword argument is required. To specify no parameters, or to keep all
1402
+ # the default parameter values, pass an empty Hash as a request object (see above).
1403
+ #
1404
+ # @param name [::String]
1405
+ # Required. The name of the resource. For the required format, see the
1406
+ # comment on the Instance.name field.
1407
+ # @param request_id [::String]
1408
+ # Optional. An optional request ID to identify requests. Specify a unique
1409
+ # request ID so that if you must retry your request, the server will know to
1410
+ # ignore the request if it has already been completed. The server will
1411
+ # guarantee that for at least 60 minutes after the first request.
1412
+ #
1413
+ # For example, consider a situation where you make an initial request and
1414
+ # the request times out. If you make the request again with the same request
1415
+ # ID, the server can check if original operation with the same request ID
1416
+ # was received, and if so, will ignore the second request. This prevents
1417
+ # clients from accidentally creating duplicate commitments.
1418
+ #
1419
+ # The request ID must be a valid UUID with the exception that zero UUID is
1420
+ # not supported (00000000-0000-0000-0000-000000000000).
1421
+ # @param etag [::String]
1422
+ # Optional. The current etag of the Instance.
1423
+ # If an etag is provided and does not match the current etag of the Instance,
1424
+ # deletion will be blocked and an ABORTED error will be returned.
1425
+ # @param validate_only [::Boolean]
1426
+ # Optional. If set, performs request validation (e.g. permission checks and
1427
+ # any other type of validation), but do not actually execute the delete.
1428
+ # @yield [result, operation] Access the result along with the TransportOperation object
1429
+ # @yieldparam result [::Gapic::Operation]
1430
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1431
+ #
1432
+ # @return [::Gapic::Operation]
1433
+ #
1434
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1435
+ def delete_instance request, options = nil
1436
+ raise ::ArgumentError, "request must be provided" if request.nil?
1437
+
1438
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest
1439
+
1440
+ # Converts hash and nil to an options object
1441
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1442
+
1443
+ # Customize the options with defaults
1444
+ call_metadata = @config.rpcs.delete_instance.metadata.to_h
1445
+
1446
+ # Set x-goog-api-client and x-goog-user-project headers
1447
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1448
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1449
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
1450
+ transports_version_send: [:rest]
1451
+
1452
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1453
+
1454
+ options.apply_defaults timeout: @config.rpcs.delete_instance.timeout,
1455
+ metadata: call_metadata,
1456
+ retry_policy: @config.rpcs.delete_instance.retry_policy
1457
+
1458
+ options.apply_defaults timeout: @config.timeout,
1459
+ metadata: @config.metadata,
1460
+ retry_policy: @config.retry_policy
1461
+
1462
+ @alloy_db_admin_stub.delete_instance request, options do |result, operation|
1463
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1464
+ yield result, operation if block_given?
1465
+ return result
1466
+ end
1467
+ rescue ::Gapic::Rest::Error => e
1468
+ raise ::Google::Cloud::Error.from_error(e)
1469
+ end
1470
+
1471
+ ##
1472
+ # Forces a Failover for a highly available instance.
1473
+ # Failover promotes the HA standby instance as the new primary.
1474
+ # Imperative only.
1475
+ #
1476
+ # @overload failover_instance(request, options = nil)
1477
+ # Pass arguments to `failover_instance` via a request object, either of type
1478
+ # {::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest} or an equivalent Hash.
1479
+ #
1480
+ # @param request [::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest, ::Hash]
1481
+ # A request object representing the call parameters. Required. To specify no
1482
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1483
+ # @param options [::Gapic::CallOptions, ::Hash]
1484
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1485
+ #
1486
+ # @overload failover_instance(name: nil, request_id: nil, validate_only: nil)
1487
+ # Pass arguments to `failover_instance` via keyword arguments. Note that at
1488
+ # least one keyword argument is required. To specify no parameters, or to keep all
1489
+ # the default parameter values, pass an empty Hash as a request object (see above).
1490
+ #
1491
+ # @param name [::String]
1492
+ # Required. The name of the resource. For the required format, see the
1493
+ # comment on the Instance.name field.
1494
+ # @param request_id [::String]
1495
+ # Optional. An optional request ID to identify requests. Specify a unique
1496
+ # request ID so that if you must retry your request, the server will know to
1497
+ # ignore the request if it has already been completed. The server will
1498
+ # guarantee that for at least 60 minutes after the first request.
1499
+ #
1500
+ # For example, consider a situation where you make an initial request and
1501
+ # the request times out. If you make the request again with the same request
1502
+ # ID, the server can check if original operation with the same request ID
1503
+ # was received, and if so, will ignore the second request. This prevents
1504
+ # clients from accidentally creating duplicate commitments.
1505
+ #
1506
+ # The request ID must be a valid UUID with the exception that zero UUID is
1507
+ # not supported (00000000-0000-0000-0000-000000000000).
1508
+ # @param validate_only [::Boolean]
1509
+ # Optional. If set, performs request validation (e.g. permission checks and
1510
+ # any other type of validation), but do not actually execute the failover.
1511
+ # @yield [result, operation] Access the result along with the TransportOperation object
1512
+ # @yieldparam result [::Gapic::Operation]
1513
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1514
+ #
1515
+ # @return [::Gapic::Operation]
1516
+ #
1517
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1518
+ def failover_instance request, options = nil
1519
+ raise ::ArgumentError, "request must be provided" if request.nil?
1520
+
1521
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest
1522
+
1523
+ # Converts hash and nil to an options object
1524
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1525
+
1526
+ # Customize the options with defaults
1527
+ call_metadata = @config.rpcs.failover_instance.metadata.to_h
1528
+
1529
+ # Set x-goog-api-client and x-goog-user-project headers
1530
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1531
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1532
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
1533
+ transports_version_send: [:rest]
1534
+
1535
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1536
+
1537
+ options.apply_defaults timeout: @config.rpcs.failover_instance.timeout,
1538
+ metadata: call_metadata,
1539
+ retry_policy: @config.rpcs.failover_instance.retry_policy
1540
+
1541
+ options.apply_defaults timeout: @config.timeout,
1542
+ metadata: @config.metadata,
1543
+ retry_policy: @config.retry_policy
1544
+
1545
+ @alloy_db_admin_stub.failover_instance request, options do |result, operation|
1546
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1547
+ yield result, operation if block_given?
1548
+ return result
1549
+ end
1550
+ rescue ::Gapic::Rest::Error => e
1551
+ raise ::Google::Cloud::Error.from_error(e)
1552
+ end
1553
+
1554
+ ##
1555
+ # Restart an Instance in a cluster.
1556
+ # Imperative only.
1557
+ #
1558
+ # @overload restart_instance(request, options = nil)
1559
+ # Pass arguments to `restart_instance` via a request object, either of type
1560
+ # {::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest} or an equivalent Hash.
1561
+ #
1562
+ # @param request [::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest, ::Hash]
1563
+ # A request object representing the call parameters. Required. To specify no
1564
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1565
+ # @param options [::Gapic::CallOptions, ::Hash]
1566
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1567
+ #
1568
+ # @overload restart_instance(name: nil, request_id: nil, validate_only: nil)
1569
+ # Pass arguments to `restart_instance` via keyword arguments. Note that at
1570
+ # least one keyword argument is required. To specify no parameters, or to keep all
1571
+ # the default parameter values, pass an empty Hash as a request object (see above).
1572
+ #
1573
+ # @param name [::String]
1574
+ # Required. The name of the resource. For the required format, see the
1575
+ # comment on the Instance.name field.
1576
+ # @param request_id [::String]
1577
+ # Optional. An optional request ID to identify requests. Specify a unique
1578
+ # request ID so that if you must retry your request, the server will know to
1579
+ # ignore the request if it has already been completed. The server will
1580
+ # guarantee that for at least 60 minutes after the first request.
1581
+ #
1582
+ # For example, consider a situation where you make an initial request and
1583
+ # the request times out. If you make the request again with the same request
1584
+ # ID, the server can check if original operation with the same request ID
1585
+ # was received, and if so, will ignore the second request. This prevents
1586
+ # clients from accidentally creating duplicate commitments.
1587
+ #
1588
+ # The request ID must be a valid UUID with the exception that zero UUID is
1589
+ # not supported (00000000-0000-0000-0000-000000000000).
1590
+ # @param validate_only [::Boolean]
1591
+ # Optional. If set, performs request validation (e.g. permission checks and
1592
+ # any other type of validation), but do not actually execute the restart.
1593
+ # @yield [result, operation] Access the result along with the TransportOperation object
1594
+ # @yieldparam result [::Gapic::Operation]
1595
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1596
+ #
1597
+ # @return [::Gapic::Operation]
1598
+ #
1599
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1600
+ def restart_instance request, options = nil
1601
+ raise ::ArgumentError, "request must be provided" if request.nil?
1602
+
1603
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest
1604
+
1605
+ # Converts hash and nil to an options object
1606
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1607
+
1608
+ # Customize the options with defaults
1609
+ call_metadata = @config.rpcs.restart_instance.metadata.to_h
1610
+
1611
+ # Set x-goog-api-client and x-goog-user-project headers
1612
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1613
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1614
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
1615
+ transports_version_send: [:rest]
1616
+
1617
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1618
+
1619
+ options.apply_defaults timeout: @config.rpcs.restart_instance.timeout,
1620
+ metadata: call_metadata,
1621
+ retry_policy: @config.rpcs.restart_instance.retry_policy
1622
+
1623
+ options.apply_defaults timeout: @config.timeout,
1624
+ metadata: @config.metadata,
1625
+ retry_policy: @config.retry_policy
1626
+
1627
+ @alloy_db_admin_stub.restart_instance request, options do |result, operation|
1628
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1629
+ yield result, operation if block_given?
1630
+ return result
1631
+ end
1632
+ rescue ::Gapic::Rest::Error => e
1633
+ raise ::Google::Cloud::Error.from_error(e)
1634
+ end
1635
+
1636
+ ##
1637
+ # Lists Backups in a given project and location.
1638
+ #
1639
+ # @overload list_backups(request, options = nil)
1640
+ # Pass arguments to `list_backups` via a request object, either of type
1641
+ # {::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest} or an equivalent Hash.
1642
+ #
1643
+ # @param request [::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest, ::Hash]
1644
+ # A request object representing the call parameters. Required. To specify no
1645
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1646
+ # @param options [::Gapic::CallOptions, ::Hash]
1647
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1648
+ #
1649
+ # @overload list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1650
+ # Pass arguments to `list_backups` via keyword arguments. Note that at
1651
+ # least one keyword argument is required. To specify no parameters, or to keep all
1652
+ # the default parameter values, pass an empty Hash as a request object (see above).
1653
+ #
1654
+ # @param parent [::String]
1655
+ # Required. Parent value for ListBackupsRequest
1656
+ # @param page_size [::Integer]
1657
+ # Requested page size. Server may return fewer items than requested.
1658
+ # If unspecified, server will pick an appropriate default.
1659
+ # @param page_token [::String]
1660
+ # A token identifying a page of results the server should return.
1661
+ # @param filter [::String]
1662
+ # Filtering results
1663
+ # @param order_by [::String]
1664
+ # Hint for how to order the results
1665
+ # @yield [result, operation] Access the result along with the TransportOperation object
1666
+ # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::ListBackupsResponse]
1667
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1668
+ #
1669
+ # @return [::Google::Cloud::AlloyDB::V1beta::ListBackupsResponse]
1670
+ #
1671
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1672
+ def list_backups request, options = nil
1673
+ raise ::ArgumentError, "request must be provided" if request.nil?
1674
+
1675
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest
1676
+
1677
+ # Converts hash and nil to an options object
1678
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1679
+
1680
+ # Customize the options with defaults
1681
+ call_metadata = @config.rpcs.list_backups.metadata.to_h
1682
+
1683
+ # Set x-goog-api-client and x-goog-user-project headers
1684
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1685
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1686
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
1687
+ transports_version_send: [:rest]
1688
+
1689
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1690
+
1691
+ options.apply_defaults timeout: @config.rpcs.list_backups.timeout,
1692
+ metadata: call_metadata,
1693
+ retry_policy: @config.rpcs.list_backups.retry_policy
1694
+
1695
+ options.apply_defaults timeout: @config.timeout,
1696
+ metadata: @config.metadata,
1697
+ retry_policy: @config.retry_policy
1698
+
1699
+ @alloy_db_admin_stub.list_backups request, options do |result, operation|
1700
+ yield result, operation if block_given?
1701
+ return result
1702
+ end
1703
+ rescue ::Gapic::Rest::Error => e
1704
+ raise ::Google::Cloud::Error.from_error(e)
1705
+ end
1706
+
1707
+ ##
1708
+ # Gets details of a single Backup.
1709
+ #
1710
+ # @overload get_backup(request, options = nil)
1711
+ # Pass arguments to `get_backup` via a request object, either of type
1712
+ # {::Google::Cloud::AlloyDB::V1beta::GetBackupRequest} or an equivalent Hash.
1713
+ #
1714
+ # @param request [::Google::Cloud::AlloyDB::V1beta::GetBackupRequest, ::Hash]
1715
+ # A request object representing the call parameters. Required. To specify no
1716
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1717
+ # @param options [::Gapic::CallOptions, ::Hash]
1718
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1719
+ #
1720
+ # @overload get_backup(name: nil)
1721
+ # Pass arguments to `get_backup` via keyword arguments. Note that at
1722
+ # least one keyword argument is required. To specify no parameters, or to keep all
1723
+ # the default parameter values, pass an empty Hash as a request object (see above).
1724
+ #
1725
+ # @param name [::String]
1726
+ # Required. Name of the resource
1727
+ # @yield [result, operation] Access the result along with the TransportOperation object
1728
+ # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::Backup]
1729
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1730
+ #
1731
+ # @return [::Google::Cloud::AlloyDB::V1beta::Backup]
1732
+ #
1733
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1734
+ def get_backup request, options = nil
1735
+ raise ::ArgumentError, "request must be provided" if request.nil?
1736
+
1737
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GetBackupRequest
1738
+
1739
+ # Converts hash and nil to an options object
1740
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1741
+
1742
+ # Customize the options with defaults
1743
+ call_metadata = @config.rpcs.get_backup.metadata.to_h
1744
+
1745
+ # Set x-goog-api-client and x-goog-user-project headers
1746
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1747
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1748
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
1749
+ transports_version_send: [:rest]
1750
+
1751
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1752
+
1753
+ options.apply_defaults timeout: @config.rpcs.get_backup.timeout,
1754
+ metadata: call_metadata,
1755
+ retry_policy: @config.rpcs.get_backup.retry_policy
1756
+
1757
+ options.apply_defaults timeout: @config.timeout,
1758
+ metadata: @config.metadata,
1759
+ retry_policy: @config.retry_policy
1760
+
1761
+ @alloy_db_admin_stub.get_backup request, options do |result, operation|
1762
+ yield result, operation if block_given?
1763
+ return result
1764
+ end
1765
+ rescue ::Gapic::Rest::Error => e
1766
+ raise ::Google::Cloud::Error.from_error(e)
1767
+ end
1768
+
1769
+ ##
1770
+ # Creates a new Backup in a given project and location.
1771
+ #
1772
+ # @overload create_backup(request, options = nil)
1773
+ # Pass arguments to `create_backup` via a request object, either of type
1774
+ # {::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest} or an equivalent Hash.
1775
+ #
1776
+ # @param request [::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest, ::Hash]
1777
+ # A request object representing the call parameters. Required. To specify no
1778
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1779
+ # @param options [::Gapic::CallOptions, ::Hash]
1780
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1781
+ #
1782
+ # @overload create_backup(parent: nil, backup_id: nil, backup: nil, request_id: nil, validate_only: nil)
1783
+ # Pass arguments to `create_backup` via keyword arguments. Note that at
1784
+ # least one keyword argument is required. To specify no parameters, or to keep all
1785
+ # the default parameter values, pass an empty Hash as a request object (see above).
1786
+ #
1787
+ # @param parent [::String]
1788
+ # Required. Value for parent.
1789
+ # @param backup_id [::String]
1790
+ # Required. ID of the requesting object.
1791
+ # @param backup [::Google::Cloud::AlloyDB::V1beta::Backup, ::Hash]
1792
+ # Required. The resource being created
1793
+ # @param request_id [::String]
1794
+ # Optional. An optional request ID to identify requests. Specify a unique
1795
+ # request ID so that if you must retry your request, the server will know to
1796
+ # ignore the request if it has already been completed. The server will
1797
+ # guarantee that for at least 60 minutes since the first request.
1798
+ #
1799
+ # For example, consider a situation where you make an initial request and
1800
+ # the request times out. If you make the request again with the same request
1801
+ # ID, the server can check if original operation with the same request ID
1802
+ # was received, and if so, will ignore the second request. This prevents
1803
+ # clients from accidentally creating duplicate commitments.
1804
+ #
1805
+ # The request ID must be a valid UUID with the exception that zero UUID is
1806
+ # not supported (00000000-0000-0000-0000-000000000000).
1807
+ # @param validate_only [::Boolean]
1808
+ # Optional. If set, the backend validates the request, but doesn't actually
1809
+ # execute it.
1810
+ # @yield [result, operation] Access the result along with the TransportOperation object
1811
+ # @yieldparam result [::Gapic::Operation]
1812
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1813
+ #
1814
+ # @return [::Gapic::Operation]
1815
+ #
1816
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1817
+ def create_backup request, options = nil
1818
+ raise ::ArgumentError, "request must be provided" if request.nil?
1819
+
1820
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest
1821
+
1822
+ # Converts hash and nil to an options object
1823
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1824
+
1825
+ # Customize the options with defaults
1826
+ call_metadata = @config.rpcs.create_backup.metadata.to_h
1827
+
1828
+ # Set x-goog-api-client and x-goog-user-project headers
1829
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1830
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1831
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
1832
+ transports_version_send: [:rest]
1833
+
1834
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1835
+
1836
+ options.apply_defaults timeout: @config.rpcs.create_backup.timeout,
1837
+ metadata: call_metadata,
1838
+ retry_policy: @config.rpcs.create_backup.retry_policy
1839
+
1840
+ options.apply_defaults timeout: @config.timeout,
1841
+ metadata: @config.metadata,
1842
+ retry_policy: @config.retry_policy
1843
+
1844
+ @alloy_db_admin_stub.create_backup request, options do |result, operation|
1845
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1846
+ yield result, operation if block_given?
1847
+ return result
1848
+ end
1849
+ rescue ::Gapic::Rest::Error => e
1850
+ raise ::Google::Cloud::Error.from_error(e)
1851
+ end
1852
+
1853
+ ##
1854
+ # Updates the parameters of a single Backup.
1855
+ #
1856
+ # @overload update_backup(request, options = nil)
1857
+ # Pass arguments to `update_backup` via a request object, either of type
1858
+ # {::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest} or an equivalent Hash.
1859
+ #
1860
+ # @param request [::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest, ::Hash]
1861
+ # A request object representing the call parameters. Required. To specify no
1862
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1863
+ # @param options [::Gapic::CallOptions, ::Hash]
1864
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1865
+ #
1866
+ # @overload update_backup(update_mask: nil, backup: nil, request_id: nil, validate_only: nil, allow_missing: nil)
1867
+ # Pass arguments to `update_backup` via keyword arguments. Note that at
1868
+ # least one keyword argument is required. To specify no parameters, or to keep all
1869
+ # the default parameter values, pass an empty Hash as a request object (see above).
1870
+ #
1871
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1872
+ # Optional. Field mask is used to specify the fields to be overwritten in the
1873
+ # Backup resource by the update.
1874
+ # The fields specified in the update_mask are relative to the resource, not
1875
+ # the full request. A field will be overwritten if it is in the mask. If the
1876
+ # user does not provide a mask then all fields will be overwritten.
1877
+ # @param backup [::Google::Cloud::AlloyDB::V1beta::Backup, ::Hash]
1878
+ # Required. The resource being updated
1879
+ # @param request_id [::String]
1880
+ # Optional. An optional request ID to identify requests. Specify a unique
1881
+ # request ID so that if you must retry your request, the server will know to
1882
+ # ignore the request if it has already been completed. The server will
1883
+ # guarantee that for at least 60 minutes since the first request.
1884
+ #
1885
+ # For example, consider a situation where you make an initial request and
1886
+ # the request times out. If you make the request again with the same request
1887
+ # ID, the server can check if original operation with the same request ID
1888
+ # was received, and if so, will ignore the second request. This prevents
1889
+ # clients from accidentally creating duplicate commitments.
1890
+ #
1891
+ # The request ID must be a valid UUID with the exception that zero UUID is
1892
+ # not supported (00000000-0000-0000-0000-000000000000).
1893
+ # @param validate_only [::Boolean]
1894
+ # Optional. If set, the backend validates the request, but doesn't actually
1895
+ # execute it.
1896
+ # @param allow_missing [::Boolean]
1897
+ # Optional. If set to true, update succeeds even if instance is not found. In
1898
+ # that case, a new backup is created and `update_mask` is ignored.
1899
+ # @yield [result, operation] Access the result along with the TransportOperation object
1900
+ # @yieldparam result [::Gapic::Operation]
1901
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1902
+ #
1903
+ # @return [::Gapic::Operation]
1904
+ #
1905
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1906
+ def update_backup request, options = nil
1907
+ raise ::ArgumentError, "request must be provided" if request.nil?
1908
+
1909
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest
1910
+
1911
+ # Converts hash and nil to an options object
1912
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1913
+
1914
+ # Customize the options with defaults
1915
+ call_metadata = @config.rpcs.update_backup.metadata.to_h
1916
+
1917
+ # Set x-goog-api-client and x-goog-user-project headers
1918
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1919
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1920
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
1921
+ transports_version_send: [:rest]
1922
+
1923
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1924
+
1925
+ options.apply_defaults timeout: @config.rpcs.update_backup.timeout,
1926
+ metadata: call_metadata,
1927
+ retry_policy: @config.rpcs.update_backup.retry_policy
1928
+
1929
+ options.apply_defaults timeout: @config.timeout,
1930
+ metadata: @config.metadata,
1931
+ retry_policy: @config.retry_policy
1932
+
1933
+ @alloy_db_admin_stub.update_backup request, options do |result, operation|
1934
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1935
+ yield result, operation if block_given?
1936
+ return result
1937
+ end
1938
+ rescue ::Gapic::Rest::Error => e
1939
+ raise ::Google::Cloud::Error.from_error(e)
1940
+ end
1941
+
1942
+ ##
1943
+ # Deletes a single Backup.
1944
+ #
1945
+ # @overload delete_backup(request, options = nil)
1946
+ # Pass arguments to `delete_backup` via a request object, either of type
1947
+ # {::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest} or an equivalent Hash.
1948
+ #
1949
+ # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest, ::Hash]
1950
+ # A request object representing the call parameters. Required. To specify no
1951
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1952
+ # @param options [::Gapic::CallOptions, ::Hash]
1953
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1954
+ #
1955
+ # @overload delete_backup(name: nil, request_id: nil, validate_only: nil, etag: nil)
1956
+ # Pass arguments to `delete_backup` via keyword arguments. Note that at
1957
+ # least one keyword argument is required. To specify no parameters, or to keep all
1958
+ # the default parameter values, pass an empty Hash as a request object (see above).
1959
+ #
1960
+ # @param name [::String]
1961
+ # Required. Name of the resource. For the required format, see the comment on
1962
+ # the Backup.name field.
1963
+ # @param request_id [::String]
1964
+ # Optional. An optional request ID to identify requests. Specify a unique
1965
+ # request ID so that if you must retry your request, the server will know to
1966
+ # ignore the request if it has already been completed. The server will
1967
+ # guarantee that for at least 60 minutes after the first request.
1968
+ #
1969
+ # For example, consider a situation where you make an initial request and
1970
+ # the request times out. If you make the request again with the same request
1971
+ # ID, the server can check if original operation with the same request ID
1972
+ # was received, and if so, will ignore the second request. This prevents
1973
+ # clients from accidentally creating duplicate commitments.
1974
+ #
1975
+ # The request ID must be a valid UUID with the exception that zero UUID is
1976
+ # not supported (00000000-0000-0000-0000-000000000000).
1977
+ # @param validate_only [::Boolean]
1978
+ # Optional. If set, the backend validates the request, but doesn't actually
1979
+ # execute it.
1980
+ # @param etag [::String]
1981
+ # Optional. The current etag of the Backup.
1982
+ # If an etag is provided and does not match the current etag of the Backup,
1983
+ # deletion will be blocked and an ABORTED error will be returned.
1984
+ # @yield [result, operation] Access the result along with the TransportOperation object
1985
+ # @yieldparam result [::Gapic::Operation]
1986
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1987
+ #
1988
+ # @return [::Gapic::Operation]
1989
+ #
1990
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1991
+ def delete_backup request, options = nil
1992
+ raise ::ArgumentError, "request must be provided" if request.nil?
1993
+
1994
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest
1995
+
1996
+ # Converts hash and nil to an options object
1997
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1998
+
1999
+ # Customize the options with defaults
2000
+ call_metadata = @config.rpcs.delete_backup.metadata.to_h
2001
+
2002
+ # Set x-goog-api-client and x-goog-user-project headers
2003
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2004
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2005
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
2006
+ transports_version_send: [:rest]
2007
+
2008
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2009
+
2010
+ options.apply_defaults timeout: @config.rpcs.delete_backup.timeout,
2011
+ metadata: call_metadata,
2012
+ retry_policy: @config.rpcs.delete_backup.retry_policy
2013
+
2014
+ options.apply_defaults timeout: @config.timeout,
2015
+ metadata: @config.metadata,
2016
+ retry_policy: @config.retry_policy
2017
+
2018
+ @alloy_db_admin_stub.delete_backup request, options do |result, operation|
2019
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2020
+ yield result, operation if block_given?
2021
+ return result
2022
+ end
2023
+ rescue ::Gapic::Rest::Error => e
2024
+ raise ::Google::Cloud::Error.from_error(e)
2025
+ end
2026
+
2027
+ ##
2028
+ # Lists SupportedDatabaseFlags for a given project and location.
2029
+ #
2030
+ # @overload list_supported_database_flags(request, options = nil)
2031
+ # Pass arguments to `list_supported_database_flags` via a request object, either of type
2032
+ # {::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest} or an equivalent Hash.
2033
+ #
2034
+ # @param request [::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest, ::Hash]
2035
+ # A request object representing the call parameters. Required. To specify no
2036
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2037
+ # @param options [::Gapic::CallOptions, ::Hash]
2038
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2039
+ #
2040
+ # @overload list_supported_database_flags(parent: nil, page_size: nil, page_token: nil)
2041
+ # Pass arguments to `list_supported_database_flags` via keyword arguments. Note that at
2042
+ # least one keyword argument is required. To specify no parameters, or to keep all
2043
+ # the default parameter values, pass an empty Hash as a request object (see above).
2044
+ #
2045
+ # @param parent [::String]
2046
+ # Required. The name of the parent resource. The required format is:
2047
+ # * projects/\\{project}/locations/\\{location}
2048
+ #
2049
+ # Regardless of the parent specified here, as long it is contains a valid
2050
+ # project and location, the service will return a static list of supported
2051
+ # flags resources. Note that we do not yet support region-specific
2052
+ # flags.
2053
+ # @param page_size [::Integer]
2054
+ # Requested page size. Server may return fewer items than requested.
2055
+ # If unspecified, server will pick an appropriate default.
2056
+ # @param page_token [::String]
2057
+ # A token identifying a page of results the server should return.
2058
+ # @yield [result, operation] Access the result along with the TransportOperation object
2059
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag>]
2060
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2061
+ #
2062
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag>]
2063
+ #
2064
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2065
+ def list_supported_database_flags request, options = nil
2066
+ raise ::ArgumentError, "request must be provided" if request.nil?
2067
+
2068
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest
2069
+
2070
+ # Converts hash and nil to an options object
2071
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2072
+
2073
+ # Customize the options with defaults
2074
+ call_metadata = @config.rpcs.list_supported_database_flags.metadata.to_h
2075
+
2076
+ # Set x-goog-api-client and x-goog-user-project headers
2077
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2078
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2079
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
2080
+ transports_version_send: [:rest]
2081
+
2082
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2083
+
2084
+ options.apply_defaults timeout: @config.rpcs.list_supported_database_flags.timeout,
2085
+ metadata: call_metadata,
2086
+ retry_policy: @config.rpcs.list_supported_database_flags.retry_policy
2087
+
2088
+ options.apply_defaults timeout: @config.timeout,
2089
+ metadata: @config.metadata,
2090
+ retry_policy: @config.retry_policy
2091
+
2092
+ @alloy_db_admin_stub.list_supported_database_flags request, options do |result, operation|
2093
+ result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_admin_stub, :list_supported_database_flags, "supported_database_flags", request, result, options
2094
+ yield result, operation if block_given?
2095
+ return result
2096
+ end
2097
+ rescue ::Gapic::Rest::Error => e
2098
+ raise ::Google::Cloud::Error.from_error(e)
2099
+ end
2100
+
2101
+ ##
2102
+ # Generate a client certificate signed by a Cluster CA.
2103
+ # The sole purpose of this endpoint is to support the Auth Proxy client and
2104
+ # the endpoint's behavior is subject to change without notice, so do not rely
2105
+ # on its behavior remaining constant. Future changes will not break the Auth
2106
+ # Proxy client.
2107
+ #
2108
+ # @overload generate_client_certificate(request, options = nil)
2109
+ # Pass arguments to `generate_client_certificate` via a request object, either of type
2110
+ # {::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest} or an equivalent Hash.
2111
+ #
2112
+ # @param request [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest, ::Hash]
2113
+ # A request object representing the call parameters. Required. To specify no
2114
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2115
+ # @param options [::Gapic::CallOptions, ::Hash]
2116
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2117
+ #
2118
+ # @overload generate_client_certificate(parent: nil, request_id: nil, pem_csr: nil, cert_duration: nil)
2119
+ # Pass arguments to `generate_client_certificate` via keyword arguments. Note that at
2120
+ # least one keyword argument is required. To specify no parameters, or to keep all
2121
+ # the default parameter values, pass an empty Hash as a request object (see above).
2122
+ #
2123
+ # @param parent [::String]
2124
+ # Required. The name of the parent resource. The required format is:
2125
+ # * projects/\\{project}/locations/\\{location}/clusters/\\{cluster}
2126
+ # @param request_id [::String]
2127
+ # Optional. An optional request ID to identify requests. Specify a unique
2128
+ # request ID so that if you must retry your request, the server will know to
2129
+ # ignore the request if it has already been completed. The server will
2130
+ # guarantee that for at least 60 minutes after the first request.
2131
+ #
2132
+ # For example, consider a situation where you make an initial request and
2133
+ # the request times out. If you make the request again with the same request
2134
+ # ID, the server can check if original operation with the same request ID
2135
+ # was received, and if so, will ignore the second request. This prevents
2136
+ # clients from accidentally creating duplicate commitments.
2137
+ #
2138
+ # The request ID must be a valid UUID with the exception that zero UUID is
2139
+ # not supported (00000000-0000-0000-0000-000000000000).
2140
+ # @param pem_csr [::String]
2141
+ # Optional. A pem-encoded X.509 certificate signing request (CSR).
2142
+ # @param cert_duration [::Google::Protobuf::Duration, ::Hash]
2143
+ # Optional. An optional hint to the endpoint to generate the client
2144
+ # certificate with the requested duration. The duration can be from 1 hour to
2145
+ # 24 hours. The endpoint may or may not honor the hint. If the hint is left
2146
+ # unspecified or is not honored, then the endpoint will pick an appropriate
2147
+ # default duration.
2148
+ # @yield [result, operation] Access the result along with the TransportOperation object
2149
+ # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse]
2150
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2151
+ #
2152
+ # @return [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse]
2153
+ #
2154
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2155
+ def generate_client_certificate request, options = nil
2156
+ raise ::ArgumentError, "request must be provided" if request.nil?
2157
+
2158
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest
2159
+
2160
+ # Converts hash and nil to an options object
2161
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2162
+
2163
+ # Customize the options with defaults
2164
+ call_metadata = @config.rpcs.generate_client_certificate.metadata.to_h
2165
+
2166
+ # Set x-goog-api-client and x-goog-user-project headers
2167
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2168
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2169
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
2170
+ transports_version_send: [:rest]
2171
+
2172
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2173
+
2174
+ options.apply_defaults timeout: @config.rpcs.generate_client_certificate.timeout,
2175
+ metadata: call_metadata,
2176
+ retry_policy: @config.rpcs.generate_client_certificate.retry_policy
2177
+
2178
+ options.apply_defaults timeout: @config.timeout,
2179
+ metadata: @config.metadata,
2180
+ retry_policy: @config.retry_policy
2181
+
2182
+ @alloy_db_admin_stub.generate_client_certificate request, options do |result, operation|
2183
+ yield result, operation if block_given?
2184
+ return result
2185
+ end
2186
+ rescue ::Gapic::Rest::Error => e
2187
+ raise ::Google::Cloud::Error.from_error(e)
2188
+ end
2189
+
2190
+ ##
2191
+ # Get instance metadata used for a connection.
2192
+ #
2193
+ # @overload get_connection_info(request, options = nil)
2194
+ # Pass arguments to `get_connection_info` via a request object, either of type
2195
+ # {::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest} or an equivalent Hash.
2196
+ #
2197
+ # @param request [::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest, ::Hash]
2198
+ # A request object representing the call parameters. Required. To specify no
2199
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2200
+ # @param options [::Gapic::CallOptions, ::Hash]
2201
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2202
+ #
2203
+ # @overload get_connection_info(parent: nil, request_id: nil)
2204
+ # Pass arguments to `get_connection_info` via keyword arguments. Note that at
2205
+ # least one keyword argument is required. To specify no parameters, or to keep all
2206
+ # the default parameter values, pass an empty Hash as a request object (see above).
2207
+ #
2208
+ # @param parent [::String]
2209
+ # Required. The name of the parent resource. The required format is:
2210
+ # projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/instances/\\{instance}
2211
+ # @param request_id [::String]
2212
+ # Optional. An optional request ID to identify requests. Specify a unique
2213
+ # request ID so that if you must retry your request, the server will know to
2214
+ # ignore the request if it has already been completed. The server will
2215
+ # guarantee that for at least 60 minutes after the first request.
2216
+ #
2217
+ # For example, consider a situation where you make an initial request and
2218
+ # the request times out. If you make the request again with the same request
2219
+ # ID, the server can check if original operation with the same request ID
2220
+ # was received, and if so, will ignore the second request. This prevents
2221
+ # clients from accidentally creating duplicate commitments.
2222
+ #
2223
+ # The request ID must be a valid UUID with the exception that zero UUID is
2224
+ # not supported (00000000-0000-0000-0000-000000000000).
2225
+ # @yield [result, operation] Access the result along with the TransportOperation object
2226
+ # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::ConnectionInfo]
2227
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2228
+ #
2229
+ # @return [::Google::Cloud::AlloyDB::V1beta::ConnectionInfo]
2230
+ #
2231
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2232
+ def get_connection_info request, options = nil
2233
+ raise ::ArgumentError, "request must be provided" if request.nil?
2234
+
2235
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest
2236
+
2237
+ # Converts hash and nil to an options object
2238
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2239
+
2240
+ # Customize the options with defaults
2241
+ call_metadata = @config.rpcs.get_connection_info.metadata.to_h
2242
+
2243
+ # Set x-goog-api-client and x-goog-user-project headers
2244
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2245
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2246
+ gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
2247
+ transports_version_send: [:rest]
2248
+
2249
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2250
+
2251
+ options.apply_defaults timeout: @config.rpcs.get_connection_info.timeout,
2252
+ metadata: call_metadata,
2253
+ retry_policy: @config.rpcs.get_connection_info.retry_policy
2254
+
2255
+ options.apply_defaults timeout: @config.timeout,
2256
+ metadata: @config.metadata,
2257
+ retry_policy: @config.retry_policy
2258
+
2259
+ @alloy_db_admin_stub.get_connection_info request, options do |result, operation|
2260
+ yield result, operation if block_given?
2261
+ return result
2262
+ end
2263
+ rescue ::Gapic::Rest::Error => e
2264
+ raise ::Google::Cloud::Error.from_error(e)
2265
+ end
2266
+
2267
+ ##
2268
+ # Configuration class for the AlloyDBAdmin REST API.
2269
+ #
2270
+ # This class represents the configuration for AlloyDBAdmin REST,
2271
+ # providing control over timeouts, retry behavior, logging, transport
2272
+ # parameters, and other low-level controls. Certain parameters can also be
2273
+ # applied individually to specific RPCs. See
2274
+ # {::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client::Configuration::Rpcs}
2275
+ # for a list of RPCs that can be configured independently.
2276
+ #
2277
+ # Configuration can be applied globally to all clients, or to a single client
2278
+ # on construction.
2279
+ #
2280
+ # @example
2281
+ #
2282
+ # # Modify the global config, setting the timeout for
2283
+ # # list_clusters to 20 seconds,
2284
+ # # and all remaining timeouts to 10 seconds.
2285
+ # ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.configure do |config|
2286
+ # config.timeout = 10.0
2287
+ # config.rpcs.list_clusters.timeout = 20.0
2288
+ # end
2289
+ #
2290
+ # # Apply the above configuration only to a new client.
2291
+ # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config|
2292
+ # config.timeout = 10.0
2293
+ # config.rpcs.list_clusters.timeout = 20.0
2294
+ # end
2295
+ #
2296
+ # @!attribute [rw] endpoint
2297
+ # The hostname or hostname:port of the service endpoint.
2298
+ # Defaults to `"alloydb.googleapis.com"`.
2299
+ # @return [::String]
2300
+ # @!attribute [rw] credentials
2301
+ # Credentials to send with calls. You may provide any of the following types:
2302
+ # * (`String`) The path to a service account key file in JSON format
2303
+ # * (`Hash`) A service account key as a Hash
2304
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2305
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2306
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2307
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2308
+ # * (`nil`) indicating no credentials
2309
+ # @return [::Object]
2310
+ # @!attribute [rw] scope
2311
+ # The OAuth scopes
2312
+ # @return [::Array<::String>]
2313
+ # @!attribute [rw] lib_name
2314
+ # The library name as recorded in instrumentation and logging
2315
+ # @return [::String]
2316
+ # @!attribute [rw] lib_version
2317
+ # The library version as recorded in instrumentation and logging
2318
+ # @return [::String]
2319
+ # @!attribute [rw] timeout
2320
+ # The call timeout in seconds.
2321
+ # @return [::Numeric]
2322
+ # @!attribute [rw] metadata
2323
+ # Additional headers to be sent with the call.
2324
+ # @return [::Hash{::Symbol=>::String}]
2325
+ # @!attribute [rw] retry_policy
2326
+ # The retry policy. The value is a hash with the following keys:
2327
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2328
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2329
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2330
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2331
+ # trigger a retry.
2332
+ # @return [::Hash]
2333
+ # @!attribute [rw] quota_project
2334
+ # A separate project against which to charge quota.
2335
+ # @return [::String]
2336
+ #
2337
+ class Configuration
2338
+ extend ::Gapic::Config
2339
+
2340
+ config_attr :endpoint, "alloydb.googleapis.com", ::String
2341
+ config_attr :credentials, nil do |value|
2342
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2343
+ allowed.any? { |klass| klass === value }
2344
+ end
2345
+ config_attr :scope, nil, ::String, ::Array, nil
2346
+ config_attr :lib_name, nil, ::String, nil
2347
+ config_attr :lib_version, nil, ::String, nil
2348
+ config_attr :timeout, nil, ::Numeric, nil
2349
+ config_attr :metadata, nil, ::Hash, nil
2350
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2351
+ config_attr :quota_project, nil, ::String, nil
2352
+
2353
+ # @private
2354
+ # Overrides for http bindings for the RPCs of this service
2355
+ # are only used when this service is used as mixin, and only
2356
+ # by the host service.
2357
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
2358
+ config_attr :bindings_override, {}, ::Hash, nil
2359
+
2360
+ # @private
2361
+ def initialize parent_config = nil
2362
+ @parent_config = parent_config unless parent_config.nil?
2363
+
2364
+ yield self if block_given?
2365
+ end
2366
+
2367
+ ##
2368
+ # Configurations for individual RPCs
2369
+ # @return [Rpcs]
2370
+ #
2371
+ def rpcs
2372
+ @rpcs ||= begin
2373
+ parent_rpcs = nil
2374
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2375
+ Rpcs.new parent_rpcs
2376
+ end
2377
+ end
2378
+
2379
+ ##
2380
+ # Configuration RPC class for the AlloyDBAdmin API.
2381
+ #
2382
+ # Includes fields providing the configuration for each RPC in this service.
2383
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2384
+ # the following configuration fields:
2385
+ #
2386
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2387
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
2388
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2389
+ # include the following keys:
2390
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2391
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2392
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2393
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2394
+ # trigger a retry.
2395
+ #
2396
+ class Rpcs
2397
+ ##
2398
+ # RPC-specific configuration for `list_clusters`
2399
+ # @return [::Gapic::Config::Method]
2400
+ #
2401
+ attr_reader :list_clusters
2402
+ ##
2403
+ # RPC-specific configuration for `get_cluster`
2404
+ # @return [::Gapic::Config::Method]
2405
+ #
2406
+ attr_reader :get_cluster
2407
+ ##
2408
+ # RPC-specific configuration for `create_cluster`
2409
+ # @return [::Gapic::Config::Method]
2410
+ #
2411
+ attr_reader :create_cluster
2412
+ ##
2413
+ # RPC-specific configuration for `update_cluster`
2414
+ # @return [::Gapic::Config::Method]
2415
+ #
2416
+ attr_reader :update_cluster
2417
+ ##
2418
+ # RPC-specific configuration for `delete_cluster`
2419
+ # @return [::Gapic::Config::Method]
2420
+ #
2421
+ attr_reader :delete_cluster
2422
+ ##
2423
+ # RPC-specific configuration for `promote_cluster`
2424
+ # @return [::Gapic::Config::Method]
2425
+ #
2426
+ attr_reader :promote_cluster
2427
+ ##
2428
+ # RPC-specific configuration for `restore_cluster`
2429
+ # @return [::Gapic::Config::Method]
2430
+ #
2431
+ attr_reader :restore_cluster
2432
+ ##
2433
+ # RPC-specific configuration for `create_secondary_cluster`
2434
+ # @return [::Gapic::Config::Method]
2435
+ #
2436
+ attr_reader :create_secondary_cluster
2437
+ ##
2438
+ # RPC-specific configuration for `list_instances`
2439
+ # @return [::Gapic::Config::Method]
2440
+ #
2441
+ attr_reader :list_instances
2442
+ ##
2443
+ # RPC-specific configuration for `get_instance`
2444
+ # @return [::Gapic::Config::Method]
2445
+ #
2446
+ attr_reader :get_instance
2447
+ ##
2448
+ # RPC-specific configuration for `create_instance`
2449
+ # @return [::Gapic::Config::Method]
2450
+ #
2451
+ attr_reader :create_instance
2452
+ ##
2453
+ # RPC-specific configuration for `create_secondary_instance`
2454
+ # @return [::Gapic::Config::Method]
2455
+ #
2456
+ attr_reader :create_secondary_instance
2457
+ ##
2458
+ # RPC-specific configuration for `batch_create_instances`
2459
+ # @return [::Gapic::Config::Method]
2460
+ #
2461
+ attr_reader :batch_create_instances
2462
+ ##
2463
+ # RPC-specific configuration for `update_instance`
2464
+ # @return [::Gapic::Config::Method]
2465
+ #
2466
+ attr_reader :update_instance
2467
+ ##
2468
+ # RPC-specific configuration for `delete_instance`
2469
+ # @return [::Gapic::Config::Method]
2470
+ #
2471
+ attr_reader :delete_instance
2472
+ ##
2473
+ # RPC-specific configuration for `failover_instance`
2474
+ # @return [::Gapic::Config::Method]
2475
+ #
2476
+ attr_reader :failover_instance
2477
+ ##
2478
+ # RPC-specific configuration for `restart_instance`
2479
+ # @return [::Gapic::Config::Method]
2480
+ #
2481
+ attr_reader :restart_instance
2482
+ ##
2483
+ # RPC-specific configuration for `list_backups`
2484
+ # @return [::Gapic::Config::Method]
2485
+ #
2486
+ attr_reader :list_backups
2487
+ ##
2488
+ # RPC-specific configuration for `get_backup`
2489
+ # @return [::Gapic::Config::Method]
2490
+ #
2491
+ attr_reader :get_backup
2492
+ ##
2493
+ # RPC-specific configuration for `create_backup`
2494
+ # @return [::Gapic::Config::Method]
2495
+ #
2496
+ attr_reader :create_backup
2497
+ ##
2498
+ # RPC-specific configuration for `update_backup`
2499
+ # @return [::Gapic::Config::Method]
2500
+ #
2501
+ attr_reader :update_backup
2502
+ ##
2503
+ # RPC-specific configuration for `delete_backup`
2504
+ # @return [::Gapic::Config::Method]
2505
+ #
2506
+ attr_reader :delete_backup
2507
+ ##
2508
+ # RPC-specific configuration for `list_supported_database_flags`
2509
+ # @return [::Gapic::Config::Method]
2510
+ #
2511
+ attr_reader :list_supported_database_flags
2512
+ ##
2513
+ # RPC-specific configuration for `generate_client_certificate`
2514
+ # @return [::Gapic::Config::Method]
2515
+ #
2516
+ attr_reader :generate_client_certificate
2517
+ ##
2518
+ # RPC-specific configuration for `get_connection_info`
2519
+ # @return [::Gapic::Config::Method]
2520
+ #
2521
+ attr_reader :get_connection_info
2522
+
2523
+ # @private
2524
+ def initialize parent_rpcs = nil
2525
+ list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters
2526
+ @list_clusters = ::Gapic::Config::Method.new list_clusters_config
2527
+ get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster
2528
+ @get_cluster = ::Gapic::Config::Method.new get_cluster_config
2529
+ create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster
2530
+ @create_cluster = ::Gapic::Config::Method.new create_cluster_config
2531
+ update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster
2532
+ @update_cluster = ::Gapic::Config::Method.new update_cluster_config
2533
+ delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster
2534
+ @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config
2535
+ promote_cluster_config = parent_rpcs.promote_cluster if parent_rpcs.respond_to? :promote_cluster
2536
+ @promote_cluster = ::Gapic::Config::Method.new promote_cluster_config
2537
+ restore_cluster_config = parent_rpcs.restore_cluster if parent_rpcs.respond_to? :restore_cluster
2538
+ @restore_cluster = ::Gapic::Config::Method.new restore_cluster_config
2539
+ create_secondary_cluster_config = parent_rpcs.create_secondary_cluster if parent_rpcs.respond_to? :create_secondary_cluster
2540
+ @create_secondary_cluster = ::Gapic::Config::Method.new create_secondary_cluster_config
2541
+ list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
2542
+ @list_instances = ::Gapic::Config::Method.new list_instances_config
2543
+ get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
2544
+ @get_instance = ::Gapic::Config::Method.new get_instance_config
2545
+ create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
2546
+ @create_instance = ::Gapic::Config::Method.new create_instance_config
2547
+ create_secondary_instance_config = parent_rpcs.create_secondary_instance if parent_rpcs.respond_to? :create_secondary_instance
2548
+ @create_secondary_instance = ::Gapic::Config::Method.new create_secondary_instance_config
2549
+ batch_create_instances_config = parent_rpcs.batch_create_instances if parent_rpcs.respond_to? :batch_create_instances
2550
+ @batch_create_instances = ::Gapic::Config::Method.new batch_create_instances_config
2551
+ update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance
2552
+ @update_instance = ::Gapic::Config::Method.new update_instance_config
2553
+ delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
2554
+ @delete_instance = ::Gapic::Config::Method.new delete_instance_config
2555
+ failover_instance_config = parent_rpcs.failover_instance if parent_rpcs.respond_to? :failover_instance
2556
+ @failover_instance = ::Gapic::Config::Method.new failover_instance_config
2557
+ restart_instance_config = parent_rpcs.restart_instance if parent_rpcs.respond_to? :restart_instance
2558
+ @restart_instance = ::Gapic::Config::Method.new restart_instance_config
2559
+ list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
2560
+ @list_backups = ::Gapic::Config::Method.new list_backups_config
2561
+ get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
2562
+ @get_backup = ::Gapic::Config::Method.new get_backup_config
2563
+ create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup
2564
+ @create_backup = ::Gapic::Config::Method.new create_backup_config
2565
+ update_backup_config = parent_rpcs.update_backup if parent_rpcs.respond_to? :update_backup
2566
+ @update_backup = ::Gapic::Config::Method.new update_backup_config
2567
+ delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup
2568
+ @delete_backup = ::Gapic::Config::Method.new delete_backup_config
2569
+ list_supported_database_flags_config = parent_rpcs.list_supported_database_flags if parent_rpcs.respond_to? :list_supported_database_flags
2570
+ @list_supported_database_flags = ::Gapic::Config::Method.new list_supported_database_flags_config
2571
+ generate_client_certificate_config = parent_rpcs.generate_client_certificate if parent_rpcs.respond_to? :generate_client_certificate
2572
+ @generate_client_certificate = ::Gapic::Config::Method.new generate_client_certificate_config
2573
+ get_connection_info_config = parent_rpcs.get_connection_info if parent_rpcs.respond_to? :get_connection_info
2574
+ @get_connection_info = ::Gapic::Config::Method.new get_connection_info_config
2575
+
2576
+ yield self if block_given?
2577
+ end
2578
+ end
2579
+ end
2580
+ end
2581
+ end
2582
+ end
2583
+ end
2584
+ end
2585
+ end
2586
+ end