google-cloud-alloy_db-v1alpha 0.7.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/client.rb +509 -151
- data/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/rest/client.rb +4262 -0
- data/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/rest/operations.rb +902 -0
- data/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/rest/service_stub.rb +2154 -0
- data/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/rest.rb +54 -0
- data/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin.rb +6 -0
- data/lib/google/cloud/alloy_db/v1alpha/bindings_override.rb +102 -0
- data/lib/google/cloud/alloy_db/v1alpha/rest.rb +38 -0
- data/lib/google/cloud/alloy_db/v1alpha/version.rb +1 -1
- data/lib/google/cloud/alloy_db/v1alpha.rb +5 -0
- data/lib/google/cloud/alloydb/v1alpha/csql_resources_pb.rb +44 -0
- data/lib/google/cloud/alloydb/v1alpha/data_model_pb.rb +45 -0
- data/lib/google/cloud/alloydb/v1alpha/gemini_pb.rb +45 -0
- data/lib/google/cloud/alloydb/v1alpha/resources_pb.rb +11 -1
- data/lib/google/cloud/alloydb/v1alpha/service_pb.rb +22 -1
- data/lib/google/cloud/alloydb/v1alpha/service_services_pb.rb +9 -0
- data/proto_docs/google/api/client.rb +37 -0
- data/proto_docs/google/cloud/alloydb/v1alpha/csql_resources.rb +42 -0
- data/proto_docs/google/cloud/alloydb/v1alpha/data_model.rb +75 -0
- data/proto_docs/google/cloud/alloydb/v1alpha/gemini.rb +52 -0
- data/proto_docs/google/cloud/alloydb/v1alpha/resources.rb +214 -39
- data/proto_docs/google/cloud/alloydb/v1alpha/service.rb +540 -146
- metadata +15 -3
@@ -0,0 +1,4262 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2024 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/v1alpha/service_pb"
|
21
|
+
require "google/cloud/alloy_db/v1alpha/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 V1alpha
|
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
|
+
# @private
|
38
|
+
API_VERSION = ""
|
39
|
+
|
40
|
+
# @private
|
41
|
+
DEFAULT_ENDPOINT_TEMPLATE = "alloydb.$UNIVERSE_DOMAIN$"
|
42
|
+
|
43
|
+
include Paths
|
44
|
+
|
45
|
+
# @private
|
46
|
+
attr_reader :alloy_db_admin_stub
|
47
|
+
|
48
|
+
##
|
49
|
+
# Configure the AlloyDBAdmin Client class.
|
50
|
+
#
|
51
|
+
# See {::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client::Configuration}
|
52
|
+
# for a description of the configuration fields.
|
53
|
+
#
|
54
|
+
# @example
|
55
|
+
#
|
56
|
+
# # Modify the configuration for all AlloyDBAdmin clients
|
57
|
+
# ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.configure do |config|
|
58
|
+
# config.timeout = 10.0
|
59
|
+
# end
|
60
|
+
#
|
61
|
+
# @yield [config] Configure the Client client.
|
62
|
+
# @yieldparam config [Client::Configuration]
|
63
|
+
#
|
64
|
+
# @return [Client::Configuration]
|
65
|
+
#
|
66
|
+
def self.configure
|
67
|
+
@configure ||= begin
|
68
|
+
namespace = ["Google", "Cloud", "AlloyDB", "V1alpha"]
|
69
|
+
parent_config = while namespace.any?
|
70
|
+
parent_name = namespace.join "::"
|
71
|
+
parent_const = const_get parent_name
|
72
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
73
|
+
namespace.pop
|
74
|
+
end
|
75
|
+
default_config = Client::Configuration.new parent_config
|
76
|
+
|
77
|
+
default_config.timeout = 60.0
|
78
|
+
|
79
|
+
default_config.rpcs.list_clusters.timeout = 60.0
|
80
|
+
default_config.rpcs.list_clusters.retry_policy = {
|
81
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
82
|
+
}
|
83
|
+
|
84
|
+
default_config.rpcs.get_cluster.timeout = 60.0
|
85
|
+
default_config.rpcs.get_cluster.retry_policy = {
|
86
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
87
|
+
}
|
88
|
+
|
89
|
+
default_config.rpcs.list_instances.timeout = 60.0
|
90
|
+
default_config.rpcs.list_instances.retry_policy = {
|
91
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
92
|
+
}
|
93
|
+
|
94
|
+
default_config.rpcs.get_instance.timeout = 60.0
|
95
|
+
default_config.rpcs.get_instance.retry_policy = {
|
96
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
97
|
+
}
|
98
|
+
|
99
|
+
default_config.rpcs.list_backups.timeout = 60.0
|
100
|
+
default_config.rpcs.list_backups.retry_policy = {
|
101
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
102
|
+
}
|
103
|
+
|
104
|
+
default_config.rpcs.get_backup.timeout = 60.0
|
105
|
+
default_config.rpcs.get_backup.retry_policy = {
|
106
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
107
|
+
}
|
108
|
+
|
109
|
+
default_config.rpcs.list_supported_database_flags.timeout = 60.0
|
110
|
+
default_config.rpcs.list_supported_database_flags.retry_policy = {
|
111
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
112
|
+
}
|
113
|
+
|
114
|
+
default_config.rpcs.generate_client_certificate.timeout = 60.0
|
115
|
+
default_config.rpcs.generate_client_certificate.retry_policy = {
|
116
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
117
|
+
}
|
118
|
+
|
119
|
+
default_config.rpcs.get_connection_info.timeout = 60.0
|
120
|
+
default_config.rpcs.get_connection_info.retry_policy = {
|
121
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
122
|
+
}
|
123
|
+
|
124
|
+
default_config.rpcs.list_users.timeout = 60.0
|
125
|
+
default_config.rpcs.list_users.retry_policy = {
|
126
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
127
|
+
}
|
128
|
+
|
129
|
+
default_config.rpcs.get_user.timeout = 60.0
|
130
|
+
default_config.rpcs.get_user.retry_policy = {
|
131
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
132
|
+
}
|
133
|
+
|
134
|
+
default_config
|
135
|
+
end
|
136
|
+
yield @configure if block_given?
|
137
|
+
@configure
|
138
|
+
end
|
139
|
+
|
140
|
+
##
|
141
|
+
# Configure the AlloyDBAdmin Client instance.
|
142
|
+
#
|
143
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
144
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
145
|
+
# should be made on {Client.configure}.
|
146
|
+
#
|
147
|
+
# See {::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client::Configuration}
|
148
|
+
# for a description of the configuration fields.
|
149
|
+
#
|
150
|
+
# @yield [config] Configure the Client client.
|
151
|
+
# @yieldparam config [Client::Configuration]
|
152
|
+
#
|
153
|
+
# @return [Client::Configuration]
|
154
|
+
#
|
155
|
+
def configure
|
156
|
+
yield @config if block_given?
|
157
|
+
@config
|
158
|
+
end
|
159
|
+
|
160
|
+
##
|
161
|
+
# The effective universe domain
|
162
|
+
#
|
163
|
+
# @return [String]
|
164
|
+
#
|
165
|
+
def universe_domain
|
166
|
+
@alloy_db_admin_stub.universe_domain
|
167
|
+
end
|
168
|
+
|
169
|
+
##
|
170
|
+
# Create a new AlloyDBAdmin REST client object.
|
171
|
+
#
|
172
|
+
# @example
|
173
|
+
#
|
174
|
+
# # Create a client using the default configuration
|
175
|
+
# client = ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
176
|
+
#
|
177
|
+
# # Create a client using a custom configuration
|
178
|
+
# client = ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new do |config|
|
179
|
+
# config.timeout = 10.0
|
180
|
+
# end
|
181
|
+
#
|
182
|
+
# @yield [config] Configure the AlloyDBAdmin client.
|
183
|
+
# @yieldparam config [Client::Configuration]
|
184
|
+
#
|
185
|
+
def initialize
|
186
|
+
# Create the configuration object
|
187
|
+
@config = Configuration.new Client.configure
|
188
|
+
|
189
|
+
# Yield the configuration if needed
|
190
|
+
yield @config if block_given?
|
191
|
+
|
192
|
+
# Create credentials
|
193
|
+
credentials = @config.credentials
|
194
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
195
|
+
# but only if the default endpoint does not have a region prefix.
|
196
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
197
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
198
|
+
!@config.endpoint.split(".").first.include?("-"))
|
199
|
+
credentials ||= Credentials.default scope: @config.scope,
|
200
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
201
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
202
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
203
|
+
end
|
204
|
+
|
205
|
+
@quota_project_id = @config.quota_project
|
206
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
207
|
+
|
208
|
+
@operations_client = ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Operations.new do |config|
|
209
|
+
config.credentials = credentials
|
210
|
+
config.quota_project = @quota_project_id
|
211
|
+
config.endpoint = @config.endpoint
|
212
|
+
config.universe_domain = @config.universe_domain
|
213
|
+
end
|
214
|
+
|
215
|
+
@alloy_db_admin_stub = ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::ServiceStub.new(
|
216
|
+
endpoint: @config.endpoint,
|
217
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
218
|
+
universe_domain: @config.universe_domain,
|
219
|
+
credentials: credentials
|
220
|
+
)
|
221
|
+
|
222
|
+
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
223
|
+
config.credentials = credentials
|
224
|
+
config.quota_project = @quota_project_id
|
225
|
+
config.endpoint = @alloy_db_admin_stub.endpoint
|
226
|
+
config.universe_domain = @alloy_db_admin_stub.universe_domain
|
227
|
+
config.bindings_override = @config.bindings_override
|
228
|
+
end
|
229
|
+
|
230
|
+
@iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
|
231
|
+
config.credentials = credentials
|
232
|
+
config.quota_project = @quota_project_id
|
233
|
+
config.endpoint = @alloy_db_admin_stub.endpoint
|
234
|
+
config.universe_domain = @alloy_db_admin_stub.universe_domain
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
##
|
239
|
+
# Get the associated client for long-running operations.
|
240
|
+
#
|
241
|
+
# @return [::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Operations]
|
242
|
+
#
|
243
|
+
attr_reader :operations_client
|
244
|
+
|
245
|
+
##
|
246
|
+
# Get the associated client for mix-in of the Locations.
|
247
|
+
#
|
248
|
+
# @return [Google::Cloud::Location::Locations::Rest::Client]
|
249
|
+
#
|
250
|
+
attr_reader :location_client
|
251
|
+
|
252
|
+
##
|
253
|
+
# Get the associated client for mix-in of the IAMPolicy.
|
254
|
+
#
|
255
|
+
# @return [Google::Iam::V1::IAMPolicy::Rest::Client]
|
256
|
+
#
|
257
|
+
attr_reader :iam_policy_client
|
258
|
+
|
259
|
+
# Service calls
|
260
|
+
|
261
|
+
##
|
262
|
+
# Lists Clusters in a given project and location.
|
263
|
+
#
|
264
|
+
# @overload list_clusters(request, options = nil)
|
265
|
+
# Pass arguments to `list_clusters` via a request object, either of type
|
266
|
+
# {::Google::Cloud::AlloyDB::V1alpha::ListClustersRequest} or an equivalent Hash.
|
267
|
+
#
|
268
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::ListClustersRequest, ::Hash]
|
269
|
+
# A request object representing the call parameters. Required. To specify no
|
270
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
271
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
272
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
273
|
+
#
|
274
|
+
# @overload list_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
275
|
+
# Pass arguments to `list_clusters` via keyword arguments. Note that at
|
276
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
277
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
278
|
+
#
|
279
|
+
# @param parent [::String]
|
280
|
+
# Required. The name of the parent resource. For the required format, see the
|
281
|
+
# comment on the Cluster.name field. Additionally, you can perform an
|
282
|
+
# aggregated list operation by specifying a value with the following format:
|
283
|
+
# * projects/\\{project}/locations/-
|
284
|
+
# @param page_size [::Integer]
|
285
|
+
# Optional. Requested page size. Server may return fewer items than
|
286
|
+
# requested. If unspecified, server will pick an appropriate default.
|
287
|
+
# @param page_token [::String]
|
288
|
+
# A token identifying a page of results the server should return.
|
289
|
+
# @param filter [::String]
|
290
|
+
# Optional. Filtering results
|
291
|
+
# @param order_by [::String]
|
292
|
+
# Optional. Hint for how to order the results
|
293
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
294
|
+
# @yieldparam result [::Google::Cloud::AlloyDB::V1alpha::ListClustersResponse]
|
295
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
296
|
+
#
|
297
|
+
# @return [::Google::Cloud::AlloyDB::V1alpha::ListClustersResponse]
|
298
|
+
#
|
299
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
300
|
+
#
|
301
|
+
# @example Basic example
|
302
|
+
# require "google/cloud/alloy_db/v1alpha"
|
303
|
+
#
|
304
|
+
# # Create a client object. The client can be reused for multiple calls.
|
305
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
306
|
+
#
|
307
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
308
|
+
# request = Google::Cloud::AlloyDB::V1alpha::ListClustersRequest.new
|
309
|
+
#
|
310
|
+
# # Call the list_clusters method.
|
311
|
+
# result = client.list_clusters request
|
312
|
+
#
|
313
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
314
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
315
|
+
# result.each do |item|
|
316
|
+
# # Each element is of type ::Google::Cloud::AlloyDB::V1alpha::Cluster.
|
317
|
+
# p item
|
318
|
+
# end
|
319
|
+
#
|
320
|
+
def list_clusters request, options = nil
|
321
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
322
|
+
|
323
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::ListClustersRequest
|
324
|
+
|
325
|
+
# Converts hash and nil to an options object
|
326
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
327
|
+
|
328
|
+
# Customize the options with defaults
|
329
|
+
call_metadata = @config.rpcs.list_clusters.metadata.to_h
|
330
|
+
|
331
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
332
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
333
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
334
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
335
|
+
transports_version_send: [:rest]
|
336
|
+
|
337
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
338
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
339
|
+
|
340
|
+
options.apply_defaults timeout: @config.rpcs.list_clusters.timeout,
|
341
|
+
metadata: call_metadata,
|
342
|
+
retry_policy: @config.rpcs.list_clusters.retry_policy
|
343
|
+
|
344
|
+
options.apply_defaults timeout: @config.timeout,
|
345
|
+
metadata: @config.metadata,
|
346
|
+
retry_policy: @config.retry_policy
|
347
|
+
|
348
|
+
@alloy_db_admin_stub.list_clusters request, options do |result, operation|
|
349
|
+
yield result, operation if block_given?
|
350
|
+
return result
|
351
|
+
end
|
352
|
+
rescue ::Gapic::Rest::Error => e
|
353
|
+
raise ::Google::Cloud::Error.from_error(e)
|
354
|
+
end
|
355
|
+
|
356
|
+
##
|
357
|
+
# Gets details of a single Cluster.
|
358
|
+
#
|
359
|
+
# @overload get_cluster(request, options = nil)
|
360
|
+
# Pass arguments to `get_cluster` via a request object, either of type
|
361
|
+
# {::Google::Cloud::AlloyDB::V1alpha::GetClusterRequest} or an equivalent Hash.
|
362
|
+
#
|
363
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::GetClusterRequest, ::Hash]
|
364
|
+
# A request object representing the call parameters. Required. To specify no
|
365
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
366
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
367
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
368
|
+
#
|
369
|
+
# @overload get_cluster(name: nil, view: nil)
|
370
|
+
# Pass arguments to `get_cluster` via keyword arguments. Note that at
|
371
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
372
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
373
|
+
#
|
374
|
+
# @param name [::String]
|
375
|
+
# Required. The name of the resource. For the required format, see the
|
376
|
+
# comment on the Cluster.name field.
|
377
|
+
# @param view [::Google::Cloud::AlloyDB::V1alpha::ClusterView]
|
378
|
+
# Optional. The view of the cluster to return. Returns all default fields if
|
379
|
+
# not set.
|
380
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
381
|
+
# @yieldparam result [::Google::Cloud::AlloyDB::V1alpha::Cluster]
|
382
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
383
|
+
#
|
384
|
+
# @return [::Google::Cloud::AlloyDB::V1alpha::Cluster]
|
385
|
+
#
|
386
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
387
|
+
#
|
388
|
+
# @example Basic example
|
389
|
+
# require "google/cloud/alloy_db/v1alpha"
|
390
|
+
#
|
391
|
+
# # Create a client object. The client can be reused for multiple calls.
|
392
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
393
|
+
#
|
394
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
395
|
+
# request = Google::Cloud::AlloyDB::V1alpha::GetClusterRequest.new
|
396
|
+
#
|
397
|
+
# # Call the get_cluster method.
|
398
|
+
# result = client.get_cluster request
|
399
|
+
#
|
400
|
+
# # The returned object is of type Google::Cloud::AlloyDB::V1alpha::Cluster.
|
401
|
+
# p result
|
402
|
+
#
|
403
|
+
def get_cluster request, options = nil
|
404
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
405
|
+
|
406
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::GetClusterRequest
|
407
|
+
|
408
|
+
# Converts hash and nil to an options object
|
409
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
410
|
+
|
411
|
+
# Customize the options with defaults
|
412
|
+
call_metadata = @config.rpcs.get_cluster.metadata.to_h
|
413
|
+
|
414
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
415
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
416
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
417
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
418
|
+
transports_version_send: [:rest]
|
419
|
+
|
420
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
421
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
422
|
+
|
423
|
+
options.apply_defaults timeout: @config.rpcs.get_cluster.timeout,
|
424
|
+
metadata: call_metadata,
|
425
|
+
retry_policy: @config.rpcs.get_cluster.retry_policy
|
426
|
+
|
427
|
+
options.apply_defaults timeout: @config.timeout,
|
428
|
+
metadata: @config.metadata,
|
429
|
+
retry_policy: @config.retry_policy
|
430
|
+
|
431
|
+
@alloy_db_admin_stub.get_cluster request, options do |result, operation|
|
432
|
+
yield result, operation if block_given?
|
433
|
+
return result
|
434
|
+
end
|
435
|
+
rescue ::Gapic::Rest::Error => e
|
436
|
+
raise ::Google::Cloud::Error.from_error(e)
|
437
|
+
end
|
438
|
+
|
439
|
+
##
|
440
|
+
# Creates a new Cluster in a given project and location.
|
441
|
+
#
|
442
|
+
# @overload create_cluster(request, options = nil)
|
443
|
+
# Pass arguments to `create_cluster` via a request object, either of type
|
444
|
+
# {::Google::Cloud::AlloyDB::V1alpha::CreateClusterRequest} or an equivalent Hash.
|
445
|
+
#
|
446
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::CreateClusterRequest, ::Hash]
|
447
|
+
# A request object representing the call parameters. Required. To specify no
|
448
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
449
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
450
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
451
|
+
#
|
452
|
+
# @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil)
|
453
|
+
# Pass arguments to `create_cluster` via keyword arguments. Note that at
|
454
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
455
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
456
|
+
#
|
457
|
+
# @param parent [::String]
|
458
|
+
# Required. The location of the new cluster. For the required format, see the
|
459
|
+
# comment on the Cluster.name field.
|
460
|
+
# @param cluster_id [::String]
|
461
|
+
# Required. ID of the requesting object.
|
462
|
+
# @param cluster [::Google::Cloud::AlloyDB::V1alpha::Cluster, ::Hash]
|
463
|
+
# Required. The resource being created
|
464
|
+
# @param request_id [::String]
|
465
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
466
|
+
# request ID so that if you must retry your request, the server ignores the
|
467
|
+
# request if it has already been completed. The server guarantees that for at
|
468
|
+
# least 60 minutes since the first request.
|
469
|
+
#
|
470
|
+
# For example, consider a situation where you make an initial request and
|
471
|
+
# the request times out. If you make the request again with the same request
|
472
|
+
# ID, the server can check if the original operation with the same request ID
|
473
|
+
# was received, and if so, ignores the second request. This prevents
|
474
|
+
# clients from accidentally creating duplicate commitments.
|
475
|
+
#
|
476
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
477
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
478
|
+
# @param validate_only [::Boolean]
|
479
|
+
# Optional. If set, performs request validation, for example, permission
|
480
|
+
# checks and any other type of validation, but does not actually execute the
|
481
|
+
# create request.
|
482
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
483
|
+
# @yieldparam result [::Gapic::Operation]
|
484
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
485
|
+
#
|
486
|
+
# @return [::Gapic::Operation]
|
487
|
+
#
|
488
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
489
|
+
#
|
490
|
+
# @example Basic example
|
491
|
+
# require "google/cloud/alloy_db/v1alpha"
|
492
|
+
#
|
493
|
+
# # Create a client object. The client can be reused for multiple calls.
|
494
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
495
|
+
#
|
496
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
497
|
+
# request = Google::Cloud::AlloyDB::V1alpha::CreateClusterRequest.new
|
498
|
+
#
|
499
|
+
# # Call the create_cluster method.
|
500
|
+
# result = client.create_cluster request
|
501
|
+
#
|
502
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
503
|
+
# # check the status of an operation, cancel it, or wait for results.
|
504
|
+
# # Here is how to wait for a response.
|
505
|
+
# result.wait_until_done! timeout: 60
|
506
|
+
# if result.response?
|
507
|
+
# p result.response
|
508
|
+
# else
|
509
|
+
# puts "No response received."
|
510
|
+
# end
|
511
|
+
#
|
512
|
+
def create_cluster request, options = nil
|
513
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
514
|
+
|
515
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::CreateClusterRequest
|
516
|
+
|
517
|
+
# Converts hash and nil to an options object
|
518
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
519
|
+
|
520
|
+
# Customize the options with defaults
|
521
|
+
call_metadata = @config.rpcs.create_cluster.metadata.to_h
|
522
|
+
|
523
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
524
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
525
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
526
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
527
|
+
transports_version_send: [:rest]
|
528
|
+
|
529
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
530
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
531
|
+
|
532
|
+
options.apply_defaults timeout: @config.rpcs.create_cluster.timeout,
|
533
|
+
metadata: call_metadata,
|
534
|
+
retry_policy: @config.rpcs.create_cluster.retry_policy
|
535
|
+
|
536
|
+
options.apply_defaults timeout: @config.timeout,
|
537
|
+
metadata: @config.metadata,
|
538
|
+
retry_policy: @config.retry_policy
|
539
|
+
|
540
|
+
@alloy_db_admin_stub.create_cluster request, options do |result, operation|
|
541
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
542
|
+
yield result, operation if block_given?
|
543
|
+
return result
|
544
|
+
end
|
545
|
+
rescue ::Gapic::Rest::Error => e
|
546
|
+
raise ::Google::Cloud::Error.from_error(e)
|
547
|
+
end
|
548
|
+
|
549
|
+
##
|
550
|
+
# Updates the parameters of a single Cluster.
|
551
|
+
#
|
552
|
+
# @overload update_cluster(request, options = nil)
|
553
|
+
# Pass arguments to `update_cluster` via a request object, either of type
|
554
|
+
# {::Google::Cloud::AlloyDB::V1alpha::UpdateClusterRequest} or an equivalent Hash.
|
555
|
+
#
|
556
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::UpdateClusterRequest, ::Hash]
|
557
|
+
# A request object representing the call parameters. Required. To specify no
|
558
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
559
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
560
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
561
|
+
#
|
562
|
+
# @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil, validate_only: nil, allow_missing: nil)
|
563
|
+
# Pass arguments to `update_cluster` via keyword arguments. Note that at
|
564
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
565
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
566
|
+
#
|
567
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
568
|
+
# Optional. Field mask is used to specify the fields to be overwritten in the
|
569
|
+
# Cluster resource by the update.
|
570
|
+
# The fields specified in the update_mask are relative to the resource, not
|
571
|
+
# the full request. A field will be overwritten if it is in the mask. If the
|
572
|
+
# user does not provide a mask then all fields will be overwritten.
|
573
|
+
# @param cluster [::Google::Cloud::AlloyDB::V1alpha::Cluster, ::Hash]
|
574
|
+
# Required. The resource being updated
|
575
|
+
# @param request_id [::String]
|
576
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
577
|
+
# request ID so that if you must retry your request, the server ignores the
|
578
|
+
# request if it has already been completed. The server guarantees that for at
|
579
|
+
# least 60 minutes since the first request.
|
580
|
+
#
|
581
|
+
# For example, consider a situation where you make an initial request and
|
582
|
+
# the request times out. If you make the request again with the same request
|
583
|
+
# ID, the server can check if the original operation with the same request ID
|
584
|
+
# was received, and if so, ignores the second request. This prevents
|
585
|
+
# clients from accidentally creating duplicate commitments.
|
586
|
+
#
|
587
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
588
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
589
|
+
# @param validate_only [::Boolean]
|
590
|
+
# Optional. If set, performs request validation, for example, permission
|
591
|
+
# checks and any other type of validation, but does not actually execute the
|
592
|
+
# create request.
|
593
|
+
# @param allow_missing [::Boolean]
|
594
|
+
# Optional. If set to true, update succeeds even if cluster is not found. In
|
595
|
+
# that case, a new cluster is created and `update_mask` is ignored.
|
596
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
597
|
+
# @yieldparam result [::Gapic::Operation]
|
598
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
599
|
+
#
|
600
|
+
# @return [::Gapic::Operation]
|
601
|
+
#
|
602
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
603
|
+
#
|
604
|
+
# @example Basic example
|
605
|
+
# require "google/cloud/alloy_db/v1alpha"
|
606
|
+
#
|
607
|
+
# # Create a client object. The client can be reused for multiple calls.
|
608
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
609
|
+
#
|
610
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
611
|
+
# request = Google::Cloud::AlloyDB::V1alpha::UpdateClusterRequest.new
|
612
|
+
#
|
613
|
+
# # Call the update_cluster method.
|
614
|
+
# result = client.update_cluster request
|
615
|
+
#
|
616
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
617
|
+
# # check the status of an operation, cancel it, or wait for results.
|
618
|
+
# # Here is how to wait for a response.
|
619
|
+
# result.wait_until_done! timeout: 60
|
620
|
+
# if result.response?
|
621
|
+
# p result.response
|
622
|
+
# else
|
623
|
+
# puts "No response received."
|
624
|
+
# end
|
625
|
+
#
|
626
|
+
def update_cluster request, options = nil
|
627
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
628
|
+
|
629
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::UpdateClusterRequest
|
630
|
+
|
631
|
+
# Converts hash and nil to an options object
|
632
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
633
|
+
|
634
|
+
# Customize the options with defaults
|
635
|
+
call_metadata = @config.rpcs.update_cluster.metadata.to_h
|
636
|
+
|
637
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
638
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
639
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
640
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
641
|
+
transports_version_send: [:rest]
|
642
|
+
|
643
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
644
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
645
|
+
|
646
|
+
options.apply_defaults timeout: @config.rpcs.update_cluster.timeout,
|
647
|
+
metadata: call_metadata,
|
648
|
+
retry_policy: @config.rpcs.update_cluster.retry_policy
|
649
|
+
|
650
|
+
options.apply_defaults timeout: @config.timeout,
|
651
|
+
metadata: @config.metadata,
|
652
|
+
retry_policy: @config.retry_policy
|
653
|
+
|
654
|
+
@alloy_db_admin_stub.update_cluster request, options do |result, operation|
|
655
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
656
|
+
yield result, operation if block_given?
|
657
|
+
return result
|
658
|
+
end
|
659
|
+
rescue ::Gapic::Rest::Error => e
|
660
|
+
raise ::Google::Cloud::Error.from_error(e)
|
661
|
+
end
|
662
|
+
|
663
|
+
##
|
664
|
+
# Upgrades a single Cluster.
|
665
|
+
# Imperative only.
|
666
|
+
#
|
667
|
+
# @overload upgrade_cluster(request, options = nil)
|
668
|
+
# Pass arguments to `upgrade_cluster` via a request object, either of type
|
669
|
+
# {::Google::Cloud::AlloyDB::V1alpha::UpgradeClusterRequest} or an equivalent Hash.
|
670
|
+
#
|
671
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::UpgradeClusterRequest, ::Hash]
|
672
|
+
# A request object representing the call parameters. Required. To specify no
|
673
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
674
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
675
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
676
|
+
#
|
677
|
+
# @overload upgrade_cluster(name: nil, version: nil, request_id: nil, validate_only: nil, etag: nil)
|
678
|
+
# Pass arguments to `upgrade_cluster` via keyword arguments. Note that at
|
679
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
680
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
681
|
+
#
|
682
|
+
# @param name [::String]
|
683
|
+
# Required. The resource name of the cluster.
|
684
|
+
# @param version [::Google::Cloud::AlloyDB::V1alpha::DatabaseVersion]
|
685
|
+
# Required. The version the cluster is going to be upgraded to.
|
686
|
+
# @param request_id [::String]
|
687
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
688
|
+
# request ID so that if you must retry your request, the server ignores the
|
689
|
+
# request if it has already been completed. The server guarantees that for at
|
690
|
+
# least 60 minutes since the first request.
|
691
|
+
#
|
692
|
+
# For example, consider a situation where you make an initial request and
|
693
|
+
# the request times out. If you make the request again with the same request
|
694
|
+
# ID, the server can check if the original operation with the same request ID
|
695
|
+
# was received, and if so, ignores the second request. This prevents
|
696
|
+
# clients from accidentally creating duplicate commitments.
|
697
|
+
#
|
698
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
699
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
700
|
+
# @param validate_only [::Boolean]
|
701
|
+
# Optional. If set, performs request validation, for example, permission
|
702
|
+
# checks and any other type of validation, but does not actually execute the
|
703
|
+
# create request.
|
704
|
+
# @param etag [::String]
|
705
|
+
# Optional. The current etag of the Cluster.
|
706
|
+
# If an etag is provided and does not match the current etag of the Cluster,
|
707
|
+
# upgrade will be blocked and an ABORTED error will be returned.
|
708
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
709
|
+
# @yieldparam result [::Gapic::Operation]
|
710
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
711
|
+
#
|
712
|
+
# @return [::Gapic::Operation]
|
713
|
+
#
|
714
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
715
|
+
#
|
716
|
+
# @example Basic example
|
717
|
+
# require "google/cloud/alloy_db/v1alpha"
|
718
|
+
#
|
719
|
+
# # Create a client object. The client can be reused for multiple calls.
|
720
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
721
|
+
#
|
722
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
723
|
+
# request = Google::Cloud::AlloyDB::V1alpha::UpgradeClusterRequest.new
|
724
|
+
#
|
725
|
+
# # Call the upgrade_cluster method.
|
726
|
+
# result = client.upgrade_cluster request
|
727
|
+
#
|
728
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
729
|
+
# # check the status of an operation, cancel it, or wait for results.
|
730
|
+
# # Here is how to wait for a response.
|
731
|
+
# result.wait_until_done! timeout: 60
|
732
|
+
# if result.response?
|
733
|
+
# p result.response
|
734
|
+
# else
|
735
|
+
# puts "No response received."
|
736
|
+
# end
|
737
|
+
#
|
738
|
+
def upgrade_cluster request, options = nil
|
739
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
740
|
+
|
741
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::UpgradeClusterRequest
|
742
|
+
|
743
|
+
# Converts hash and nil to an options object
|
744
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
745
|
+
|
746
|
+
# Customize the options with defaults
|
747
|
+
call_metadata = @config.rpcs.upgrade_cluster.metadata.to_h
|
748
|
+
|
749
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
750
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
751
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
752
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
753
|
+
transports_version_send: [:rest]
|
754
|
+
|
755
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
756
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
757
|
+
|
758
|
+
options.apply_defaults timeout: @config.rpcs.upgrade_cluster.timeout,
|
759
|
+
metadata: call_metadata,
|
760
|
+
retry_policy: @config.rpcs.upgrade_cluster.retry_policy
|
761
|
+
|
762
|
+
options.apply_defaults timeout: @config.timeout,
|
763
|
+
metadata: @config.metadata,
|
764
|
+
retry_policy: @config.retry_policy
|
765
|
+
|
766
|
+
@alloy_db_admin_stub.upgrade_cluster request, options do |result, operation|
|
767
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
768
|
+
yield result, operation if block_given?
|
769
|
+
return result
|
770
|
+
end
|
771
|
+
rescue ::Gapic::Rest::Error => e
|
772
|
+
raise ::Google::Cloud::Error.from_error(e)
|
773
|
+
end
|
774
|
+
|
775
|
+
##
|
776
|
+
# Deletes a single Cluster.
|
777
|
+
#
|
778
|
+
# @overload delete_cluster(request, options = nil)
|
779
|
+
# Pass arguments to `delete_cluster` via a request object, either of type
|
780
|
+
# {::Google::Cloud::AlloyDB::V1alpha::DeleteClusterRequest} or an equivalent Hash.
|
781
|
+
#
|
782
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::DeleteClusterRequest, ::Hash]
|
783
|
+
# A request object representing the call parameters. Required. To specify no
|
784
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
785
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
786
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
787
|
+
#
|
788
|
+
# @overload delete_cluster(name: nil, request_id: nil, etag: nil, validate_only: nil, force: nil)
|
789
|
+
# Pass arguments to `delete_cluster` via keyword arguments. Note that at
|
790
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
791
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
792
|
+
#
|
793
|
+
# @param name [::String]
|
794
|
+
# Required. The name of the resource. For the required format, see the
|
795
|
+
# comment on the Cluster.name field.
|
796
|
+
# @param request_id [::String]
|
797
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
798
|
+
# request ID so that if you must retry your request, the server ignores the
|
799
|
+
# request if it has already been completed. The server guarantees that for at
|
800
|
+
# least 60 minutes since the first request.
|
801
|
+
#
|
802
|
+
# For example, consider a situation where you make an initial request and
|
803
|
+
# the request times out. If you make the request again with the same request
|
804
|
+
# ID, the server can check if the original operation with the same request ID
|
805
|
+
# was received, and if so, ignores the second request. This prevents
|
806
|
+
# clients from accidentally creating duplicate commitments.
|
807
|
+
#
|
808
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
809
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
810
|
+
# @param etag [::String]
|
811
|
+
# Optional. The current etag of the Cluster.
|
812
|
+
# If an etag is provided and does not match the current etag of the Cluster,
|
813
|
+
# deletion will be blocked and an ABORTED error will be returned.
|
814
|
+
# @param validate_only [::Boolean]
|
815
|
+
# Optional. If set, performs request validation, for example, permission
|
816
|
+
# checks and any other type of validation, but does not actually execute the
|
817
|
+
# create request.
|
818
|
+
# @param force [::Boolean]
|
819
|
+
# Optional. Whether to cascade delete child instances for given cluster.
|
820
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
821
|
+
# @yieldparam result [::Gapic::Operation]
|
822
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
823
|
+
#
|
824
|
+
# @return [::Gapic::Operation]
|
825
|
+
#
|
826
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
827
|
+
#
|
828
|
+
# @example Basic example
|
829
|
+
# require "google/cloud/alloy_db/v1alpha"
|
830
|
+
#
|
831
|
+
# # Create a client object. The client can be reused for multiple calls.
|
832
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
833
|
+
#
|
834
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
835
|
+
# request = Google::Cloud::AlloyDB::V1alpha::DeleteClusterRequest.new
|
836
|
+
#
|
837
|
+
# # Call the delete_cluster method.
|
838
|
+
# result = client.delete_cluster request
|
839
|
+
#
|
840
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
841
|
+
# # check the status of an operation, cancel it, or wait for results.
|
842
|
+
# # Here is how to wait for a response.
|
843
|
+
# result.wait_until_done! timeout: 60
|
844
|
+
# if result.response?
|
845
|
+
# p result.response
|
846
|
+
# else
|
847
|
+
# puts "No response received."
|
848
|
+
# end
|
849
|
+
#
|
850
|
+
def delete_cluster request, options = nil
|
851
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
852
|
+
|
853
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::DeleteClusterRequest
|
854
|
+
|
855
|
+
# Converts hash and nil to an options object
|
856
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
857
|
+
|
858
|
+
# Customize the options with defaults
|
859
|
+
call_metadata = @config.rpcs.delete_cluster.metadata.to_h
|
860
|
+
|
861
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
862
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
863
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
864
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
865
|
+
transports_version_send: [:rest]
|
866
|
+
|
867
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
868
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
869
|
+
|
870
|
+
options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout,
|
871
|
+
metadata: call_metadata,
|
872
|
+
retry_policy: @config.rpcs.delete_cluster.retry_policy
|
873
|
+
|
874
|
+
options.apply_defaults timeout: @config.timeout,
|
875
|
+
metadata: @config.metadata,
|
876
|
+
retry_policy: @config.retry_policy
|
877
|
+
|
878
|
+
@alloy_db_admin_stub.delete_cluster request, options do |result, operation|
|
879
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
880
|
+
yield result, operation if block_given?
|
881
|
+
return result
|
882
|
+
end
|
883
|
+
rescue ::Gapic::Rest::Error => e
|
884
|
+
raise ::Google::Cloud::Error.from_error(e)
|
885
|
+
end
|
886
|
+
|
887
|
+
##
|
888
|
+
# Promotes a SECONDARY cluster. This turns down replication
|
889
|
+
# from the PRIMARY cluster and promotes a secondary cluster
|
890
|
+
# into its own standalone cluster.
|
891
|
+
# Imperative only.
|
892
|
+
#
|
893
|
+
# @overload promote_cluster(request, options = nil)
|
894
|
+
# Pass arguments to `promote_cluster` via a request object, either of type
|
895
|
+
# {::Google::Cloud::AlloyDB::V1alpha::PromoteClusterRequest} or an equivalent Hash.
|
896
|
+
#
|
897
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::PromoteClusterRequest, ::Hash]
|
898
|
+
# A request object representing the call parameters. Required. To specify no
|
899
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
900
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
901
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
902
|
+
#
|
903
|
+
# @overload promote_cluster(name: nil, request_id: nil, etag: nil, validate_only: nil)
|
904
|
+
# Pass arguments to `promote_cluster` via keyword arguments. Note that at
|
905
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
906
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
907
|
+
#
|
908
|
+
# @param name [::String]
|
909
|
+
# Required. The name of the resource. For the required format, see the
|
910
|
+
# comment on the Cluster.name field
|
911
|
+
# @param request_id [::String]
|
912
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
913
|
+
# request ID so that if you must retry your request, the server ignores the
|
914
|
+
# request if it has already been completed. The server guarantees that for at
|
915
|
+
# least 60 minutes since the first request.
|
916
|
+
#
|
917
|
+
# For example, consider a situation where you make an initial request and
|
918
|
+
# the request times out. If you make the request again with the same request
|
919
|
+
# ID, the server can check if original operation with the same request ID
|
920
|
+
# was received, and if so, will ignore the second request. This prevents
|
921
|
+
# clients from accidentally creating duplicate commitments.
|
922
|
+
#
|
923
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
924
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
925
|
+
# @param etag [::String]
|
926
|
+
# Optional. The current etag of the Cluster.
|
927
|
+
# If an etag is provided and does not match the current etag of the Cluster,
|
928
|
+
# deletion will be blocked and an ABORTED error will be returned.
|
929
|
+
# @param validate_only [::Boolean]
|
930
|
+
# Optional. If set, performs request validation, for example, permission
|
931
|
+
# checks and any other type of validation, but does not actually execute the
|
932
|
+
# create request.
|
933
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
934
|
+
# @yieldparam result [::Gapic::Operation]
|
935
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
936
|
+
#
|
937
|
+
# @return [::Gapic::Operation]
|
938
|
+
#
|
939
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
940
|
+
#
|
941
|
+
# @example Basic example
|
942
|
+
# require "google/cloud/alloy_db/v1alpha"
|
943
|
+
#
|
944
|
+
# # Create a client object. The client can be reused for multiple calls.
|
945
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
946
|
+
#
|
947
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
948
|
+
# request = Google::Cloud::AlloyDB::V1alpha::PromoteClusterRequest.new
|
949
|
+
#
|
950
|
+
# # Call the promote_cluster method.
|
951
|
+
# result = client.promote_cluster request
|
952
|
+
#
|
953
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
954
|
+
# # check the status of an operation, cancel it, or wait for results.
|
955
|
+
# # Here is how to wait for a response.
|
956
|
+
# result.wait_until_done! timeout: 60
|
957
|
+
# if result.response?
|
958
|
+
# p result.response
|
959
|
+
# else
|
960
|
+
# puts "No response received."
|
961
|
+
# end
|
962
|
+
#
|
963
|
+
def promote_cluster request, options = nil
|
964
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
965
|
+
|
966
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::PromoteClusterRequest
|
967
|
+
|
968
|
+
# Converts hash and nil to an options object
|
969
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
970
|
+
|
971
|
+
# Customize the options with defaults
|
972
|
+
call_metadata = @config.rpcs.promote_cluster.metadata.to_h
|
973
|
+
|
974
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
975
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
976
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
977
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
978
|
+
transports_version_send: [:rest]
|
979
|
+
|
980
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
981
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
982
|
+
|
983
|
+
options.apply_defaults timeout: @config.rpcs.promote_cluster.timeout,
|
984
|
+
metadata: call_metadata,
|
985
|
+
retry_policy: @config.rpcs.promote_cluster.retry_policy
|
986
|
+
|
987
|
+
options.apply_defaults timeout: @config.timeout,
|
988
|
+
metadata: @config.metadata,
|
989
|
+
retry_policy: @config.retry_policy
|
990
|
+
|
991
|
+
@alloy_db_admin_stub.promote_cluster request, options do |result, operation|
|
992
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
993
|
+
yield result, operation if block_given?
|
994
|
+
return result
|
995
|
+
end
|
996
|
+
rescue ::Gapic::Rest::Error => e
|
997
|
+
raise ::Google::Cloud::Error.from_error(e)
|
998
|
+
end
|
999
|
+
|
1000
|
+
##
|
1001
|
+
# Switches the roles of PRIMARY and SECONDARY clusters without any data loss.
|
1002
|
+
# This promotes the SECONDARY cluster to PRIMARY and sets up the original
|
1003
|
+
# PRIMARY cluster to replicate from this newly promoted cluster.
|
1004
|
+
#
|
1005
|
+
# @overload switchover_cluster(request, options = nil)
|
1006
|
+
# Pass arguments to `switchover_cluster` via a request object, either of type
|
1007
|
+
# {::Google::Cloud::AlloyDB::V1alpha::SwitchoverClusterRequest} or an equivalent Hash.
|
1008
|
+
#
|
1009
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::SwitchoverClusterRequest, ::Hash]
|
1010
|
+
# A request object representing the call parameters. Required. To specify no
|
1011
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1012
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1013
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1014
|
+
#
|
1015
|
+
# @overload switchover_cluster(name: nil, request_id: nil, validate_only: nil)
|
1016
|
+
# Pass arguments to `switchover_cluster` via keyword arguments. Note that at
|
1017
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1018
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1019
|
+
#
|
1020
|
+
# @param name [::String]
|
1021
|
+
# Required. The name of the resource. For the required format, see the
|
1022
|
+
# comment on the Cluster.name field
|
1023
|
+
# @param request_id [::String]
|
1024
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
1025
|
+
# request ID so that if you must retry your request, the server ignores the
|
1026
|
+
# request if it has already been completed. The server guarantees that for at
|
1027
|
+
# least 60 minutes since the first request.
|
1028
|
+
#
|
1029
|
+
# For example, consider a situation where you make an initial request and
|
1030
|
+
# the request times out. If you make the request again with the same request
|
1031
|
+
# ID, the server can check if the original operation with the same request ID
|
1032
|
+
# was received, and if so, ignores the second request. This prevents
|
1033
|
+
# clients from accidentally creating duplicate commitments.
|
1034
|
+
#
|
1035
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
1036
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
1037
|
+
# @param validate_only [::Boolean]
|
1038
|
+
# Optional. If set, performs request validation, for example, permission
|
1039
|
+
# checks and any other type of validation, but does not actually execute the
|
1040
|
+
# create request.
|
1041
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1042
|
+
# @yieldparam result [::Gapic::Operation]
|
1043
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1044
|
+
#
|
1045
|
+
# @return [::Gapic::Operation]
|
1046
|
+
#
|
1047
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1048
|
+
#
|
1049
|
+
# @example Basic example
|
1050
|
+
# require "google/cloud/alloy_db/v1alpha"
|
1051
|
+
#
|
1052
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1053
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
1054
|
+
#
|
1055
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1056
|
+
# request = Google::Cloud::AlloyDB::V1alpha::SwitchoverClusterRequest.new
|
1057
|
+
#
|
1058
|
+
# # Call the switchover_cluster method.
|
1059
|
+
# result = client.switchover_cluster request
|
1060
|
+
#
|
1061
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1062
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1063
|
+
# # Here is how to wait for a response.
|
1064
|
+
# result.wait_until_done! timeout: 60
|
1065
|
+
# if result.response?
|
1066
|
+
# p result.response
|
1067
|
+
# else
|
1068
|
+
# puts "No response received."
|
1069
|
+
# end
|
1070
|
+
#
|
1071
|
+
def switchover_cluster request, options = nil
|
1072
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1073
|
+
|
1074
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::SwitchoverClusterRequest
|
1075
|
+
|
1076
|
+
# Converts hash and nil to an options object
|
1077
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1078
|
+
|
1079
|
+
# Customize the options with defaults
|
1080
|
+
call_metadata = @config.rpcs.switchover_cluster.metadata.to_h
|
1081
|
+
|
1082
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1083
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1084
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1085
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
1086
|
+
transports_version_send: [:rest]
|
1087
|
+
|
1088
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1089
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1090
|
+
|
1091
|
+
options.apply_defaults timeout: @config.rpcs.switchover_cluster.timeout,
|
1092
|
+
metadata: call_metadata,
|
1093
|
+
retry_policy: @config.rpcs.switchover_cluster.retry_policy
|
1094
|
+
|
1095
|
+
options.apply_defaults timeout: @config.timeout,
|
1096
|
+
metadata: @config.metadata,
|
1097
|
+
retry_policy: @config.retry_policy
|
1098
|
+
|
1099
|
+
@alloy_db_admin_stub.switchover_cluster request, options do |result, operation|
|
1100
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1101
|
+
yield result, operation if block_given?
|
1102
|
+
return result
|
1103
|
+
end
|
1104
|
+
rescue ::Gapic::Rest::Error => e
|
1105
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1106
|
+
end
|
1107
|
+
|
1108
|
+
##
|
1109
|
+
# Creates a new Cluster in a given project and location, with a volume
|
1110
|
+
# restored from the provided source, either a backup ID or a point-in-time
|
1111
|
+
# and a source cluster.
|
1112
|
+
#
|
1113
|
+
# @overload restore_cluster(request, options = nil)
|
1114
|
+
# Pass arguments to `restore_cluster` via a request object, either of type
|
1115
|
+
# {::Google::Cloud::AlloyDB::V1alpha::RestoreClusterRequest} or an equivalent Hash.
|
1116
|
+
#
|
1117
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::RestoreClusterRequest, ::Hash]
|
1118
|
+
# A request object representing the call parameters. Required. To specify no
|
1119
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1120
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1121
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1122
|
+
#
|
1123
|
+
# @overload restore_cluster(backup_source: nil, continuous_backup_source: nil, parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil)
|
1124
|
+
# Pass arguments to `restore_cluster` via keyword arguments. Note that at
|
1125
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1126
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1127
|
+
#
|
1128
|
+
# @param backup_source [::Google::Cloud::AlloyDB::V1alpha::BackupSource, ::Hash]
|
1129
|
+
# Backup source.
|
1130
|
+
# @param continuous_backup_source [::Google::Cloud::AlloyDB::V1alpha::ContinuousBackupSource, ::Hash]
|
1131
|
+
# ContinuousBackup source. Continuous backup needs to be enabled in the
|
1132
|
+
# source cluster for this operation to succeed.
|
1133
|
+
# @param parent [::String]
|
1134
|
+
# Required. The name of the parent resource. For the required format, see the
|
1135
|
+
# comment on the Cluster.name field.
|
1136
|
+
# @param cluster_id [::String]
|
1137
|
+
# Required. ID of the requesting object.
|
1138
|
+
# @param cluster [::Google::Cloud::AlloyDB::V1alpha::Cluster, ::Hash]
|
1139
|
+
# Required. The resource being created
|
1140
|
+
# @param request_id [::String]
|
1141
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
1142
|
+
# request ID so that if you must retry your request, the server ignores the
|
1143
|
+
# request if it has already been completed. The server guarantees that for at
|
1144
|
+
# least 60 minutes since the first request.
|
1145
|
+
#
|
1146
|
+
# For example, consider a situation where you make an initial request and
|
1147
|
+
# the request times out. If you make the request again with the same request
|
1148
|
+
# ID, the server can check if the original operation with the same request ID
|
1149
|
+
# was received, and if so, ignores the second request. This prevents
|
1150
|
+
# clients from accidentally creating duplicate commitments.
|
1151
|
+
#
|
1152
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
1153
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
1154
|
+
# @param validate_only [::Boolean]
|
1155
|
+
# Optional. If set, performs request validation, for example, permission
|
1156
|
+
# checks and any other type of validation, but does not actually execute the
|
1157
|
+
# create request.
|
1158
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1159
|
+
# @yieldparam result [::Gapic::Operation]
|
1160
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1161
|
+
#
|
1162
|
+
# @return [::Gapic::Operation]
|
1163
|
+
#
|
1164
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1165
|
+
#
|
1166
|
+
# @example Basic example
|
1167
|
+
# require "google/cloud/alloy_db/v1alpha"
|
1168
|
+
#
|
1169
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1170
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
1171
|
+
#
|
1172
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1173
|
+
# request = Google::Cloud::AlloyDB::V1alpha::RestoreClusterRequest.new
|
1174
|
+
#
|
1175
|
+
# # Call the restore_cluster method.
|
1176
|
+
# result = client.restore_cluster request
|
1177
|
+
#
|
1178
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1179
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1180
|
+
# # Here is how to wait for a response.
|
1181
|
+
# result.wait_until_done! timeout: 60
|
1182
|
+
# if result.response?
|
1183
|
+
# p result.response
|
1184
|
+
# else
|
1185
|
+
# puts "No response received."
|
1186
|
+
# end
|
1187
|
+
#
|
1188
|
+
def restore_cluster request, options = nil
|
1189
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1190
|
+
|
1191
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::RestoreClusterRequest
|
1192
|
+
|
1193
|
+
# Converts hash and nil to an options object
|
1194
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1195
|
+
|
1196
|
+
# Customize the options with defaults
|
1197
|
+
call_metadata = @config.rpcs.restore_cluster.metadata.to_h
|
1198
|
+
|
1199
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1200
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1201
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1202
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
1203
|
+
transports_version_send: [:rest]
|
1204
|
+
|
1205
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1206
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1207
|
+
|
1208
|
+
options.apply_defaults timeout: @config.rpcs.restore_cluster.timeout,
|
1209
|
+
metadata: call_metadata,
|
1210
|
+
retry_policy: @config.rpcs.restore_cluster.retry_policy
|
1211
|
+
|
1212
|
+
options.apply_defaults timeout: @config.timeout,
|
1213
|
+
metadata: @config.metadata,
|
1214
|
+
retry_policy: @config.retry_policy
|
1215
|
+
|
1216
|
+
@alloy_db_admin_stub.restore_cluster request, options do |result, operation|
|
1217
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1218
|
+
yield result, operation if block_given?
|
1219
|
+
return result
|
1220
|
+
end
|
1221
|
+
rescue ::Gapic::Rest::Error => e
|
1222
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1223
|
+
end
|
1224
|
+
|
1225
|
+
##
|
1226
|
+
# Creates a cluster of type SECONDARY in the given location using
|
1227
|
+
# the primary cluster as the source.
|
1228
|
+
#
|
1229
|
+
# @overload create_secondary_cluster(request, options = nil)
|
1230
|
+
# Pass arguments to `create_secondary_cluster` via a request object, either of type
|
1231
|
+
# {::Google::Cloud::AlloyDB::V1alpha::CreateSecondaryClusterRequest} or an equivalent Hash.
|
1232
|
+
#
|
1233
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::CreateSecondaryClusterRequest, ::Hash]
|
1234
|
+
# A request object representing the call parameters. Required. To specify no
|
1235
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1236
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1237
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1238
|
+
#
|
1239
|
+
# @overload create_secondary_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil)
|
1240
|
+
# Pass arguments to `create_secondary_cluster` via keyword arguments. Note that at
|
1241
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1242
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1243
|
+
#
|
1244
|
+
# @param parent [::String]
|
1245
|
+
# Required. The location of the new cluster. For the required
|
1246
|
+
# format, see the comment on the Cluster.name field.
|
1247
|
+
# @param cluster_id [::String]
|
1248
|
+
# Required. ID of the requesting object (the secondary cluster).
|
1249
|
+
# @param cluster [::Google::Cloud::AlloyDB::V1alpha::Cluster, ::Hash]
|
1250
|
+
# Required. Configuration of the requesting object (the secondary cluster).
|
1251
|
+
# @param request_id [::String]
|
1252
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
1253
|
+
# request ID so that if you must retry your request, the server ignores the
|
1254
|
+
# request if it has already been completed. The server guarantees that for at
|
1255
|
+
# least 60 minutes since the first request.
|
1256
|
+
#
|
1257
|
+
# For example, consider a situation where you make an initial request and
|
1258
|
+
# the request times out. If you make the request again with the same request
|
1259
|
+
# ID, the server can check if the original operation with the same request ID
|
1260
|
+
# was received, and if so, ignores the second request. This prevents
|
1261
|
+
# clients from accidentally creating duplicate commitments.
|
1262
|
+
#
|
1263
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
1264
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
1265
|
+
# @param validate_only [::Boolean]
|
1266
|
+
# Optional. If set, performs request validation, for example, permission
|
1267
|
+
# checks and any other type of validation, but does not actually execute the
|
1268
|
+
# create request.
|
1269
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1270
|
+
# @yieldparam result [::Gapic::Operation]
|
1271
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1272
|
+
#
|
1273
|
+
# @return [::Gapic::Operation]
|
1274
|
+
#
|
1275
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1276
|
+
#
|
1277
|
+
# @example Basic example
|
1278
|
+
# require "google/cloud/alloy_db/v1alpha"
|
1279
|
+
#
|
1280
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1281
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
1282
|
+
#
|
1283
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1284
|
+
# request = Google::Cloud::AlloyDB::V1alpha::CreateSecondaryClusterRequest.new
|
1285
|
+
#
|
1286
|
+
# # Call the create_secondary_cluster method.
|
1287
|
+
# result = client.create_secondary_cluster request
|
1288
|
+
#
|
1289
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1290
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1291
|
+
# # Here is how to wait for a response.
|
1292
|
+
# result.wait_until_done! timeout: 60
|
1293
|
+
# if result.response?
|
1294
|
+
# p result.response
|
1295
|
+
# else
|
1296
|
+
# puts "No response received."
|
1297
|
+
# end
|
1298
|
+
#
|
1299
|
+
def create_secondary_cluster request, options = nil
|
1300
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1301
|
+
|
1302
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::CreateSecondaryClusterRequest
|
1303
|
+
|
1304
|
+
# Converts hash and nil to an options object
|
1305
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1306
|
+
|
1307
|
+
# Customize the options with defaults
|
1308
|
+
call_metadata = @config.rpcs.create_secondary_cluster.metadata.to_h
|
1309
|
+
|
1310
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1311
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1312
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1313
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
1314
|
+
transports_version_send: [:rest]
|
1315
|
+
|
1316
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1317
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1318
|
+
|
1319
|
+
options.apply_defaults timeout: @config.rpcs.create_secondary_cluster.timeout,
|
1320
|
+
metadata: call_metadata,
|
1321
|
+
retry_policy: @config.rpcs.create_secondary_cluster.retry_policy
|
1322
|
+
|
1323
|
+
options.apply_defaults timeout: @config.timeout,
|
1324
|
+
metadata: @config.metadata,
|
1325
|
+
retry_policy: @config.retry_policy
|
1326
|
+
|
1327
|
+
@alloy_db_admin_stub.create_secondary_cluster request, options do |result, operation|
|
1328
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1329
|
+
yield result, operation if block_given?
|
1330
|
+
return result
|
1331
|
+
end
|
1332
|
+
rescue ::Gapic::Rest::Error => e
|
1333
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1334
|
+
end
|
1335
|
+
|
1336
|
+
##
|
1337
|
+
# Lists Instances in a given project and location.
|
1338
|
+
#
|
1339
|
+
# @overload list_instances(request, options = nil)
|
1340
|
+
# Pass arguments to `list_instances` via a request object, either of type
|
1341
|
+
# {::Google::Cloud::AlloyDB::V1alpha::ListInstancesRequest} or an equivalent Hash.
|
1342
|
+
#
|
1343
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::ListInstancesRequest, ::Hash]
|
1344
|
+
# A request object representing the call parameters. Required. To specify no
|
1345
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1346
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1347
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1348
|
+
#
|
1349
|
+
# @overload list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
1350
|
+
# Pass arguments to `list_instances` via keyword arguments. Note that at
|
1351
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1352
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1353
|
+
#
|
1354
|
+
# @param parent [::String]
|
1355
|
+
# Required. The name of the parent resource. For the required format, see the
|
1356
|
+
# comment on the Instance.name field. Additionally, you can perform an
|
1357
|
+
# aggregated list operation by specifying a value with one of the following
|
1358
|
+
# formats:
|
1359
|
+
# * projects/\\{project}/locations/-/clusters/-
|
1360
|
+
# * projects/\\{project}/locations/\\{region}/clusters/-
|
1361
|
+
# @param page_size [::Integer]
|
1362
|
+
# Optional. Requested page size. Server may return fewer items than
|
1363
|
+
# requested. If unspecified, server will pick an appropriate default.
|
1364
|
+
# @param page_token [::String]
|
1365
|
+
# A token identifying a page of results the server should return.
|
1366
|
+
# @param filter [::String]
|
1367
|
+
# Optional. Filtering results
|
1368
|
+
# @param order_by [::String]
|
1369
|
+
# Optional. Hint for how to order the results
|
1370
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1371
|
+
# @yieldparam result [::Google::Cloud::AlloyDB::V1alpha::ListInstancesResponse]
|
1372
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1373
|
+
#
|
1374
|
+
# @return [::Google::Cloud::AlloyDB::V1alpha::ListInstancesResponse]
|
1375
|
+
#
|
1376
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1377
|
+
#
|
1378
|
+
# @example Basic example
|
1379
|
+
# require "google/cloud/alloy_db/v1alpha"
|
1380
|
+
#
|
1381
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1382
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
1383
|
+
#
|
1384
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1385
|
+
# request = Google::Cloud::AlloyDB::V1alpha::ListInstancesRequest.new
|
1386
|
+
#
|
1387
|
+
# # Call the list_instances method.
|
1388
|
+
# result = client.list_instances request
|
1389
|
+
#
|
1390
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1391
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
1392
|
+
# result.each do |item|
|
1393
|
+
# # Each element is of type ::Google::Cloud::AlloyDB::V1alpha::Instance.
|
1394
|
+
# p item
|
1395
|
+
# end
|
1396
|
+
#
|
1397
|
+
def list_instances request, options = nil
|
1398
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1399
|
+
|
1400
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::ListInstancesRequest
|
1401
|
+
|
1402
|
+
# Converts hash and nil to an options object
|
1403
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1404
|
+
|
1405
|
+
# Customize the options with defaults
|
1406
|
+
call_metadata = @config.rpcs.list_instances.metadata.to_h
|
1407
|
+
|
1408
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1409
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1410
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1411
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
1412
|
+
transports_version_send: [:rest]
|
1413
|
+
|
1414
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1415
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1416
|
+
|
1417
|
+
options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
|
1418
|
+
metadata: call_metadata,
|
1419
|
+
retry_policy: @config.rpcs.list_instances.retry_policy
|
1420
|
+
|
1421
|
+
options.apply_defaults timeout: @config.timeout,
|
1422
|
+
metadata: @config.metadata,
|
1423
|
+
retry_policy: @config.retry_policy
|
1424
|
+
|
1425
|
+
@alloy_db_admin_stub.list_instances request, options do |result, operation|
|
1426
|
+
yield result, operation if block_given?
|
1427
|
+
return result
|
1428
|
+
end
|
1429
|
+
rescue ::Gapic::Rest::Error => e
|
1430
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1431
|
+
end
|
1432
|
+
|
1433
|
+
##
|
1434
|
+
# Gets details of a single Instance.
|
1435
|
+
#
|
1436
|
+
# @overload get_instance(request, options = nil)
|
1437
|
+
# Pass arguments to `get_instance` via a request object, either of type
|
1438
|
+
# {::Google::Cloud::AlloyDB::V1alpha::GetInstanceRequest} or an equivalent Hash.
|
1439
|
+
#
|
1440
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::GetInstanceRequest, ::Hash]
|
1441
|
+
# A request object representing the call parameters. Required. To specify no
|
1442
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1443
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1444
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1445
|
+
#
|
1446
|
+
# @overload get_instance(name: nil, view: nil)
|
1447
|
+
# Pass arguments to `get_instance` via keyword arguments. Note that at
|
1448
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1449
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1450
|
+
#
|
1451
|
+
# @param name [::String]
|
1452
|
+
# Required. The name of the resource. For the required format, see the
|
1453
|
+
# comment on the Instance.name field.
|
1454
|
+
# @param view [::Google::Cloud::AlloyDB::V1alpha::InstanceView]
|
1455
|
+
# The view of the instance to return.
|
1456
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1457
|
+
# @yieldparam result [::Google::Cloud::AlloyDB::V1alpha::Instance]
|
1458
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1459
|
+
#
|
1460
|
+
# @return [::Google::Cloud::AlloyDB::V1alpha::Instance]
|
1461
|
+
#
|
1462
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1463
|
+
#
|
1464
|
+
# @example Basic example
|
1465
|
+
# require "google/cloud/alloy_db/v1alpha"
|
1466
|
+
#
|
1467
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1468
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
1469
|
+
#
|
1470
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1471
|
+
# request = Google::Cloud::AlloyDB::V1alpha::GetInstanceRequest.new
|
1472
|
+
#
|
1473
|
+
# # Call the get_instance method.
|
1474
|
+
# result = client.get_instance request
|
1475
|
+
#
|
1476
|
+
# # The returned object is of type Google::Cloud::AlloyDB::V1alpha::Instance.
|
1477
|
+
# p result
|
1478
|
+
#
|
1479
|
+
def get_instance request, options = nil
|
1480
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1481
|
+
|
1482
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::GetInstanceRequest
|
1483
|
+
|
1484
|
+
# Converts hash and nil to an options object
|
1485
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1486
|
+
|
1487
|
+
# Customize the options with defaults
|
1488
|
+
call_metadata = @config.rpcs.get_instance.metadata.to_h
|
1489
|
+
|
1490
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1491
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1492
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1493
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
1494
|
+
transports_version_send: [:rest]
|
1495
|
+
|
1496
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1497
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1498
|
+
|
1499
|
+
options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
|
1500
|
+
metadata: call_metadata,
|
1501
|
+
retry_policy: @config.rpcs.get_instance.retry_policy
|
1502
|
+
|
1503
|
+
options.apply_defaults timeout: @config.timeout,
|
1504
|
+
metadata: @config.metadata,
|
1505
|
+
retry_policy: @config.retry_policy
|
1506
|
+
|
1507
|
+
@alloy_db_admin_stub.get_instance request, options do |result, operation|
|
1508
|
+
yield result, operation if block_given?
|
1509
|
+
return result
|
1510
|
+
end
|
1511
|
+
rescue ::Gapic::Rest::Error => e
|
1512
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1513
|
+
end
|
1514
|
+
|
1515
|
+
##
|
1516
|
+
# Creates a new Instance in a given project and location.
|
1517
|
+
#
|
1518
|
+
# @overload create_instance(request, options = nil)
|
1519
|
+
# Pass arguments to `create_instance` via a request object, either of type
|
1520
|
+
# {::Google::Cloud::AlloyDB::V1alpha::CreateInstanceRequest} or an equivalent Hash.
|
1521
|
+
#
|
1522
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::CreateInstanceRequest, ::Hash]
|
1523
|
+
# A request object representing the call parameters. Required. To specify no
|
1524
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1525
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1526
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1527
|
+
#
|
1528
|
+
# @overload create_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: nil)
|
1529
|
+
# Pass arguments to `create_instance` via keyword arguments. Note that at
|
1530
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1531
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1532
|
+
#
|
1533
|
+
# @param parent [::String]
|
1534
|
+
# Required. The name of the parent resource. For the required format, see the
|
1535
|
+
# comment on the Instance.name field.
|
1536
|
+
# @param instance_id [::String]
|
1537
|
+
# Required. ID of the requesting object.
|
1538
|
+
# @param instance [::Google::Cloud::AlloyDB::V1alpha::Instance, ::Hash]
|
1539
|
+
# Required. The resource being created
|
1540
|
+
# @param request_id [::String]
|
1541
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
1542
|
+
# request ID so that if you must retry your request, the server ignores the
|
1543
|
+
# request if it has already been completed. The server guarantees that for at
|
1544
|
+
# least 60 minutes since the first request.
|
1545
|
+
#
|
1546
|
+
# For example, consider a situation where you make an initial request and
|
1547
|
+
# the request times out. If you make the request again with the same request
|
1548
|
+
# ID, the server can check if the original operation with the same request ID
|
1549
|
+
# was received, and if so, ignores the second request. This prevents
|
1550
|
+
# clients from accidentally creating duplicate commitments.
|
1551
|
+
#
|
1552
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
1553
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
1554
|
+
# @param validate_only [::Boolean]
|
1555
|
+
# Optional. If set, performs request validation, for example, permission
|
1556
|
+
# checks and any other type of validation, but does not actually execute the
|
1557
|
+
# create request.
|
1558
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1559
|
+
# @yieldparam result [::Gapic::Operation]
|
1560
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1561
|
+
#
|
1562
|
+
# @return [::Gapic::Operation]
|
1563
|
+
#
|
1564
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1565
|
+
#
|
1566
|
+
# @example Basic example
|
1567
|
+
# require "google/cloud/alloy_db/v1alpha"
|
1568
|
+
#
|
1569
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1570
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
1571
|
+
#
|
1572
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1573
|
+
# request = Google::Cloud::AlloyDB::V1alpha::CreateInstanceRequest.new
|
1574
|
+
#
|
1575
|
+
# # Call the create_instance method.
|
1576
|
+
# result = client.create_instance request
|
1577
|
+
#
|
1578
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1579
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1580
|
+
# # Here is how to wait for a response.
|
1581
|
+
# result.wait_until_done! timeout: 60
|
1582
|
+
# if result.response?
|
1583
|
+
# p result.response
|
1584
|
+
# else
|
1585
|
+
# puts "No response received."
|
1586
|
+
# end
|
1587
|
+
#
|
1588
|
+
def create_instance request, options = nil
|
1589
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1590
|
+
|
1591
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::CreateInstanceRequest
|
1592
|
+
|
1593
|
+
# Converts hash and nil to an options object
|
1594
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1595
|
+
|
1596
|
+
# Customize the options with defaults
|
1597
|
+
call_metadata = @config.rpcs.create_instance.metadata.to_h
|
1598
|
+
|
1599
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1600
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1601
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1602
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
1603
|
+
transports_version_send: [:rest]
|
1604
|
+
|
1605
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1606
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1607
|
+
|
1608
|
+
options.apply_defaults timeout: @config.rpcs.create_instance.timeout,
|
1609
|
+
metadata: call_metadata,
|
1610
|
+
retry_policy: @config.rpcs.create_instance.retry_policy
|
1611
|
+
|
1612
|
+
options.apply_defaults timeout: @config.timeout,
|
1613
|
+
metadata: @config.metadata,
|
1614
|
+
retry_policy: @config.retry_policy
|
1615
|
+
|
1616
|
+
@alloy_db_admin_stub.create_instance request, options do |result, operation|
|
1617
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1618
|
+
yield result, operation if block_given?
|
1619
|
+
return result
|
1620
|
+
end
|
1621
|
+
rescue ::Gapic::Rest::Error => e
|
1622
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1623
|
+
end
|
1624
|
+
|
1625
|
+
##
|
1626
|
+
# Creates a new SECONDARY Instance in a given project and location.
|
1627
|
+
#
|
1628
|
+
# @overload create_secondary_instance(request, options = nil)
|
1629
|
+
# Pass arguments to `create_secondary_instance` via a request object, either of type
|
1630
|
+
# {::Google::Cloud::AlloyDB::V1alpha::CreateSecondaryInstanceRequest} or an equivalent Hash.
|
1631
|
+
#
|
1632
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::CreateSecondaryInstanceRequest, ::Hash]
|
1633
|
+
# A request object representing the call parameters. Required. To specify no
|
1634
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1635
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1636
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1637
|
+
#
|
1638
|
+
# @overload create_secondary_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: nil)
|
1639
|
+
# Pass arguments to `create_secondary_instance` via keyword arguments. Note that at
|
1640
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1641
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1642
|
+
#
|
1643
|
+
# @param parent [::String]
|
1644
|
+
# Required. The name of the parent resource. For the required format, see the
|
1645
|
+
# comment on the Instance.name field.
|
1646
|
+
# @param instance_id [::String]
|
1647
|
+
# Required. ID of the requesting object.
|
1648
|
+
# @param instance [::Google::Cloud::AlloyDB::V1alpha::Instance, ::Hash]
|
1649
|
+
# Required. The resource being created
|
1650
|
+
# @param request_id [::String]
|
1651
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
1652
|
+
# request ID so that if you must retry your request, the server ignores the
|
1653
|
+
# request if it has already been completed. The server guarantees that for at
|
1654
|
+
# least 60 minutes since the first request.
|
1655
|
+
#
|
1656
|
+
# For example, consider a situation where you make an initial request and
|
1657
|
+
# the request times out. If you make the request again with the same request
|
1658
|
+
# ID, the server can check if the original operation with the same request ID
|
1659
|
+
# was received, and if so, ignores the second request. This prevents
|
1660
|
+
# clients from accidentally creating duplicate commitments.
|
1661
|
+
#
|
1662
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
1663
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
1664
|
+
# @param validate_only [::Boolean]
|
1665
|
+
# Optional. If set, performs request validation, for example, permission
|
1666
|
+
# checks and any other type of validation, but does not actually execute the
|
1667
|
+
# create request.
|
1668
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1669
|
+
# @yieldparam result [::Gapic::Operation]
|
1670
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1671
|
+
#
|
1672
|
+
# @return [::Gapic::Operation]
|
1673
|
+
#
|
1674
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1675
|
+
#
|
1676
|
+
# @example Basic example
|
1677
|
+
# require "google/cloud/alloy_db/v1alpha"
|
1678
|
+
#
|
1679
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1680
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
1681
|
+
#
|
1682
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1683
|
+
# request = Google::Cloud::AlloyDB::V1alpha::CreateSecondaryInstanceRequest.new
|
1684
|
+
#
|
1685
|
+
# # Call the create_secondary_instance method.
|
1686
|
+
# result = client.create_secondary_instance request
|
1687
|
+
#
|
1688
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1689
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1690
|
+
# # Here is how to wait for a response.
|
1691
|
+
# result.wait_until_done! timeout: 60
|
1692
|
+
# if result.response?
|
1693
|
+
# p result.response
|
1694
|
+
# else
|
1695
|
+
# puts "No response received."
|
1696
|
+
# end
|
1697
|
+
#
|
1698
|
+
def create_secondary_instance request, options = nil
|
1699
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1700
|
+
|
1701
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::CreateSecondaryInstanceRequest
|
1702
|
+
|
1703
|
+
# Converts hash and nil to an options object
|
1704
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1705
|
+
|
1706
|
+
# Customize the options with defaults
|
1707
|
+
call_metadata = @config.rpcs.create_secondary_instance.metadata.to_h
|
1708
|
+
|
1709
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1710
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1711
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1712
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
1713
|
+
transports_version_send: [:rest]
|
1714
|
+
|
1715
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1716
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1717
|
+
|
1718
|
+
options.apply_defaults timeout: @config.rpcs.create_secondary_instance.timeout,
|
1719
|
+
metadata: call_metadata,
|
1720
|
+
retry_policy: @config.rpcs.create_secondary_instance.retry_policy
|
1721
|
+
|
1722
|
+
options.apply_defaults timeout: @config.timeout,
|
1723
|
+
metadata: @config.metadata,
|
1724
|
+
retry_policy: @config.retry_policy
|
1725
|
+
|
1726
|
+
@alloy_db_admin_stub.create_secondary_instance request, options do |result, operation|
|
1727
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1728
|
+
yield result, operation if block_given?
|
1729
|
+
return result
|
1730
|
+
end
|
1731
|
+
rescue ::Gapic::Rest::Error => e
|
1732
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1733
|
+
end
|
1734
|
+
|
1735
|
+
##
|
1736
|
+
# Creates new instances under the given project, location and cluster.
|
1737
|
+
# There can be only one primary instance in a cluster. If the primary
|
1738
|
+
# instance exists in the cluster as well as this request, then API will
|
1739
|
+
# throw an error.
|
1740
|
+
# The primary instance should exist before any read pool instance is
|
1741
|
+
# created. If the primary instance is a part of the request payload, then
|
1742
|
+
# the API will take care of creating instances in the correct order.
|
1743
|
+
# This method is here to support Google-internal use cases, and is not meant
|
1744
|
+
# for external customers to consume. Please do not start relying on it; its
|
1745
|
+
# behavior is subject to change without notice.
|
1746
|
+
#
|
1747
|
+
# @overload batch_create_instances(request, options = nil)
|
1748
|
+
# Pass arguments to `batch_create_instances` via a request object, either of type
|
1749
|
+
# {::Google::Cloud::AlloyDB::V1alpha::BatchCreateInstancesRequest} or an equivalent Hash.
|
1750
|
+
#
|
1751
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::BatchCreateInstancesRequest, ::Hash]
|
1752
|
+
# A request object representing the call parameters. Required. To specify no
|
1753
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1754
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1755
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1756
|
+
#
|
1757
|
+
# @overload batch_create_instances(parent: nil, requests: nil, request_id: nil)
|
1758
|
+
# Pass arguments to `batch_create_instances` via keyword arguments. Note that at
|
1759
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1760
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1761
|
+
#
|
1762
|
+
# @param parent [::String]
|
1763
|
+
# Required. The name of the parent resource.
|
1764
|
+
# @param requests [::Google::Cloud::AlloyDB::V1alpha::CreateInstanceRequests, ::Hash]
|
1765
|
+
# Required. Resources being created.
|
1766
|
+
# @param request_id [::String]
|
1767
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
1768
|
+
# request ID so that if you must retry your request, the server ignores the
|
1769
|
+
# request if it has already been completed. The server guarantees that for at
|
1770
|
+
# least 60 minutes since the first request.
|
1771
|
+
#
|
1772
|
+
# For example, consider a situation where you make an initial request and
|
1773
|
+
# the request times out. If you make the request again with the same request
|
1774
|
+
# ID, the server can check if the original operation with the same request ID
|
1775
|
+
# was received, and if so, ignores the second request. This prevents
|
1776
|
+
# clients from accidentally creating duplicate commitments.
|
1777
|
+
#
|
1778
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
1779
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
1780
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1781
|
+
# @yieldparam result [::Gapic::Operation]
|
1782
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1783
|
+
#
|
1784
|
+
# @return [::Gapic::Operation]
|
1785
|
+
#
|
1786
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1787
|
+
#
|
1788
|
+
# @example Basic example
|
1789
|
+
# require "google/cloud/alloy_db/v1alpha"
|
1790
|
+
#
|
1791
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1792
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
1793
|
+
#
|
1794
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1795
|
+
# request = Google::Cloud::AlloyDB::V1alpha::BatchCreateInstancesRequest.new
|
1796
|
+
#
|
1797
|
+
# # Call the batch_create_instances method.
|
1798
|
+
# result = client.batch_create_instances request
|
1799
|
+
#
|
1800
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1801
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1802
|
+
# # Here is how to wait for a response.
|
1803
|
+
# result.wait_until_done! timeout: 60
|
1804
|
+
# if result.response?
|
1805
|
+
# p result.response
|
1806
|
+
# else
|
1807
|
+
# puts "No response received."
|
1808
|
+
# end
|
1809
|
+
#
|
1810
|
+
def batch_create_instances request, options = nil
|
1811
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1812
|
+
|
1813
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::BatchCreateInstancesRequest
|
1814
|
+
|
1815
|
+
# Converts hash and nil to an options object
|
1816
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1817
|
+
|
1818
|
+
# Customize the options with defaults
|
1819
|
+
call_metadata = @config.rpcs.batch_create_instances.metadata.to_h
|
1820
|
+
|
1821
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1822
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1823
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1824
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
1825
|
+
transports_version_send: [:rest]
|
1826
|
+
|
1827
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1828
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1829
|
+
|
1830
|
+
options.apply_defaults timeout: @config.rpcs.batch_create_instances.timeout,
|
1831
|
+
metadata: call_metadata,
|
1832
|
+
retry_policy: @config.rpcs.batch_create_instances.retry_policy
|
1833
|
+
|
1834
|
+
options.apply_defaults timeout: @config.timeout,
|
1835
|
+
metadata: @config.metadata,
|
1836
|
+
retry_policy: @config.retry_policy
|
1837
|
+
|
1838
|
+
@alloy_db_admin_stub.batch_create_instances request, options do |result, operation|
|
1839
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1840
|
+
yield result, operation if block_given?
|
1841
|
+
return result
|
1842
|
+
end
|
1843
|
+
rescue ::Gapic::Rest::Error => e
|
1844
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1845
|
+
end
|
1846
|
+
|
1847
|
+
##
|
1848
|
+
# Updates the parameters of a single Instance.
|
1849
|
+
#
|
1850
|
+
# @overload update_instance(request, options = nil)
|
1851
|
+
# Pass arguments to `update_instance` via a request object, either of type
|
1852
|
+
# {::Google::Cloud::AlloyDB::V1alpha::UpdateInstanceRequest} or an equivalent Hash.
|
1853
|
+
#
|
1854
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::UpdateInstanceRequest, ::Hash]
|
1855
|
+
# A request object representing the call parameters. Required. To specify no
|
1856
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1857
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1858
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1859
|
+
#
|
1860
|
+
# @overload update_instance(update_mask: nil, instance: nil, request_id: nil, validate_only: nil, allow_missing: nil)
|
1861
|
+
# Pass arguments to `update_instance` via keyword arguments. Note that at
|
1862
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1863
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1864
|
+
#
|
1865
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1866
|
+
# Optional. Field mask is used to specify the fields to be overwritten in the
|
1867
|
+
# Instance resource by the update.
|
1868
|
+
# The fields specified in the update_mask are relative to the resource, not
|
1869
|
+
# the full request. A field will be overwritten if it is in the mask. If the
|
1870
|
+
# user does not provide a mask then all fields will be overwritten.
|
1871
|
+
# @param instance [::Google::Cloud::AlloyDB::V1alpha::Instance, ::Hash]
|
1872
|
+
# Required. The resource being updated
|
1873
|
+
# @param request_id [::String]
|
1874
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
1875
|
+
# request ID so that if you must retry your request, the server ignores the
|
1876
|
+
# request if it has already been completed. The server guarantees that for at
|
1877
|
+
# least 60 minutes since the first request.
|
1878
|
+
#
|
1879
|
+
# For example, consider a situation where you make an initial request and
|
1880
|
+
# the request times out. If you make the request again with the same request
|
1881
|
+
# ID, the server can check if the original operation with the same request ID
|
1882
|
+
# was received, and if so, ignores the second request. This prevents
|
1883
|
+
# clients from accidentally creating duplicate commitments.
|
1884
|
+
#
|
1885
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
1886
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
1887
|
+
# @param validate_only [::Boolean]
|
1888
|
+
# Optional. If set, performs request validation, for example, permission
|
1889
|
+
# checks and any other type of validation, but does not actually execute the
|
1890
|
+
# create request.
|
1891
|
+
# @param allow_missing [::Boolean]
|
1892
|
+
# Optional. If set to true, update succeeds even if instance is not found. In
|
1893
|
+
# that case, a new instance is created and `update_mask` is ignored.
|
1894
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1895
|
+
# @yieldparam result [::Gapic::Operation]
|
1896
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1897
|
+
#
|
1898
|
+
# @return [::Gapic::Operation]
|
1899
|
+
#
|
1900
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1901
|
+
#
|
1902
|
+
# @example Basic example
|
1903
|
+
# require "google/cloud/alloy_db/v1alpha"
|
1904
|
+
#
|
1905
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1906
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
1907
|
+
#
|
1908
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1909
|
+
# request = Google::Cloud::AlloyDB::V1alpha::UpdateInstanceRequest.new
|
1910
|
+
#
|
1911
|
+
# # Call the update_instance method.
|
1912
|
+
# result = client.update_instance request
|
1913
|
+
#
|
1914
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1915
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1916
|
+
# # Here is how to wait for a response.
|
1917
|
+
# result.wait_until_done! timeout: 60
|
1918
|
+
# if result.response?
|
1919
|
+
# p result.response
|
1920
|
+
# else
|
1921
|
+
# puts "No response received."
|
1922
|
+
# end
|
1923
|
+
#
|
1924
|
+
def update_instance request, options = nil
|
1925
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1926
|
+
|
1927
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::UpdateInstanceRequest
|
1928
|
+
|
1929
|
+
# Converts hash and nil to an options object
|
1930
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1931
|
+
|
1932
|
+
# Customize the options with defaults
|
1933
|
+
call_metadata = @config.rpcs.update_instance.metadata.to_h
|
1934
|
+
|
1935
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1936
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1937
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1938
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
1939
|
+
transports_version_send: [:rest]
|
1940
|
+
|
1941
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1942
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1943
|
+
|
1944
|
+
options.apply_defaults timeout: @config.rpcs.update_instance.timeout,
|
1945
|
+
metadata: call_metadata,
|
1946
|
+
retry_policy: @config.rpcs.update_instance.retry_policy
|
1947
|
+
|
1948
|
+
options.apply_defaults timeout: @config.timeout,
|
1949
|
+
metadata: @config.metadata,
|
1950
|
+
retry_policy: @config.retry_policy
|
1951
|
+
|
1952
|
+
@alloy_db_admin_stub.update_instance request, options do |result, operation|
|
1953
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1954
|
+
yield result, operation if block_given?
|
1955
|
+
return result
|
1956
|
+
end
|
1957
|
+
rescue ::Gapic::Rest::Error => e
|
1958
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1959
|
+
end
|
1960
|
+
|
1961
|
+
##
|
1962
|
+
# Deletes a single Instance.
|
1963
|
+
#
|
1964
|
+
# @overload delete_instance(request, options = nil)
|
1965
|
+
# Pass arguments to `delete_instance` via a request object, either of type
|
1966
|
+
# {::Google::Cloud::AlloyDB::V1alpha::DeleteInstanceRequest} or an equivalent Hash.
|
1967
|
+
#
|
1968
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::DeleteInstanceRequest, ::Hash]
|
1969
|
+
# A request object representing the call parameters. Required. To specify no
|
1970
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1971
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1972
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1973
|
+
#
|
1974
|
+
# @overload delete_instance(name: nil, request_id: nil, etag: nil, validate_only: nil)
|
1975
|
+
# Pass arguments to `delete_instance` via keyword arguments. Note that at
|
1976
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1977
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1978
|
+
#
|
1979
|
+
# @param name [::String]
|
1980
|
+
# Required. The name of the resource. For the required format, see the
|
1981
|
+
# comment on the Instance.name field.
|
1982
|
+
# @param request_id [::String]
|
1983
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
1984
|
+
# request ID so that if you must retry your request, the server ignores the
|
1985
|
+
# request if it has already been completed. The server guarantees that for at
|
1986
|
+
# least 60 minutes since the first request.
|
1987
|
+
#
|
1988
|
+
# For example, consider a situation where you make an initial request and
|
1989
|
+
# the request times out. If you make the request again with the same request
|
1990
|
+
# ID, the server can check if the original operation with the same request ID
|
1991
|
+
# was received, and if so, ignores the second request. This prevents
|
1992
|
+
# clients from accidentally creating duplicate commitments.
|
1993
|
+
#
|
1994
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
1995
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
1996
|
+
# @param etag [::String]
|
1997
|
+
# Optional. The current etag of the Instance.
|
1998
|
+
# If an etag is provided and does not match the current etag of the Instance,
|
1999
|
+
# deletion will be blocked and an ABORTED error will be returned.
|
2000
|
+
# @param validate_only [::Boolean]
|
2001
|
+
# Optional. If set, performs request validation, for example, permission
|
2002
|
+
# checks and any other type of validation, but does not actually execute the
|
2003
|
+
# create request.
|
2004
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2005
|
+
# @yieldparam result [::Gapic::Operation]
|
2006
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2007
|
+
#
|
2008
|
+
# @return [::Gapic::Operation]
|
2009
|
+
#
|
2010
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2011
|
+
#
|
2012
|
+
# @example Basic example
|
2013
|
+
# require "google/cloud/alloy_db/v1alpha"
|
2014
|
+
#
|
2015
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2016
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
2017
|
+
#
|
2018
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2019
|
+
# request = Google::Cloud::AlloyDB::V1alpha::DeleteInstanceRequest.new
|
2020
|
+
#
|
2021
|
+
# # Call the delete_instance method.
|
2022
|
+
# result = client.delete_instance request
|
2023
|
+
#
|
2024
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2025
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2026
|
+
# # Here is how to wait for a response.
|
2027
|
+
# result.wait_until_done! timeout: 60
|
2028
|
+
# if result.response?
|
2029
|
+
# p result.response
|
2030
|
+
# else
|
2031
|
+
# puts "No response received."
|
2032
|
+
# end
|
2033
|
+
#
|
2034
|
+
def delete_instance request, options = nil
|
2035
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2036
|
+
|
2037
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::DeleteInstanceRequest
|
2038
|
+
|
2039
|
+
# Converts hash and nil to an options object
|
2040
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2041
|
+
|
2042
|
+
# Customize the options with defaults
|
2043
|
+
call_metadata = @config.rpcs.delete_instance.metadata.to_h
|
2044
|
+
|
2045
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2046
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2047
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2048
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
2049
|
+
transports_version_send: [:rest]
|
2050
|
+
|
2051
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2052
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2053
|
+
|
2054
|
+
options.apply_defaults timeout: @config.rpcs.delete_instance.timeout,
|
2055
|
+
metadata: call_metadata,
|
2056
|
+
retry_policy: @config.rpcs.delete_instance.retry_policy
|
2057
|
+
|
2058
|
+
options.apply_defaults timeout: @config.timeout,
|
2059
|
+
metadata: @config.metadata,
|
2060
|
+
retry_policy: @config.retry_policy
|
2061
|
+
|
2062
|
+
@alloy_db_admin_stub.delete_instance request, options do |result, operation|
|
2063
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2064
|
+
yield result, operation if block_given?
|
2065
|
+
return result
|
2066
|
+
end
|
2067
|
+
rescue ::Gapic::Rest::Error => e
|
2068
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2069
|
+
end
|
2070
|
+
|
2071
|
+
##
|
2072
|
+
# Forces a Failover for a highly available instance.
|
2073
|
+
# Failover promotes the HA standby instance as the new primary.
|
2074
|
+
# Imperative only.
|
2075
|
+
#
|
2076
|
+
# @overload failover_instance(request, options = nil)
|
2077
|
+
# Pass arguments to `failover_instance` via a request object, either of type
|
2078
|
+
# {::Google::Cloud::AlloyDB::V1alpha::FailoverInstanceRequest} or an equivalent Hash.
|
2079
|
+
#
|
2080
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::FailoverInstanceRequest, ::Hash]
|
2081
|
+
# A request object representing the call parameters. Required. To specify no
|
2082
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2083
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2084
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2085
|
+
#
|
2086
|
+
# @overload failover_instance(name: nil, request_id: nil, validate_only: nil)
|
2087
|
+
# Pass arguments to `failover_instance` via keyword arguments. Note that at
|
2088
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2089
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2090
|
+
#
|
2091
|
+
# @param name [::String]
|
2092
|
+
# Required. The name of the resource. For the required format, see the
|
2093
|
+
# comment on the Instance.name field.
|
2094
|
+
# @param request_id [::String]
|
2095
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
2096
|
+
# request ID so that if you must retry your request, the server ignores the
|
2097
|
+
# request if it has already been completed. The server guarantees that for at
|
2098
|
+
# least 60 minutes since the first request.
|
2099
|
+
#
|
2100
|
+
# For example, consider a situation where you make an initial request and
|
2101
|
+
# the request times out. If you make the request again with the same request
|
2102
|
+
# ID, the server can check if the original operation with the same request ID
|
2103
|
+
# was received, and if so, ignores the second request. This prevents
|
2104
|
+
# clients from accidentally creating duplicate commitments.
|
2105
|
+
#
|
2106
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
2107
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
2108
|
+
# @param validate_only [::Boolean]
|
2109
|
+
# Optional. If set, performs request validation, for example, permission
|
2110
|
+
# checks and any other type of validation, but does not actually execute the
|
2111
|
+
# create request.
|
2112
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2113
|
+
# @yieldparam result [::Gapic::Operation]
|
2114
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2115
|
+
#
|
2116
|
+
# @return [::Gapic::Operation]
|
2117
|
+
#
|
2118
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2119
|
+
#
|
2120
|
+
# @example Basic example
|
2121
|
+
# require "google/cloud/alloy_db/v1alpha"
|
2122
|
+
#
|
2123
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2124
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
2125
|
+
#
|
2126
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2127
|
+
# request = Google::Cloud::AlloyDB::V1alpha::FailoverInstanceRequest.new
|
2128
|
+
#
|
2129
|
+
# # Call the failover_instance method.
|
2130
|
+
# result = client.failover_instance request
|
2131
|
+
#
|
2132
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2133
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2134
|
+
# # Here is how to wait for a response.
|
2135
|
+
# result.wait_until_done! timeout: 60
|
2136
|
+
# if result.response?
|
2137
|
+
# p result.response
|
2138
|
+
# else
|
2139
|
+
# puts "No response received."
|
2140
|
+
# end
|
2141
|
+
#
|
2142
|
+
def failover_instance request, options = nil
|
2143
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2144
|
+
|
2145
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::FailoverInstanceRequest
|
2146
|
+
|
2147
|
+
# Converts hash and nil to an options object
|
2148
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2149
|
+
|
2150
|
+
# Customize the options with defaults
|
2151
|
+
call_metadata = @config.rpcs.failover_instance.metadata.to_h
|
2152
|
+
|
2153
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2154
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2155
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2156
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
2157
|
+
transports_version_send: [:rest]
|
2158
|
+
|
2159
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2160
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2161
|
+
|
2162
|
+
options.apply_defaults timeout: @config.rpcs.failover_instance.timeout,
|
2163
|
+
metadata: call_metadata,
|
2164
|
+
retry_policy: @config.rpcs.failover_instance.retry_policy
|
2165
|
+
|
2166
|
+
options.apply_defaults timeout: @config.timeout,
|
2167
|
+
metadata: @config.metadata,
|
2168
|
+
retry_policy: @config.retry_policy
|
2169
|
+
|
2170
|
+
@alloy_db_admin_stub.failover_instance request, options do |result, operation|
|
2171
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2172
|
+
yield result, operation if block_given?
|
2173
|
+
return result
|
2174
|
+
end
|
2175
|
+
rescue ::Gapic::Rest::Error => e
|
2176
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2177
|
+
end
|
2178
|
+
|
2179
|
+
##
|
2180
|
+
# Injects fault in an instance.
|
2181
|
+
# Imperative only.
|
2182
|
+
#
|
2183
|
+
# @overload inject_fault(request, options = nil)
|
2184
|
+
# Pass arguments to `inject_fault` via a request object, either of type
|
2185
|
+
# {::Google::Cloud::AlloyDB::V1alpha::InjectFaultRequest} or an equivalent Hash.
|
2186
|
+
#
|
2187
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::InjectFaultRequest, ::Hash]
|
2188
|
+
# A request object representing the call parameters. Required. To specify no
|
2189
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2190
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2191
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2192
|
+
#
|
2193
|
+
# @overload inject_fault(fault_type: nil, name: nil, request_id: nil, validate_only: nil)
|
2194
|
+
# Pass arguments to `inject_fault` via keyword arguments. Note that at
|
2195
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2196
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2197
|
+
#
|
2198
|
+
# @param fault_type [::Google::Cloud::AlloyDB::V1alpha::InjectFaultRequest::FaultType]
|
2199
|
+
# Required. The type of fault to be injected in an instance.
|
2200
|
+
# @param name [::String]
|
2201
|
+
# Required. The name of the resource. For the required format, see the
|
2202
|
+
# comment on the Instance.name field.
|
2203
|
+
# @param request_id [::String]
|
2204
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
2205
|
+
# request ID so that if you must retry your request, the server ignores the
|
2206
|
+
# request if it has already been completed. The server guarantees that for at
|
2207
|
+
# least 60 minutes since the first request.
|
2208
|
+
#
|
2209
|
+
# For example, consider a situation where you make an initial request and
|
2210
|
+
# the request times out. If you make the request again with the same request
|
2211
|
+
# ID, the server can check if the original operation with the same request ID
|
2212
|
+
# was received, and if so, ignores the second request. This prevents
|
2213
|
+
# clients from accidentally creating duplicate commitments.
|
2214
|
+
#
|
2215
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
2216
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
2217
|
+
# @param validate_only [::Boolean]
|
2218
|
+
# Optional. If set, performs request validation, for example, permission
|
2219
|
+
# checks and any other type of validation, but does not actually execute the
|
2220
|
+
# create request.
|
2221
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2222
|
+
# @yieldparam result [::Gapic::Operation]
|
2223
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2224
|
+
#
|
2225
|
+
# @return [::Gapic::Operation]
|
2226
|
+
#
|
2227
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2228
|
+
#
|
2229
|
+
# @example Basic example
|
2230
|
+
# require "google/cloud/alloy_db/v1alpha"
|
2231
|
+
#
|
2232
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2233
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
2234
|
+
#
|
2235
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2236
|
+
# request = Google::Cloud::AlloyDB::V1alpha::InjectFaultRequest.new
|
2237
|
+
#
|
2238
|
+
# # Call the inject_fault method.
|
2239
|
+
# result = client.inject_fault request
|
2240
|
+
#
|
2241
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2242
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2243
|
+
# # Here is how to wait for a response.
|
2244
|
+
# result.wait_until_done! timeout: 60
|
2245
|
+
# if result.response?
|
2246
|
+
# p result.response
|
2247
|
+
# else
|
2248
|
+
# puts "No response received."
|
2249
|
+
# end
|
2250
|
+
#
|
2251
|
+
def inject_fault request, options = nil
|
2252
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2253
|
+
|
2254
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::InjectFaultRequest
|
2255
|
+
|
2256
|
+
# Converts hash and nil to an options object
|
2257
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2258
|
+
|
2259
|
+
# Customize the options with defaults
|
2260
|
+
call_metadata = @config.rpcs.inject_fault.metadata.to_h
|
2261
|
+
|
2262
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2263
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2264
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2265
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
2266
|
+
transports_version_send: [:rest]
|
2267
|
+
|
2268
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2269
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2270
|
+
|
2271
|
+
options.apply_defaults timeout: @config.rpcs.inject_fault.timeout,
|
2272
|
+
metadata: call_metadata,
|
2273
|
+
retry_policy: @config.rpcs.inject_fault.retry_policy
|
2274
|
+
|
2275
|
+
options.apply_defaults timeout: @config.timeout,
|
2276
|
+
metadata: @config.metadata,
|
2277
|
+
retry_policy: @config.retry_policy
|
2278
|
+
|
2279
|
+
@alloy_db_admin_stub.inject_fault request, options do |result, operation|
|
2280
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2281
|
+
yield result, operation if block_given?
|
2282
|
+
return result
|
2283
|
+
end
|
2284
|
+
rescue ::Gapic::Rest::Error => e
|
2285
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2286
|
+
end
|
2287
|
+
|
2288
|
+
##
|
2289
|
+
# Restart an Instance in a cluster.
|
2290
|
+
# Imperative only.
|
2291
|
+
#
|
2292
|
+
# @overload restart_instance(request, options = nil)
|
2293
|
+
# Pass arguments to `restart_instance` via a request object, either of type
|
2294
|
+
# {::Google::Cloud::AlloyDB::V1alpha::RestartInstanceRequest} or an equivalent Hash.
|
2295
|
+
#
|
2296
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::RestartInstanceRequest, ::Hash]
|
2297
|
+
# A request object representing the call parameters. Required. To specify no
|
2298
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2299
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2300
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2301
|
+
#
|
2302
|
+
# @overload restart_instance(name: nil, request_id: nil, validate_only: nil, node_ids: nil)
|
2303
|
+
# Pass arguments to `restart_instance` via keyword arguments. Note that at
|
2304
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2305
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2306
|
+
#
|
2307
|
+
# @param name [::String]
|
2308
|
+
# Required. The name of the resource. For the required format, see the
|
2309
|
+
# comment on the Instance.name field.
|
2310
|
+
# @param request_id [::String]
|
2311
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
2312
|
+
# request ID so that if you must retry your request, the server ignores the
|
2313
|
+
# request if it has already been completed. The server guarantees that for at
|
2314
|
+
# least 60 minutes since the first request.
|
2315
|
+
#
|
2316
|
+
# For example, consider a situation where you make an initial request and
|
2317
|
+
# the request times out. If you make the request again with the same request
|
2318
|
+
# ID, the server can check if the original operation with the same request ID
|
2319
|
+
# was received, and if so, ignores the second request. This prevents
|
2320
|
+
# clients from accidentally creating duplicate commitments.
|
2321
|
+
#
|
2322
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
2323
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
2324
|
+
# @param validate_only [::Boolean]
|
2325
|
+
# Optional. If set, performs request validation, for example, permission
|
2326
|
+
# checks and any other type of validation, but does not actually execute the
|
2327
|
+
# create request.
|
2328
|
+
# @param node_ids [::Array<::String>]
|
2329
|
+
# Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to
|
2330
|
+
# restart upon. Applicable only to read instances.
|
2331
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2332
|
+
# @yieldparam result [::Gapic::Operation]
|
2333
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2334
|
+
#
|
2335
|
+
# @return [::Gapic::Operation]
|
2336
|
+
#
|
2337
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2338
|
+
#
|
2339
|
+
# @example Basic example
|
2340
|
+
# require "google/cloud/alloy_db/v1alpha"
|
2341
|
+
#
|
2342
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2343
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
2344
|
+
#
|
2345
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2346
|
+
# request = Google::Cloud::AlloyDB::V1alpha::RestartInstanceRequest.new
|
2347
|
+
#
|
2348
|
+
# # Call the restart_instance method.
|
2349
|
+
# result = client.restart_instance request
|
2350
|
+
#
|
2351
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2352
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2353
|
+
# # Here is how to wait for a response.
|
2354
|
+
# result.wait_until_done! timeout: 60
|
2355
|
+
# if result.response?
|
2356
|
+
# p result.response
|
2357
|
+
# else
|
2358
|
+
# puts "No response received."
|
2359
|
+
# end
|
2360
|
+
#
|
2361
|
+
def restart_instance request, options = nil
|
2362
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2363
|
+
|
2364
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::RestartInstanceRequest
|
2365
|
+
|
2366
|
+
# Converts hash and nil to an options object
|
2367
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2368
|
+
|
2369
|
+
# Customize the options with defaults
|
2370
|
+
call_metadata = @config.rpcs.restart_instance.metadata.to_h
|
2371
|
+
|
2372
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2373
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2374
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2375
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
2376
|
+
transports_version_send: [:rest]
|
2377
|
+
|
2378
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2379
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2380
|
+
|
2381
|
+
options.apply_defaults timeout: @config.rpcs.restart_instance.timeout,
|
2382
|
+
metadata: call_metadata,
|
2383
|
+
retry_policy: @config.rpcs.restart_instance.retry_policy
|
2384
|
+
|
2385
|
+
options.apply_defaults timeout: @config.timeout,
|
2386
|
+
metadata: @config.metadata,
|
2387
|
+
retry_policy: @config.retry_policy
|
2388
|
+
|
2389
|
+
@alloy_db_admin_stub.restart_instance request, options do |result, operation|
|
2390
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2391
|
+
yield result, operation if block_given?
|
2392
|
+
return result
|
2393
|
+
end
|
2394
|
+
rescue ::Gapic::Rest::Error => e
|
2395
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2396
|
+
end
|
2397
|
+
|
2398
|
+
##
|
2399
|
+
# Executes a SQL statement in a database inside an AlloyDB instance.
|
2400
|
+
#
|
2401
|
+
# @overload execute_sql(request, options = nil)
|
2402
|
+
# Pass arguments to `execute_sql` via a request object, either of type
|
2403
|
+
# {::Google::Cloud::AlloyDB::V1alpha::ExecuteSqlRequest} or an equivalent Hash.
|
2404
|
+
#
|
2405
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::ExecuteSqlRequest, ::Hash]
|
2406
|
+
# A request object representing the call parameters. Required. To specify no
|
2407
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2408
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2409
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2410
|
+
#
|
2411
|
+
# @overload execute_sql(password: nil, instance: nil, database: nil, user: nil, sql_statement: nil)
|
2412
|
+
# Pass arguments to `execute_sql` via keyword arguments. Note that at
|
2413
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2414
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2415
|
+
#
|
2416
|
+
# @param password [::String]
|
2417
|
+
# Optional. The database native user’s password.
|
2418
|
+
# @param instance [::String]
|
2419
|
+
# Required. The instance where the SQL will be executed. For the required
|
2420
|
+
# format, see the comment on the Instance.name field.
|
2421
|
+
# @param database [::String]
|
2422
|
+
# Required. Name of the database where the query will be executed.
|
2423
|
+
# Note - Value provided should be the same as expected from `SELECT
|
2424
|
+
# current_database();` and NOT as a resource reference.
|
2425
|
+
# @param user [::String]
|
2426
|
+
# Required. Database user to be used for executing the SQL.
|
2427
|
+
# Note - Value provided should be the same as expected from
|
2428
|
+
# `SELECT current_user;` and NOT as a resource reference.
|
2429
|
+
# @param sql_statement [::String]
|
2430
|
+
# Required. SQL statement to execute on database. Any valid statement is
|
2431
|
+
# permitted, including DDL, DML, DQL statements.
|
2432
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2433
|
+
# @yieldparam result [::Google::Cloud::AlloyDB::V1alpha::ExecuteSqlResponse]
|
2434
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2435
|
+
#
|
2436
|
+
# @return [::Google::Cloud::AlloyDB::V1alpha::ExecuteSqlResponse]
|
2437
|
+
#
|
2438
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2439
|
+
#
|
2440
|
+
# @example Basic example
|
2441
|
+
# require "google/cloud/alloy_db/v1alpha"
|
2442
|
+
#
|
2443
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2444
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
2445
|
+
#
|
2446
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2447
|
+
# request = Google::Cloud::AlloyDB::V1alpha::ExecuteSqlRequest.new
|
2448
|
+
#
|
2449
|
+
# # Call the execute_sql method.
|
2450
|
+
# result = client.execute_sql request
|
2451
|
+
#
|
2452
|
+
# # The returned object is of type Google::Cloud::AlloyDB::V1alpha::ExecuteSqlResponse.
|
2453
|
+
# p result
|
2454
|
+
#
|
2455
|
+
def execute_sql request, options = nil
|
2456
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2457
|
+
|
2458
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::ExecuteSqlRequest
|
2459
|
+
|
2460
|
+
# Converts hash and nil to an options object
|
2461
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2462
|
+
|
2463
|
+
# Customize the options with defaults
|
2464
|
+
call_metadata = @config.rpcs.execute_sql.metadata.to_h
|
2465
|
+
|
2466
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2467
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2468
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2469
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
2470
|
+
transports_version_send: [:rest]
|
2471
|
+
|
2472
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2473
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2474
|
+
|
2475
|
+
options.apply_defaults timeout: @config.rpcs.execute_sql.timeout,
|
2476
|
+
metadata: call_metadata,
|
2477
|
+
retry_policy: @config.rpcs.execute_sql.retry_policy
|
2478
|
+
|
2479
|
+
options.apply_defaults timeout: @config.timeout,
|
2480
|
+
metadata: @config.metadata,
|
2481
|
+
retry_policy: @config.retry_policy
|
2482
|
+
|
2483
|
+
@alloy_db_admin_stub.execute_sql request, options do |result, operation|
|
2484
|
+
yield result, operation if block_given?
|
2485
|
+
return result
|
2486
|
+
end
|
2487
|
+
rescue ::Gapic::Rest::Error => e
|
2488
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2489
|
+
end
|
2490
|
+
|
2491
|
+
##
|
2492
|
+
# Lists Backups in a given project and location.
|
2493
|
+
#
|
2494
|
+
# @overload list_backups(request, options = nil)
|
2495
|
+
# Pass arguments to `list_backups` via a request object, either of type
|
2496
|
+
# {::Google::Cloud::AlloyDB::V1alpha::ListBackupsRequest} or an equivalent Hash.
|
2497
|
+
#
|
2498
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::ListBackupsRequest, ::Hash]
|
2499
|
+
# A request object representing the call parameters. Required. To specify no
|
2500
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2501
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2502
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2503
|
+
#
|
2504
|
+
# @overload list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
2505
|
+
# Pass arguments to `list_backups` via keyword arguments. Note that at
|
2506
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2507
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2508
|
+
#
|
2509
|
+
# @param parent [::String]
|
2510
|
+
# Required. Parent value for ListBackupsRequest
|
2511
|
+
# @param page_size [::Integer]
|
2512
|
+
# Requested page size. Server may return fewer items than requested.
|
2513
|
+
# If unspecified, server will pick an appropriate default.
|
2514
|
+
# @param page_token [::String]
|
2515
|
+
# A token identifying a page of results the server should return.
|
2516
|
+
# @param filter [::String]
|
2517
|
+
# Filtering results
|
2518
|
+
# @param order_by [::String]
|
2519
|
+
# Hint for how to order the results
|
2520
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2521
|
+
# @yieldparam result [::Google::Cloud::AlloyDB::V1alpha::ListBackupsResponse]
|
2522
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2523
|
+
#
|
2524
|
+
# @return [::Google::Cloud::AlloyDB::V1alpha::ListBackupsResponse]
|
2525
|
+
#
|
2526
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2527
|
+
#
|
2528
|
+
# @example Basic example
|
2529
|
+
# require "google/cloud/alloy_db/v1alpha"
|
2530
|
+
#
|
2531
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2532
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
2533
|
+
#
|
2534
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2535
|
+
# request = Google::Cloud::AlloyDB::V1alpha::ListBackupsRequest.new
|
2536
|
+
#
|
2537
|
+
# # Call the list_backups method.
|
2538
|
+
# result = client.list_backups request
|
2539
|
+
#
|
2540
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
2541
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
2542
|
+
# result.each do |item|
|
2543
|
+
# # Each element is of type ::Google::Cloud::AlloyDB::V1alpha::Backup.
|
2544
|
+
# p item
|
2545
|
+
# end
|
2546
|
+
#
|
2547
|
+
def list_backups request, options = nil
|
2548
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2549
|
+
|
2550
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::ListBackupsRequest
|
2551
|
+
|
2552
|
+
# Converts hash and nil to an options object
|
2553
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2554
|
+
|
2555
|
+
# Customize the options with defaults
|
2556
|
+
call_metadata = @config.rpcs.list_backups.metadata.to_h
|
2557
|
+
|
2558
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2559
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2560
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2561
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
2562
|
+
transports_version_send: [:rest]
|
2563
|
+
|
2564
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2565
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2566
|
+
|
2567
|
+
options.apply_defaults timeout: @config.rpcs.list_backups.timeout,
|
2568
|
+
metadata: call_metadata,
|
2569
|
+
retry_policy: @config.rpcs.list_backups.retry_policy
|
2570
|
+
|
2571
|
+
options.apply_defaults timeout: @config.timeout,
|
2572
|
+
metadata: @config.metadata,
|
2573
|
+
retry_policy: @config.retry_policy
|
2574
|
+
|
2575
|
+
@alloy_db_admin_stub.list_backups request, options do |result, operation|
|
2576
|
+
yield result, operation if block_given?
|
2577
|
+
return result
|
2578
|
+
end
|
2579
|
+
rescue ::Gapic::Rest::Error => e
|
2580
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2581
|
+
end
|
2582
|
+
|
2583
|
+
##
|
2584
|
+
# Gets details of a single Backup.
|
2585
|
+
#
|
2586
|
+
# @overload get_backup(request, options = nil)
|
2587
|
+
# Pass arguments to `get_backup` via a request object, either of type
|
2588
|
+
# {::Google::Cloud::AlloyDB::V1alpha::GetBackupRequest} or an equivalent Hash.
|
2589
|
+
#
|
2590
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::GetBackupRequest, ::Hash]
|
2591
|
+
# A request object representing the call parameters. Required. To specify no
|
2592
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2593
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2594
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2595
|
+
#
|
2596
|
+
# @overload get_backup(name: nil)
|
2597
|
+
# Pass arguments to `get_backup` via keyword arguments. Note that at
|
2598
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2599
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2600
|
+
#
|
2601
|
+
# @param name [::String]
|
2602
|
+
# Required. Name of the resource
|
2603
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2604
|
+
# @yieldparam result [::Google::Cloud::AlloyDB::V1alpha::Backup]
|
2605
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2606
|
+
#
|
2607
|
+
# @return [::Google::Cloud::AlloyDB::V1alpha::Backup]
|
2608
|
+
#
|
2609
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2610
|
+
#
|
2611
|
+
# @example Basic example
|
2612
|
+
# require "google/cloud/alloy_db/v1alpha"
|
2613
|
+
#
|
2614
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2615
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
2616
|
+
#
|
2617
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2618
|
+
# request = Google::Cloud::AlloyDB::V1alpha::GetBackupRequest.new
|
2619
|
+
#
|
2620
|
+
# # Call the get_backup method.
|
2621
|
+
# result = client.get_backup request
|
2622
|
+
#
|
2623
|
+
# # The returned object is of type Google::Cloud::AlloyDB::V1alpha::Backup.
|
2624
|
+
# p result
|
2625
|
+
#
|
2626
|
+
def get_backup request, options = nil
|
2627
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2628
|
+
|
2629
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::GetBackupRequest
|
2630
|
+
|
2631
|
+
# Converts hash and nil to an options object
|
2632
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2633
|
+
|
2634
|
+
# Customize the options with defaults
|
2635
|
+
call_metadata = @config.rpcs.get_backup.metadata.to_h
|
2636
|
+
|
2637
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2638
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2639
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2640
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
2641
|
+
transports_version_send: [:rest]
|
2642
|
+
|
2643
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2644
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2645
|
+
|
2646
|
+
options.apply_defaults timeout: @config.rpcs.get_backup.timeout,
|
2647
|
+
metadata: call_metadata,
|
2648
|
+
retry_policy: @config.rpcs.get_backup.retry_policy
|
2649
|
+
|
2650
|
+
options.apply_defaults timeout: @config.timeout,
|
2651
|
+
metadata: @config.metadata,
|
2652
|
+
retry_policy: @config.retry_policy
|
2653
|
+
|
2654
|
+
@alloy_db_admin_stub.get_backup request, options do |result, operation|
|
2655
|
+
yield result, operation if block_given?
|
2656
|
+
return result
|
2657
|
+
end
|
2658
|
+
rescue ::Gapic::Rest::Error => e
|
2659
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2660
|
+
end
|
2661
|
+
|
2662
|
+
##
|
2663
|
+
# Creates a new Backup in a given project and location.
|
2664
|
+
#
|
2665
|
+
# @overload create_backup(request, options = nil)
|
2666
|
+
# Pass arguments to `create_backup` via a request object, either of type
|
2667
|
+
# {::Google::Cloud::AlloyDB::V1alpha::CreateBackupRequest} or an equivalent Hash.
|
2668
|
+
#
|
2669
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::CreateBackupRequest, ::Hash]
|
2670
|
+
# A request object representing the call parameters. Required. To specify no
|
2671
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2672
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2673
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2674
|
+
#
|
2675
|
+
# @overload create_backup(parent: nil, backup_id: nil, backup: nil, request_id: nil, validate_only: nil)
|
2676
|
+
# Pass arguments to `create_backup` via keyword arguments. Note that at
|
2677
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2678
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2679
|
+
#
|
2680
|
+
# @param parent [::String]
|
2681
|
+
# Required. Value for parent.
|
2682
|
+
# @param backup_id [::String]
|
2683
|
+
# Required. ID of the requesting object.
|
2684
|
+
# @param backup [::Google::Cloud::AlloyDB::V1alpha::Backup, ::Hash]
|
2685
|
+
# Required. The resource being created
|
2686
|
+
# @param request_id [::String]
|
2687
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
2688
|
+
# request ID so that if you must retry your request, the server ignores the
|
2689
|
+
# request if it has already been completed. The server guarantees that for at
|
2690
|
+
# least 60 minutes since the first request.
|
2691
|
+
#
|
2692
|
+
# For example, consider a situation where you make an initial request and
|
2693
|
+
# the request times out. If you make the request again with the same request
|
2694
|
+
# ID, the server can check if the original operation with the same request ID
|
2695
|
+
# was received, and if so, ignores the second request. This prevents
|
2696
|
+
# clients from accidentally creating duplicate commitments.
|
2697
|
+
#
|
2698
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
2699
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
2700
|
+
# @param validate_only [::Boolean]
|
2701
|
+
# Optional. If set, the backend validates the request, but doesn't actually
|
2702
|
+
# execute it.
|
2703
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2704
|
+
# @yieldparam result [::Gapic::Operation]
|
2705
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2706
|
+
#
|
2707
|
+
# @return [::Gapic::Operation]
|
2708
|
+
#
|
2709
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2710
|
+
#
|
2711
|
+
# @example Basic example
|
2712
|
+
# require "google/cloud/alloy_db/v1alpha"
|
2713
|
+
#
|
2714
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2715
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
2716
|
+
#
|
2717
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2718
|
+
# request = Google::Cloud::AlloyDB::V1alpha::CreateBackupRequest.new
|
2719
|
+
#
|
2720
|
+
# # Call the create_backup method.
|
2721
|
+
# result = client.create_backup request
|
2722
|
+
#
|
2723
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2724
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2725
|
+
# # Here is how to wait for a response.
|
2726
|
+
# result.wait_until_done! timeout: 60
|
2727
|
+
# if result.response?
|
2728
|
+
# p result.response
|
2729
|
+
# else
|
2730
|
+
# puts "No response received."
|
2731
|
+
# end
|
2732
|
+
#
|
2733
|
+
def create_backup request, options = nil
|
2734
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2735
|
+
|
2736
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::CreateBackupRequest
|
2737
|
+
|
2738
|
+
# Converts hash and nil to an options object
|
2739
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2740
|
+
|
2741
|
+
# Customize the options with defaults
|
2742
|
+
call_metadata = @config.rpcs.create_backup.metadata.to_h
|
2743
|
+
|
2744
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2745
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2746
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2747
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
2748
|
+
transports_version_send: [:rest]
|
2749
|
+
|
2750
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2751
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2752
|
+
|
2753
|
+
options.apply_defaults timeout: @config.rpcs.create_backup.timeout,
|
2754
|
+
metadata: call_metadata,
|
2755
|
+
retry_policy: @config.rpcs.create_backup.retry_policy
|
2756
|
+
|
2757
|
+
options.apply_defaults timeout: @config.timeout,
|
2758
|
+
metadata: @config.metadata,
|
2759
|
+
retry_policy: @config.retry_policy
|
2760
|
+
|
2761
|
+
@alloy_db_admin_stub.create_backup request, options do |result, operation|
|
2762
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2763
|
+
yield result, operation if block_given?
|
2764
|
+
return result
|
2765
|
+
end
|
2766
|
+
rescue ::Gapic::Rest::Error => e
|
2767
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2768
|
+
end
|
2769
|
+
|
2770
|
+
##
|
2771
|
+
# Updates the parameters of a single Backup.
|
2772
|
+
#
|
2773
|
+
# @overload update_backup(request, options = nil)
|
2774
|
+
# Pass arguments to `update_backup` via a request object, either of type
|
2775
|
+
# {::Google::Cloud::AlloyDB::V1alpha::UpdateBackupRequest} or an equivalent Hash.
|
2776
|
+
#
|
2777
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::UpdateBackupRequest, ::Hash]
|
2778
|
+
# A request object representing the call parameters. Required. To specify no
|
2779
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2780
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2781
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2782
|
+
#
|
2783
|
+
# @overload update_backup(update_mask: nil, backup: nil, request_id: nil, validate_only: nil, allow_missing: nil)
|
2784
|
+
# Pass arguments to `update_backup` via keyword arguments. Note that at
|
2785
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2786
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2787
|
+
#
|
2788
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
2789
|
+
# Optional. Field mask is used to specify the fields to be overwritten in the
|
2790
|
+
# Backup resource by the update.
|
2791
|
+
# The fields specified in the update_mask are relative to the resource, not
|
2792
|
+
# the full request. A field will be overwritten if it is in the mask. If the
|
2793
|
+
# user does not provide a mask then all fields will be overwritten.
|
2794
|
+
# @param backup [::Google::Cloud::AlloyDB::V1alpha::Backup, ::Hash]
|
2795
|
+
# Required. The resource being updated
|
2796
|
+
# @param request_id [::String]
|
2797
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
2798
|
+
# request ID so that if you must retry your request, the server ignores the
|
2799
|
+
# request if it has already been completed. The server guarantees that for at
|
2800
|
+
# least 60 minutes since the first request.
|
2801
|
+
#
|
2802
|
+
# For example, consider a situation where you make an initial request and
|
2803
|
+
# the request times out. If you make the request again with the same request
|
2804
|
+
# ID, the server can check if the original operation with the same request ID
|
2805
|
+
# was received, and if so, ignores the second request. This prevents
|
2806
|
+
# clients from accidentally creating duplicate commitments.
|
2807
|
+
#
|
2808
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
2809
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
2810
|
+
# @param validate_only [::Boolean]
|
2811
|
+
# Optional. If set, the backend validates the request, but doesn't actually
|
2812
|
+
# execute it.
|
2813
|
+
# @param allow_missing [::Boolean]
|
2814
|
+
# Optional. If set to true, update succeeds even if instance is not found. In
|
2815
|
+
# that case, a new backup is created and `update_mask` is ignored.
|
2816
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2817
|
+
# @yieldparam result [::Gapic::Operation]
|
2818
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2819
|
+
#
|
2820
|
+
# @return [::Gapic::Operation]
|
2821
|
+
#
|
2822
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2823
|
+
#
|
2824
|
+
# @example Basic example
|
2825
|
+
# require "google/cloud/alloy_db/v1alpha"
|
2826
|
+
#
|
2827
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2828
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
2829
|
+
#
|
2830
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2831
|
+
# request = Google::Cloud::AlloyDB::V1alpha::UpdateBackupRequest.new
|
2832
|
+
#
|
2833
|
+
# # Call the update_backup method.
|
2834
|
+
# result = client.update_backup request
|
2835
|
+
#
|
2836
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2837
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2838
|
+
# # Here is how to wait for a response.
|
2839
|
+
# result.wait_until_done! timeout: 60
|
2840
|
+
# if result.response?
|
2841
|
+
# p result.response
|
2842
|
+
# else
|
2843
|
+
# puts "No response received."
|
2844
|
+
# end
|
2845
|
+
#
|
2846
|
+
def update_backup request, options = nil
|
2847
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2848
|
+
|
2849
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::UpdateBackupRequest
|
2850
|
+
|
2851
|
+
# Converts hash and nil to an options object
|
2852
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2853
|
+
|
2854
|
+
# Customize the options with defaults
|
2855
|
+
call_metadata = @config.rpcs.update_backup.metadata.to_h
|
2856
|
+
|
2857
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2858
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2859
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2860
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
2861
|
+
transports_version_send: [:rest]
|
2862
|
+
|
2863
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2864
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2865
|
+
|
2866
|
+
options.apply_defaults timeout: @config.rpcs.update_backup.timeout,
|
2867
|
+
metadata: call_metadata,
|
2868
|
+
retry_policy: @config.rpcs.update_backup.retry_policy
|
2869
|
+
|
2870
|
+
options.apply_defaults timeout: @config.timeout,
|
2871
|
+
metadata: @config.metadata,
|
2872
|
+
retry_policy: @config.retry_policy
|
2873
|
+
|
2874
|
+
@alloy_db_admin_stub.update_backup request, options do |result, operation|
|
2875
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2876
|
+
yield result, operation if block_given?
|
2877
|
+
return result
|
2878
|
+
end
|
2879
|
+
rescue ::Gapic::Rest::Error => e
|
2880
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2881
|
+
end
|
2882
|
+
|
2883
|
+
##
|
2884
|
+
# Deletes a single Backup.
|
2885
|
+
#
|
2886
|
+
# @overload delete_backup(request, options = nil)
|
2887
|
+
# Pass arguments to `delete_backup` via a request object, either of type
|
2888
|
+
# {::Google::Cloud::AlloyDB::V1alpha::DeleteBackupRequest} or an equivalent Hash.
|
2889
|
+
#
|
2890
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::DeleteBackupRequest, ::Hash]
|
2891
|
+
# A request object representing the call parameters. Required. To specify no
|
2892
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2893
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2894
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2895
|
+
#
|
2896
|
+
# @overload delete_backup(name: nil, request_id: nil, validate_only: nil, etag: nil)
|
2897
|
+
# Pass arguments to `delete_backup` via keyword arguments. Note that at
|
2898
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2899
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2900
|
+
#
|
2901
|
+
# @param name [::String]
|
2902
|
+
# Required. Name of the resource. For the required format, see the comment on
|
2903
|
+
# the Backup.name field.
|
2904
|
+
# @param request_id [::String]
|
2905
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
2906
|
+
# request ID so that if you must retry your request, the server ignores the
|
2907
|
+
# request if it has already been completed. The server guarantees that for at
|
2908
|
+
# least 60 minutes since the first request.
|
2909
|
+
#
|
2910
|
+
# For example, consider a situation where you make an initial request and
|
2911
|
+
# the request times out. If you make the request again with the same request
|
2912
|
+
# ID, the server can check if the original operation with the same request ID
|
2913
|
+
# was received, and if so, ignores the second request. This prevents
|
2914
|
+
# clients from accidentally creating duplicate commitments.
|
2915
|
+
#
|
2916
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
2917
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
2918
|
+
# @param validate_only [::Boolean]
|
2919
|
+
# Optional. If set, the backend validates the request, but doesn't actually
|
2920
|
+
# execute it.
|
2921
|
+
# @param etag [::String]
|
2922
|
+
# Optional. The current etag of the Backup.
|
2923
|
+
# If an etag is provided and does not match the current etag of the Backup,
|
2924
|
+
# deletion will be blocked and an ABORTED error will be returned.
|
2925
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2926
|
+
# @yieldparam result [::Gapic::Operation]
|
2927
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2928
|
+
#
|
2929
|
+
# @return [::Gapic::Operation]
|
2930
|
+
#
|
2931
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2932
|
+
#
|
2933
|
+
# @example Basic example
|
2934
|
+
# require "google/cloud/alloy_db/v1alpha"
|
2935
|
+
#
|
2936
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2937
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
2938
|
+
#
|
2939
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2940
|
+
# request = Google::Cloud::AlloyDB::V1alpha::DeleteBackupRequest.new
|
2941
|
+
#
|
2942
|
+
# # Call the delete_backup method.
|
2943
|
+
# result = client.delete_backup request
|
2944
|
+
#
|
2945
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2946
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2947
|
+
# # Here is how to wait for a response.
|
2948
|
+
# result.wait_until_done! timeout: 60
|
2949
|
+
# if result.response?
|
2950
|
+
# p result.response
|
2951
|
+
# else
|
2952
|
+
# puts "No response received."
|
2953
|
+
# end
|
2954
|
+
#
|
2955
|
+
def delete_backup request, options = nil
|
2956
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2957
|
+
|
2958
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::DeleteBackupRequest
|
2959
|
+
|
2960
|
+
# Converts hash and nil to an options object
|
2961
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2962
|
+
|
2963
|
+
# Customize the options with defaults
|
2964
|
+
call_metadata = @config.rpcs.delete_backup.metadata.to_h
|
2965
|
+
|
2966
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2967
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2968
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2969
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
2970
|
+
transports_version_send: [:rest]
|
2971
|
+
|
2972
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2973
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2974
|
+
|
2975
|
+
options.apply_defaults timeout: @config.rpcs.delete_backup.timeout,
|
2976
|
+
metadata: call_metadata,
|
2977
|
+
retry_policy: @config.rpcs.delete_backup.retry_policy
|
2978
|
+
|
2979
|
+
options.apply_defaults timeout: @config.timeout,
|
2980
|
+
metadata: @config.metadata,
|
2981
|
+
retry_policy: @config.retry_policy
|
2982
|
+
|
2983
|
+
@alloy_db_admin_stub.delete_backup request, options do |result, operation|
|
2984
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2985
|
+
yield result, operation if block_given?
|
2986
|
+
return result
|
2987
|
+
end
|
2988
|
+
rescue ::Gapic::Rest::Error => e
|
2989
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2990
|
+
end
|
2991
|
+
|
2992
|
+
##
|
2993
|
+
# Lists SupportedDatabaseFlags for a given project and location.
|
2994
|
+
#
|
2995
|
+
# @overload list_supported_database_flags(request, options = nil)
|
2996
|
+
# Pass arguments to `list_supported_database_flags` via a request object, either of type
|
2997
|
+
# {::Google::Cloud::AlloyDB::V1alpha::ListSupportedDatabaseFlagsRequest} or an equivalent Hash.
|
2998
|
+
#
|
2999
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::ListSupportedDatabaseFlagsRequest, ::Hash]
|
3000
|
+
# A request object representing the call parameters. Required. To specify no
|
3001
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3002
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3003
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
3004
|
+
#
|
3005
|
+
# @overload list_supported_database_flags(parent: nil, page_size: nil, page_token: nil)
|
3006
|
+
# Pass arguments to `list_supported_database_flags` via keyword arguments. Note that at
|
3007
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3008
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3009
|
+
#
|
3010
|
+
# @param parent [::String]
|
3011
|
+
# Required. The name of the parent resource. The required format is:
|
3012
|
+
# * projects/\\{project}/locations/\\{location}
|
3013
|
+
#
|
3014
|
+
# Regardless of the parent specified here, as long it is contains a valid
|
3015
|
+
# project and location, the service will return a static list of supported
|
3016
|
+
# flags resources. Note that we do not yet support region-specific
|
3017
|
+
# flags.
|
3018
|
+
# @param page_size [::Integer]
|
3019
|
+
# Requested page size. Server may return fewer items than requested.
|
3020
|
+
# If unspecified, server will pick an appropriate default.
|
3021
|
+
# @param page_token [::String]
|
3022
|
+
# A token identifying a page of results the server should return.
|
3023
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
3024
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1alpha::SupportedDatabaseFlag>]
|
3025
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
3026
|
+
#
|
3027
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1alpha::SupportedDatabaseFlag>]
|
3028
|
+
#
|
3029
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
3030
|
+
#
|
3031
|
+
# @example Basic example
|
3032
|
+
# require "google/cloud/alloy_db/v1alpha"
|
3033
|
+
#
|
3034
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3035
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
3036
|
+
#
|
3037
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3038
|
+
# request = Google::Cloud::AlloyDB::V1alpha::ListSupportedDatabaseFlagsRequest.new
|
3039
|
+
#
|
3040
|
+
# # Call the list_supported_database_flags method.
|
3041
|
+
# result = client.list_supported_database_flags request
|
3042
|
+
#
|
3043
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
3044
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
3045
|
+
# result.each do |item|
|
3046
|
+
# # Each element is of type ::Google::Cloud::AlloyDB::V1alpha::SupportedDatabaseFlag.
|
3047
|
+
# p item
|
3048
|
+
# end
|
3049
|
+
#
|
3050
|
+
def list_supported_database_flags request, options = nil
|
3051
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3052
|
+
|
3053
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::ListSupportedDatabaseFlagsRequest
|
3054
|
+
|
3055
|
+
# Converts hash and nil to an options object
|
3056
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3057
|
+
|
3058
|
+
# Customize the options with defaults
|
3059
|
+
call_metadata = @config.rpcs.list_supported_database_flags.metadata.to_h
|
3060
|
+
|
3061
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3062
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3063
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3064
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
3065
|
+
transports_version_send: [:rest]
|
3066
|
+
|
3067
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3068
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3069
|
+
|
3070
|
+
options.apply_defaults timeout: @config.rpcs.list_supported_database_flags.timeout,
|
3071
|
+
metadata: call_metadata,
|
3072
|
+
retry_policy: @config.rpcs.list_supported_database_flags.retry_policy
|
3073
|
+
|
3074
|
+
options.apply_defaults timeout: @config.timeout,
|
3075
|
+
metadata: @config.metadata,
|
3076
|
+
retry_policy: @config.retry_policy
|
3077
|
+
|
3078
|
+
@alloy_db_admin_stub.list_supported_database_flags request, options do |result, operation|
|
3079
|
+
result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_admin_stub, :list_supported_database_flags, "supported_database_flags", request, result, options
|
3080
|
+
yield result, operation if block_given?
|
3081
|
+
return result
|
3082
|
+
end
|
3083
|
+
rescue ::Gapic::Rest::Error => e
|
3084
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3085
|
+
end
|
3086
|
+
|
3087
|
+
##
|
3088
|
+
# Generate a client certificate signed by a Cluster CA.
|
3089
|
+
# The sole purpose of this endpoint is to support AlloyDB connectors and the
|
3090
|
+
# Auth Proxy client. The endpoint's behavior is subject to change without
|
3091
|
+
# notice, so do not rely on its behavior remaining constant. Future changes
|
3092
|
+
# will not break AlloyDB connectors or the Auth Proxy client.
|
3093
|
+
#
|
3094
|
+
# @overload generate_client_certificate(request, options = nil)
|
3095
|
+
# Pass arguments to `generate_client_certificate` via a request object, either of type
|
3096
|
+
# {::Google::Cloud::AlloyDB::V1alpha::GenerateClientCertificateRequest} or an equivalent Hash.
|
3097
|
+
#
|
3098
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::GenerateClientCertificateRequest, ::Hash]
|
3099
|
+
# A request object representing the call parameters. Required. To specify no
|
3100
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3101
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3102
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
3103
|
+
#
|
3104
|
+
# @overload generate_client_certificate(parent: nil, request_id: nil, pem_csr: nil, cert_duration: nil, public_key: nil, use_metadata_exchange: nil)
|
3105
|
+
# Pass arguments to `generate_client_certificate` via keyword arguments. Note that at
|
3106
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3107
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3108
|
+
#
|
3109
|
+
# @param parent [::String]
|
3110
|
+
# Required. The name of the parent resource. The required format is:
|
3111
|
+
# * projects/\\{project}/locations/\\{location}/clusters/\\{cluster}
|
3112
|
+
# @param request_id [::String]
|
3113
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
3114
|
+
# request ID so that if you must retry your request, the server ignores the
|
3115
|
+
# request if it has already been completed. The server guarantees that for at
|
3116
|
+
# least 60 minutes since the first request.
|
3117
|
+
#
|
3118
|
+
# For example, consider a situation where you make an initial request and
|
3119
|
+
# the request times out. If you make the request again with the same request
|
3120
|
+
# ID, the server can check if the original operation with the same request ID
|
3121
|
+
# was received, and if so, ignores the second request. This prevents
|
3122
|
+
# clients from accidentally creating duplicate commitments.
|
3123
|
+
#
|
3124
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
3125
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
3126
|
+
# @param pem_csr [::String]
|
3127
|
+
# Optional. A pem-encoded X.509 certificate signing request (CSR). It is
|
3128
|
+
# recommended to use public_key instead.
|
3129
|
+
# @param cert_duration [::Google::Protobuf::Duration, ::Hash]
|
3130
|
+
# Optional. An optional hint to the endpoint to generate the client
|
3131
|
+
# certificate with the requested duration. The duration can be from 1 hour to
|
3132
|
+
# 24 hours. The endpoint may or may not honor the hint. If the hint is left
|
3133
|
+
# unspecified or is not honored, then the endpoint will pick an appropriate
|
3134
|
+
# default duration.
|
3135
|
+
# @param public_key [::String]
|
3136
|
+
# Optional. The public key from the client.
|
3137
|
+
# @param use_metadata_exchange [::Boolean]
|
3138
|
+
# Optional. An optional hint to the endpoint to generate a client
|
3139
|
+
# ceritificate that can be used by AlloyDB connectors to exchange additional
|
3140
|
+
# metadata with the server after TLS handshake.
|
3141
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
3142
|
+
# @yieldparam result [::Google::Cloud::AlloyDB::V1alpha::GenerateClientCertificateResponse]
|
3143
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
3144
|
+
#
|
3145
|
+
# @return [::Google::Cloud::AlloyDB::V1alpha::GenerateClientCertificateResponse]
|
3146
|
+
#
|
3147
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
3148
|
+
#
|
3149
|
+
# @example Basic example
|
3150
|
+
# require "google/cloud/alloy_db/v1alpha"
|
3151
|
+
#
|
3152
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3153
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
3154
|
+
#
|
3155
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3156
|
+
# request = Google::Cloud::AlloyDB::V1alpha::GenerateClientCertificateRequest.new
|
3157
|
+
#
|
3158
|
+
# # Call the generate_client_certificate method.
|
3159
|
+
# result = client.generate_client_certificate request
|
3160
|
+
#
|
3161
|
+
# # The returned object is of type Google::Cloud::AlloyDB::V1alpha::GenerateClientCertificateResponse.
|
3162
|
+
# p result
|
3163
|
+
#
|
3164
|
+
def generate_client_certificate request, options = nil
|
3165
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3166
|
+
|
3167
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::GenerateClientCertificateRequest
|
3168
|
+
|
3169
|
+
# Converts hash and nil to an options object
|
3170
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3171
|
+
|
3172
|
+
# Customize the options with defaults
|
3173
|
+
call_metadata = @config.rpcs.generate_client_certificate.metadata.to_h
|
3174
|
+
|
3175
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3176
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3177
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3178
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
3179
|
+
transports_version_send: [:rest]
|
3180
|
+
|
3181
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3182
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3183
|
+
|
3184
|
+
options.apply_defaults timeout: @config.rpcs.generate_client_certificate.timeout,
|
3185
|
+
metadata: call_metadata,
|
3186
|
+
retry_policy: @config.rpcs.generate_client_certificate.retry_policy
|
3187
|
+
|
3188
|
+
options.apply_defaults timeout: @config.timeout,
|
3189
|
+
metadata: @config.metadata,
|
3190
|
+
retry_policy: @config.retry_policy
|
3191
|
+
|
3192
|
+
@alloy_db_admin_stub.generate_client_certificate request, options do |result, operation|
|
3193
|
+
yield result, operation if block_given?
|
3194
|
+
return result
|
3195
|
+
end
|
3196
|
+
rescue ::Gapic::Rest::Error => e
|
3197
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3198
|
+
end
|
3199
|
+
|
3200
|
+
##
|
3201
|
+
# Get instance metadata used for a connection.
|
3202
|
+
#
|
3203
|
+
# @overload get_connection_info(request, options = nil)
|
3204
|
+
# Pass arguments to `get_connection_info` via a request object, either of type
|
3205
|
+
# {::Google::Cloud::AlloyDB::V1alpha::GetConnectionInfoRequest} or an equivalent Hash.
|
3206
|
+
#
|
3207
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::GetConnectionInfoRequest, ::Hash]
|
3208
|
+
# A request object representing the call parameters. Required. To specify no
|
3209
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3210
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3211
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
3212
|
+
#
|
3213
|
+
# @overload get_connection_info(parent: nil, request_id: nil)
|
3214
|
+
# Pass arguments to `get_connection_info` via keyword arguments. Note that at
|
3215
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3216
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3217
|
+
#
|
3218
|
+
# @param parent [::String]
|
3219
|
+
# Required. The name of the parent resource. The required format is:
|
3220
|
+
# projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/instances/\\{instance}
|
3221
|
+
# @param request_id [::String]
|
3222
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
3223
|
+
# request ID so that if you must retry your request, the server ignores the
|
3224
|
+
# request if it has already been completed. The server guarantees that for at
|
3225
|
+
# least 60 minutes since the first request.
|
3226
|
+
#
|
3227
|
+
# For example, consider a situation where you make an initial request and
|
3228
|
+
# the request times out. If you make the request again with the same request
|
3229
|
+
# ID, the server can check if the original operation with the same request ID
|
3230
|
+
# was received, and if so, ignores the second request. This prevents
|
3231
|
+
# clients from accidentally creating duplicate commitments.
|
3232
|
+
#
|
3233
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
3234
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
3235
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
3236
|
+
# @yieldparam result [::Google::Cloud::AlloyDB::V1alpha::ConnectionInfo]
|
3237
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
3238
|
+
#
|
3239
|
+
# @return [::Google::Cloud::AlloyDB::V1alpha::ConnectionInfo]
|
3240
|
+
#
|
3241
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
3242
|
+
#
|
3243
|
+
# @example Basic example
|
3244
|
+
# require "google/cloud/alloy_db/v1alpha"
|
3245
|
+
#
|
3246
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3247
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
3248
|
+
#
|
3249
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3250
|
+
# request = Google::Cloud::AlloyDB::V1alpha::GetConnectionInfoRequest.new
|
3251
|
+
#
|
3252
|
+
# # Call the get_connection_info method.
|
3253
|
+
# result = client.get_connection_info request
|
3254
|
+
#
|
3255
|
+
# # The returned object is of type Google::Cloud::AlloyDB::V1alpha::ConnectionInfo.
|
3256
|
+
# p result
|
3257
|
+
#
|
3258
|
+
def get_connection_info request, options = nil
|
3259
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3260
|
+
|
3261
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::GetConnectionInfoRequest
|
3262
|
+
|
3263
|
+
# Converts hash and nil to an options object
|
3264
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3265
|
+
|
3266
|
+
# Customize the options with defaults
|
3267
|
+
call_metadata = @config.rpcs.get_connection_info.metadata.to_h
|
3268
|
+
|
3269
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3270
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3271
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3272
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
3273
|
+
transports_version_send: [:rest]
|
3274
|
+
|
3275
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3276
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3277
|
+
|
3278
|
+
options.apply_defaults timeout: @config.rpcs.get_connection_info.timeout,
|
3279
|
+
metadata: call_metadata,
|
3280
|
+
retry_policy: @config.rpcs.get_connection_info.retry_policy
|
3281
|
+
|
3282
|
+
options.apply_defaults timeout: @config.timeout,
|
3283
|
+
metadata: @config.metadata,
|
3284
|
+
retry_policy: @config.retry_policy
|
3285
|
+
|
3286
|
+
@alloy_db_admin_stub.get_connection_info request, options do |result, operation|
|
3287
|
+
yield result, operation if block_given?
|
3288
|
+
return result
|
3289
|
+
end
|
3290
|
+
rescue ::Gapic::Rest::Error => e
|
3291
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3292
|
+
end
|
3293
|
+
|
3294
|
+
##
|
3295
|
+
# Lists Users in a given project and location.
|
3296
|
+
#
|
3297
|
+
# @overload list_users(request, options = nil)
|
3298
|
+
# Pass arguments to `list_users` via a request object, either of type
|
3299
|
+
# {::Google::Cloud::AlloyDB::V1alpha::ListUsersRequest} or an equivalent Hash.
|
3300
|
+
#
|
3301
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::ListUsersRequest, ::Hash]
|
3302
|
+
# A request object representing the call parameters. Required. To specify no
|
3303
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3304
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3305
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
3306
|
+
#
|
3307
|
+
# @overload list_users(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
3308
|
+
# Pass arguments to `list_users` via keyword arguments. Note that at
|
3309
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3310
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3311
|
+
#
|
3312
|
+
# @param parent [::String]
|
3313
|
+
# Required. Parent value for ListUsersRequest
|
3314
|
+
# @param page_size [::Integer]
|
3315
|
+
# Optional. Requested page size. Server may return fewer items than
|
3316
|
+
# requested. If unspecified, server will pick an appropriate default.
|
3317
|
+
# @param page_token [::String]
|
3318
|
+
# Optional. A token identifying a page of results the server should return.
|
3319
|
+
# @param filter [::String]
|
3320
|
+
# Optional. Filtering results
|
3321
|
+
# @param order_by [::String]
|
3322
|
+
# Optional. Hint for how to order the results
|
3323
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
3324
|
+
# @yieldparam result [::Google::Cloud::AlloyDB::V1alpha::ListUsersResponse]
|
3325
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
3326
|
+
#
|
3327
|
+
# @return [::Google::Cloud::AlloyDB::V1alpha::ListUsersResponse]
|
3328
|
+
#
|
3329
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
3330
|
+
#
|
3331
|
+
# @example Basic example
|
3332
|
+
# require "google/cloud/alloy_db/v1alpha"
|
3333
|
+
#
|
3334
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3335
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
3336
|
+
#
|
3337
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3338
|
+
# request = Google::Cloud::AlloyDB::V1alpha::ListUsersRequest.new
|
3339
|
+
#
|
3340
|
+
# # Call the list_users method.
|
3341
|
+
# result = client.list_users request
|
3342
|
+
#
|
3343
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
3344
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
3345
|
+
# result.each do |item|
|
3346
|
+
# # Each element is of type ::Google::Cloud::AlloyDB::V1alpha::User.
|
3347
|
+
# p item
|
3348
|
+
# end
|
3349
|
+
#
|
3350
|
+
def list_users request, options = nil
|
3351
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3352
|
+
|
3353
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::ListUsersRequest
|
3354
|
+
|
3355
|
+
# Converts hash and nil to an options object
|
3356
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3357
|
+
|
3358
|
+
# Customize the options with defaults
|
3359
|
+
call_metadata = @config.rpcs.list_users.metadata.to_h
|
3360
|
+
|
3361
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3362
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3363
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3364
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
3365
|
+
transports_version_send: [:rest]
|
3366
|
+
|
3367
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3368
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3369
|
+
|
3370
|
+
options.apply_defaults timeout: @config.rpcs.list_users.timeout,
|
3371
|
+
metadata: call_metadata,
|
3372
|
+
retry_policy: @config.rpcs.list_users.retry_policy
|
3373
|
+
|
3374
|
+
options.apply_defaults timeout: @config.timeout,
|
3375
|
+
metadata: @config.metadata,
|
3376
|
+
retry_policy: @config.retry_policy
|
3377
|
+
|
3378
|
+
@alloy_db_admin_stub.list_users request, options do |result, operation|
|
3379
|
+
yield result, operation if block_given?
|
3380
|
+
return result
|
3381
|
+
end
|
3382
|
+
rescue ::Gapic::Rest::Error => e
|
3383
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3384
|
+
end
|
3385
|
+
|
3386
|
+
##
|
3387
|
+
# Gets details of a single User.
|
3388
|
+
#
|
3389
|
+
# @overload get_user(request, options = nil)
|
3390
|
+
# Pass arguments to `get_user` via a request object, either of type
|
3391
|
+
# {::Google::Cloud::AlloyDB::V1alpha::GetUserRequest} or an equivalent Hash.
|
3392
|
+
#
|
3393
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::GetUserRequest, ::Hash]
|
3394
|
+
# A request object representing the call parameters. Required. To specify no
|
3395
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3396
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3397
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
3398
|
+
#
|
3399
|
+
# @overload get_user(name: nil)
|
3400
|
+
# Pass arguments to `get_user` via keyword arguments. Note that at
|
3401
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3402
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3403
|
+
#
|
3404
|
+
# @param name [::String]
|
3405
|
+
# Required. The name of the resource. For the required format, see the
|
3406
|
+
# comment on the User.name field.
|
3407
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
3408
|
+
# @yieldparam result [::Google::Cloud::AlloyDB::V1alpha::User]
|
3409
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
3410
|
+
#
|
3411
|
+
# @return [::Google::Cloud::AlloyDB::V1alpha::User]
|
3412
|
+
#
|
3413
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
3414
|
+
#
|
3415
|
+
# @example Basic example
|
3416
|
+
# require "google/cloud/alloy_db/v1alpha"
|
3417
|
+
#
|
3418
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3419
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
3420
|
+
#
|
3421
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3422
|
+
# request = Google::Cloud::AlloyDB::V1alpha::GetUserRequest.new
|
3423
|
+
#
|
3424
|
+
# # Call the get_user method.
|
3425
|
+
# result = client.get_user request
|
3426
|
+
#
|
3427
|
+
# # The returned object is of type Google::Cloud::AlloyDB::V1alpha::User.
|
3428
|
+
# p result
|
3429
|
+
#
|
3430
|
+
def get_user request, options = nil
|
3431
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3432
|
+
|
3433
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::GetUserRequest
|
3434
|
+
|
3435
|
+
# Converts hash and nil to an options object
|
3436
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3437
|
+
|
3438
|
+
# Customize the options with defaults
|
3439
|
+
call_metadata = @config.rpcs.get_user.metadata.to_h
|
3440
|
+
|
3441
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3442
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3443
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3444
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
3445
|
+
transports_version_send: [:rest]
|
3446
|
+
|
3447
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3448
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3449
|
+
|
3450
|
+
options.apply_defaults timeout: @config.rpcs.get_user.timeout,
|
3451
|
+
metadata: call_metadata,
|
3452
|
+
retry_policy: @config.rpcs.get_user.retry_policy
|
3453
|
+
|
3454
|
+
options.apply_defaults timeout: @config.timeout,
|
3455
|
+
metadata: @config.metadata,
|
3456
|
+
retry_policy: @config.retry_policy
|
3457
|
+
|
3458
|
+
@alloy_db_admin_stub.get_user request, options do |result, operation|
|
3459
|
+
yield result, operation if block_given?
|
3460
|
+
return result
|
3461
|
+
end
|
3462
|
+
rescue ::Gapic::Rest::Error => e
|
3463
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3464
|
+
end
|
3465
|
+
|
3466
|
+
##
|
3467
|
+
# Creates a new User in a given project, location, and cluster.
|
3468
|
+
#
|
3469
|
+
# @overload create_user(request, options = nil)
|
3470
|
+
# Pass arguments to `create_user` via a request object, either of type
|
3471
|
+
# {::Google::Cloud::AlloyDB::V1alpha::CreateUserRequest} or an equivalent Hash.
|
3472
|
+
#
|
3473
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::CreateUserRequest, ::Hash]
|
3474
|
+
# A request object representing the call parameters. Required. To specify no
|
3475
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3476
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3477
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
3478
|
+
#
|
3479
|
+
# @overload create_user(parent: nil, user_id: nil, user: nil, request_id: nil, validate_only: nil)
|
3480
|
+
# Pass arguments to `create_user` via keyword arguments. Note that at
|
3481
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3482
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3483
|
+
#
|
3484
|
+
# @param parent [::String]
|
3485
|
+
# Required. Value for parent.
|
3486
|
+
# @param user_id [::String]
|
3487
|
+
# Required. ID of the requesting object.
|
3488
|
+
# @param user [::Google::Cloud::AlloyDB::V1alpha::User, ::Hash]
|
3489
|
+
# Required. The resource being created
|
3490
|
+
# @param request_id [::String]
|
3491
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
3492
|
+
# request ID so that if you must retry your request, the server ignores the
|
3493
|
+
# request if it has already been completed. The server guarantees that for at
|
3494
|
+
# least 60 minutes since the first request.
|
3495
|
+
#
|
3496
|
+
# For example, consider a situation where you make an initial request and
|
3497
|
+
# the request times out. If you make the request again with the same request
|
3498
|
+
# ID, the server can check if the original operation with the same request ID
|
3499
|
+
# was received, and if so, ignores the second request. This prevents
|
3500
|
+
# clients from accidentally creating duplicate commitments.
|
3501
|
+
#
|
3502
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
3503
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
3504
|
+
# @param validate_only [::Boolean]
|
3505
|
+
# Optional. If set, the backend validates the request, but doesn't actually
|
3506
|
+
# execute it.
|
3507
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
3508
|
+
# @yieldparam result [::Google::Cloud::AlloyDB::V1alpha::User]
|
3509
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
3510
|
+
#
|
3511
|
+
# @return [::Google::Cloud::AlloyDB::V1alpha::User]
|
3512
|
+
#
|
3513
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
3514
|
+
#
|
3515
|
+
# @example Basic example
|
3516
|
+
# require "google/cloud/alloy_db/v1alpha"
|
3517
|
+
#
|
3518
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3519
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
3520
|
+
#
|
3521
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3522
|
+
# request = Google::Cloud::AlloyDB::V1alpha::CreateUserRequest.new
|
3523
|
+
#
|
3524
|
+
# # Call the create_user method.
|
3525
|
+
# result = client.create_user request
|
3526
|
+
#
|
3527
|
+
# # The returned object is of type Google::Cloud::AlloyDB::V1alpha::User.
|
3528
|
+
# p result
|
3529
|
+
#
|
3530
|
+
def create_user request, options = nil
|
3531
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3532
|
+
|
3533
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::CreateUserRequest
|
3534
|
+
|
3535
|
+
# Converts hash and nil to an options object
|
3536
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3537
|
+
|
3538
|
+
# Customize the options with defaults
|
3539
|
+
call_metadata = @config.rpcs.create_user.metadata.to_h
|
3540
|
+
|
3541
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3542
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3543
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3544
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
3545
|
+
transports_version_send: [:rest]
|
3546
|
+
|
3547
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3548
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3549
|
+
|
3550
|
+
options.apply_defaults timeout: @config.rpcs.create_user.timeout,
|
3551
|
+
metadata: call_metadata,
|
3552
|
+
retry_policy: @config.rpcs.create_user.retry_policy
|
3553
|
+
|
3554
|
+
options.apply_defaults timeout: @config.timeout,
|
3555
|
+
metadata: @config.metadata,
|
3556
|
+
retry_policy: @config.retry_policy
|
3557
|
+
|
3558
|
+
@alloy_db_admin_stub.create_user request, options do |result, operation|
|
3559
|
+
yield result, operation if block_given?
|
3560
|
+
return result
|
3561
|
+
end
|
3562
|
+
rescue ::Gapic::Rest::Error => e
|
3563
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3564
|
+
end
|
3565
|
+
|
3566
|
+
##
|
3567
|
+
# Updates the parameters of a single User.
|
3568
|
+
#
|
3569
|
+
# @overload update_user(request, options = nil)
|
3570
|
+
# Pass arguments to `update_user` via a request object, either of type
|
3571
|
+
# {::Google::Cloud::AlloyDB::V1alpha::UpdateUserRequest} or an equivalent Hash.
|
3572
|
+
#
|
3573
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::UpdateUserRequest, ::Hash]
|
3574
|
+
# A request object representing the call parameters. Required. To specify no
|
3575
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3576
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3577
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
3578
|
+
#
|
3579
|
+
# @overload update_user(update_mask: nil, user: nil, request_id: nil, validate_only: nil, allow_missing: nil)
|
3580
|
+
# Pass arguments to `update_user` via keyword arguments. Note that at
|
3581
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3582
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3583
|
+
#
|
3584
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
3585
|
+
# Optional. Field mask is used to specify the fields to be overwritten in the
|
3586
|
+
# User resource by the update.
|
3587
|
+
# The fields specified in the update_mask are relative to the resource, not
|
3588
|
+
# the full request. A field will be overwritten if it is in the mask. If the
|
3589
|
+
# user does not provide a mask then all fields will be overwritten.
|
3590
|
+
# @param user [::Google::Cloud::AlloyDB::V1alpha::User, ::Hash]
|
3591
|
+
# Required. The resource being updated
|
3592
|
+
# @param request_id [::String]
|
3593
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
3594
|
+
# request ID so that if you must retry your request, the server ignores the
|
3595
|
+
# request if it has already been completed. The server guarantees that for at
|
3596
|
+
# least 60 minutes since the first request.
|
3597
|
+
#
|
3598
|
+
# For example, consider a situation where you make an initial request and
|
3599
|
+
# the request times out. If you make the request again with the same request
|
3600
|
+
# ID, the server can check if the original operation with the same request ID
|
3601
|
+
# was received, and if so, ignores the second request. This prevents
|
3602
|
+
# clients from accidentally creating duplicate commitments.
|
3603
|
+
#
|
3604
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
3605
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
3606
|
+
# @param validate_only [::Boolean]
|
3607
|
+
# Optional. If set, the backend validates the request, but doesn't actually
|
3608
|
+
# execute it.
|
3609
|
+
# @param allow_missing [::Boolean]
|
3610
|
+
# Optional. Allow missing fields in the update mask.
|
3611
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
3612
|
+
# @yieldparam result [::Google::Cloud::AlloyDB::V1alpha::User]
|
3613
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
3614
|
+
#
|
3615
|
+
# @return [::Google::Cloud::AlloyDB::V1alpha::User]
|
3616
|
+
#
|
3617
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
3618
|
+
#
|
3619
|
+
# @example Basic example
|
3620
|
+
# require "google/cloud/alloy_db/v1alpha"
|
3621
|
+
#
|
3622
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3623
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
3624
|
+
#
|
3625
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3626
|
+
# request = Google::Cloud::AlloyDB::V1alpha::UpdateUserRequest.new
|
3627
|
+
#
|
3628
|
+
# # Call the update_user method.
|
3629
|
+
# result = client.update_user request
|
3630
|
+
#
|
3631
|
+
# # The returned object is of type Google::Cloud::AlloyDB::V1alpha::User.
|
3632
|
+
# p result
|
3633
|
+
#
|
3634
|
+
def update_user request, options = nil
|
3635
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3636
|
+
|
3637
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::UpdateUserRequest
|
3638
|
+
|
3639
|
+
# Converts hash and nil to an options object
|
3640
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3641
|
+
|
3642
|
+
# Customize the options with defaults
|
3643
|
+
call_metadata = @config.rpcs.update_user.metadata.to_h
|
3644
|
+
|
3645
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3646
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3647
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3648
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
3649
|
+
transports_version_send: [:rest]
|
3650
|
+
|
3651
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3652
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3653
|
+
|
3654
|
+
options.apply_defaults timeout: @config.rpcs.update_user.timeout,
|
3655
|
+
metadata: call_metadata,
|
3656
|
+
retry_policy: @config.rpcs.update_user.retry_policy
|
3657
|
+
|
3658
|
+
options.apply_defaults timeout: @config.timeout,
|
3659
|
+
metadata: @config.metadata,
|
3660
|
+
retry_policy: @config.retry_policy
|
3661
|
+
|
3662
|
+
@alloy_db_admin_stub.update_user request, options do |result, operation|
|
3663
|
+
yield result, operation if block_given?
|
3664
|
+
return result
|
3665
|
+
end
|
3666
|
+
rescue ::Gapic::Rest::Error => e
|
3667
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3668
|
+
end
|
3669
|
+
|
3670
|
+
##
|
3671
|
+
# Deletes a single User.
|
3672
|
+
#
|
3673
|
+
# @overload delete_user(request, options = nil)
|
3674
|
+
# Pass arguments to `delete_user` via a request object, either of type
|
3675
|
+
# {::Google::Cloud::AlloyDB::V1alpha::DeleteUserRequest} or an equivalent Hash.
|
3676
|
+
#
|
3677
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::DeleteUserRequest, ::Hash]
|
3678
|
+
# A request object representing the call parameters. Required. To specify no
|
3679
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3680
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3681
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
3682
|
+
#
|
3683
|
+
# @overload delete_user(name: nil, request_id: nil, validate_only: nil)
|
3684
|
+
# Pass arguments to `delete_user` via keyword arguments. Note that at
|
3685
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3686
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3687
|
+
#
|
3688
|
+
# @param name [::String]
|
3689
|
+
# Required. The name of the resource. For the required format, see the
|
3690
|
+
# comment on the User.name field.
|
3691
|
+
# @param request_id [::String]
|
3692
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
3693
|
+
# request ID so that if you must retry your request, the server ignores the
|
3694
|
+
# request if it has already been completed. The server guarantees that for at
|
3695
|
+
# least 60 minutes since the first request.
|
3696
|
+
#
|
3697
|
+
# For example, consider a situation where you make an initial request and
|
3698
|
+
# the request times out. If you make the request again with the same request
|
3699
|
+
# ID, the server can check if the original operation with the same request ID
|
3700
|
+
# was received, and if so, ignores the second request. This prevents
|
3701
|
+
# clients from accidentally creating duplicate commitments.
|
3702
|
+
#
|
3703
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
3704
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
3705
|
+
# @param validate_only [::Boolean]
|
3706
|
+
# Optional. If set, the backend validates the request, but doesn't actually
|
3707
|
+
# execute it.
|
3708
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
3709
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
3710
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
3711
|
+
#
|
3712
|
+
# @return [::Google::Protobuf::Empty]
|
3713
|
+
#
|
3714
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
3715
|
+
#
|
3716
|
+
# @example Basic example
|
3717
|
+
# require "google/cloud/alloy_db/v1alpha"
|
3718
|
+
#
|
3719
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3720
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
3721
|
+
#
|
3722
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3723
|
+
# request = Google::Cloud::AlloyDB::V1alpha::DeleteUserRequest.new
|
3724
|
+
#
|
3725
|
+
# # Call the delete_user method.
|
3726
|
+
# result = client.delete_user request
|
3727
|
+
#
|
3728
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
3729
|
+
# p result
|
3730
|
+
#
|
3731
|
+
def delete_user request, options = nil
|
3732
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3733
|
+
|
3734
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::DeleteUserRequest
|
3735
|
+
|
3736
|
+
# Converts hash and nil to an options object
|
3737
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3738
|
+
|
3739
|
+
# Customize the options with defaults
|
3740
|
+
call_metadata = @config.rpcs.delete_user.metadata.to_h
|
3741
|
+
|
3742
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3743
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3744
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3745
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
3746
|
+
transports_version_send: [:rest]
|
3747
|
+
|
3748
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3749
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3750
|
+
|
3751
|
+
options.apply_defaults timeout: @config.rpcs.delete_user.timeout,
|
3752
|
+
metadata: call_metadata,
|
3753
|
+
retry_policy: @config.rpcs.delete_user.retry_policy
|
3754
|
+
|
3755
|
+
options.apply_defaults timeout: @config.timeout,
|
3756
|
+
metadata: @config.metadata,
|
3757
|
+
retry_policy: @config.retry_policy
|
3758
|
+
|
3759
|
+
@alloy_db_admin_stub.delete_user request, options do |result, operation|
|
3760
|
+
yield result, operation if block_given?
|
3761
|
+
return result
|
3762
|
+
end
|
3763
|
+
rescue ::Gapic::Rest::Error => e
|
3764
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3765
|
+
end
|
3766
|
+
|
3767
|
+
##
|
3768
|
+
# Lists Databases in a given project and location.
|
3769
|
+
#
|
3770
|
+
# @overload list_databases(request, options = nil)
|
3771
|
+
# Pass arguments to `list_databases` via a request object, either of type
|
3772
|
+
# {::Google::Cloud::AlloyDB::V1alpha::ListDatabasesRequest} or an equivalent Hash.
|
3773
|
+
#
|
3774
|
+
# @param request [::Google::Cloud::AlloyDB::V1alpha::ListDatabasesRequest, ::Hash]
|
3775
|
+
# A request object representing the call parameters. Required. To specify no
|
3776
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3777
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3778
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
3779
|
+
#
|
3780
|
+
# @overload list_databases(parent: nil, page_size: nil, page_token: nil, filter: nil)
|
3781
|
+
# Pass arguments to `list_databases` via keyword arguments. Note that at
|
3782
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3783
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3784
|
+
#
|
3785
|
+
# @param parent [::String]
|
3786
|
+
# Required. Parent value for ListDatabasesRequest.
|
3787
|
+
# @param page_size [::Integer]
|
3788
|
+
# Optional. The maximum number of databases to return. The service may return
|
3789
|
+
# fewer than this value. If unspecified, 2000 is the default page_size. The
|
3790
|
+
# max value of page_size will be 4000, values above max will be coerced to
|
3791
|
+
# max.
|
3792
|
+
# @param page_token [::String]
|
3793
|
+
# Optional. A page token, received from a previous `ListDatabases` call.
|
3794
|
+
# This should be provided to retrieve the subsequent page.
|
3795
|
+
# This field is currently not supported, its value will be ignored if passed.
|
3796
|
+
# @param filter [::String]
|
3797
|
+
# Optional. Filtering results.
|
3798
|
+
# This field is currently not supported, its value will be ignored if passed.
|
3799
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
3800
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1alpha::Database>]
|
3801
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
3802
|
+
#
|
3803
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1alpha::Database>]
|
3804
|
+
#
|
3805
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
3806
|
+
#
|
3807
|
+
# @example Basic example
|
3808
|
+
# require "google/cloud/alloy_db/v1alpha"
|
3809
|
+
#
|
3810
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3811
|
+
# client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new
|
3812
|
+
#
|
3813
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3814
|
+
# request = Google::Cloud::AlloyDB::V1alpha::ListDatabasesRequest.new
|
3815
|
+
#
|
3816
|
+
# # Call the list_databases method.
|
3817
|
+
# result = client.list_databases request
|
3818
|
+
#
|
3819
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
3820
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
3821
|
+
# result.each do |item|
|
3822
|
+
# # Each element is of type ::Google::Cloud::AlloyDB::V1alpha::Database.
|
3823
|
+
# p item
|
3824
|
+
# end
|
3825
|
+
#
|
3826
|
+
def list_databases request, options = nil
|
3827
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3828
|
+
|
3829
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::ListDatabasesRequest
|
3830
|
+
|
3831
|
+
# Converts hash and nil to an options object
|
3832
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3833
|
+
|
3834
|
+
# Customize the options with defaults
|
3835
|
+
call_metadata = @config.rpcs.list_databases.metadata.to_h
|
3836
|
+
|
3837
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3838
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3839
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3840
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION,
|
3841
|
+
transports_version_send: [:rest]
|
3842
|
+
|
3843
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3844
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3845
|
+
|
3846
|
+
options.apply_defaults timeout: @config.rpcs.list_databases.timeout,
|
3847
|
+
metadata: call_metadata,
|
3848
|
+
retry_policy: @config.rpcs.list_databases.retry_policy
|
3849
|
+
|
3850
|
+
options.apply_defaults timeout: @config.timeout,
|
3851
|
+
metadata: @config.metadata,
|
3852
|
+
retry_policy: @config.retry_policy
|
3853
|
+
|
3854
|
+
@alloy_db_admin_stub.list_databases request, options do |result, operation|
|
3855
|
+
result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_admin_stub, :list_databases, "databases", request, result, options
|
3856
|
+
yield result, operation if block_given?
|
3857
|
+
return result
|
3858
|
+
end
|
3859
|
+
rescue ::Gapic::Rest::Error => e
|
3860
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3861
|
+
end
|
3862
|
+
|
3863
|
+
##
|
3864
|
+
# Configuration class for the AlloyDBAdmin REST API.
|
3865
|
+
#
|
3866
|
+
# This class represents the configuration for AlloyDBAdmin REST,
|
3867
|
+
# providing control over timeouts, retry behavior, logging, transport
|
3868
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
3869
|
+
# applied individually to specific RPCs. See
|
3870
|
+
# {::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client::Configuration::Rpcs}
|
3871
|
+
# for a list of RPCs that can be configured independently.
|
3872
|
+
#
|
3873
|
+
# Configuration can be applied globally to all clients, or to a single client
|
3874
|
+
# on construction.
|
3875
|
+
#
|
3876
|
+
# @example
|
3877
|
+
#
|
3878
|
+
# # Modify the global config, setting the timeout for
|
3879
|
+
# # list_clusters to 20 seconds,
|
3880
|
+
# # and all remaining timeouts to 10 seconds.
|
3881
|
+
# ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.configure do |config|
|
3882
|
+
# config.timeout = 10.0
|
3883
|
+
# config.rpcs.list_clusters.timeout = 20.0
|
3884
|
+
# end
|
3885
|
+
#
|
3886
|
+
# # Apply the above configuration only to a new client.
|
3887
|
+
# client = ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Rest::Client.new do |config|
|
3888
|
+
# config.timeout = 10.0
|
3889
|
+
# config.rpcs.list_clusters.timeout = 20.0
|
3890
|
+
# end
|
3891
|
+
#
|
3892
|
+
# @!attribute [rw] endpoint
|
3893
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
3894
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
3895
|
+
# @return [::String,nil]
|
3896
|
+
# @!attribute [rw] credentials
|
3897
|
+
# Credentials to send with calls. You may provide any of the following types:
|
3898
|
+
# * (`String`) The path to a service account key file in JSON format
|
3899
|
+
# * (`Hash`) A service account key as a Hash
|
3900
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
3901
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
3902
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
3903
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
3904
|
+
# * (`nil`) indicating no credentials
|
3905
|
+
# @return [::Object]
|
3906
|
+
# @!attribute [rw] scope
|
3907
|
+
# The OAuth scopes
|
3908
|
+
# @return [::Array<::String>]
|
3909
|
+
# @!attribute [rw] lib_name
|
3910
|
+
# The library name as recorded in instrumentation and logging
|
3911
|
+
# @return [::String]
|
3912
|
+
# @!attribute [rw] lib_version
|
3913
|
+
# The library version as recorded in instrumentation and logging
|
3914
|
+
# @return [::String]
|
3915
|
+
# @!attribute [rw] timeout
|
3916
|
+
# The call timeout in seconds.
|
3917
|
+
# @return [::Numeric]
|
3918
|
+
# @!attribute [rw] metadata
|
3919
|
+
# Additional headers to be sent with the call.
|
3920
|
+
# @return [::Hash{::Symbol=>::String}]
|
3921
|
+
# @!attribute [rw] retry_policy
|
3922
|
+
# The retry policy. The value is a hash with the following keys:
|
3923
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
3924
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
3925
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
3926
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
3927
|
+
# trigger a retry.
|
3928
|
+
# @return [::Hash]
|
3929
|
+
# @!attribute [rw] quota_project
|
3930
|
+
# A separate project against which to charge quota.
|
3931
|
+
# @return [::String]
|
3932
|
+
# @!attribute [rw] universe_domain
|
3933
|
+
# The universe domain within which to make requests. This determines the
|
3934
|
+
# default endpoint URL. The default value of nil uses the environment
|
3935
|
+
# universe (usually the default "googleapis.com" universe).
|
3936
|
+
# @return [::String,nil]
|
3937
|
+
#
|
3938
|
+
class Configuration
|
3939
|
+
extend ::Gapic::Config
|
3940
|
+
|
3941
|
+
# @private
|
3942
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
3943
|
+
DEFAULT_ENDPOINT = "alloydb.googleapis.com"
|
3944
|
+
|
3945
|
+
config_attr :endpoint, nil, ::String, nil
|
3946
|
+
config_attr :credentials, nil do |value|
|
3947
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
3948
|
+
allowed.any? { |klass| klass === value }
|
3949
|
+
end
|
3950
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
3951
|
+
config_attr :lib_name, nil, ::String, nil
|
3952
|
+
config_attr :lib_version, nil, ::String, nil
|
3953
|
+
config_attr :timeout, nil, ::Numeric, nil
|
3954
|
+
config_attr :metadata, nil, ::Hash, nil
|
3955
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
3956
|
+
config_attr :quota_project, nil, ::String, nil
|
3957
|
+
config_attr :universe_domain, nil, ::String, nil
|
3958
|
+
|
3959
|
+
# @private
|
3960
|
+
# Overrides for http bindings for the RPCs of this service
|
3961
|
+
# are only used when this service is used as mixin, and only
|
3962
|
+
# by the host service.
|
3963
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
3964
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
3965
|
+
|
3966
|
+
# @private
|
3967
|
+
def initialize parent_config = nil
|
3968
|
+
@parent_config = parent_config unless parent_config.nil?
|
3969
|
+
|
3970
|
+
yield self if block_given?
|
3971
|
+
end
|
3972
|
+
|
3973
|
+
##
|
3974
|
+
# Configurations for individual RPCs
|
3975
|
+
# @return [Rpcs]
|
3976
|
+
#
|
3977
|
+
def rpcs
|
3978
|
+
@rpcs ||= begin
|
3979
|
+
parent_rpcs = nil
|
3980
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
3981
|
+
Rpcs.new parent_rpcs
|
3982
|
+
end
|
3983
|
+
end
|
3984
|
+
|
3985
|
+
##
|
3986
|
+
# Configuration RPC class for the AlloyDBAdmin API.
|
3987
|
+
#
|
3988
|
+
# Includes fields providing the configuration for each RPC in this service.
|
3989
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
3990
|
+
# the following configuration fields:
|
3991
|
+
#
|
3992
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
3993
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
3994
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
3995
|
+
# include the following keys:
|
3996
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
3997
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
3998
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
3999
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
4000
|
+
# trigger a retry.
|
4001
|
+
#
|
4002
|
+
class Rpcs
|
4003
|
+
##
|
4004
|
+
# RPC-specific configuration for `list_clusters`
|
4005
|
+
# @return [::Gapic::Config::Method]
|
4006
|
+
#
|
4007
|
+
attr_reader :list_clusters
|
4008
|
+
##
|
4009
|
+
# RPC-specific configuration for `get_cluster`
|
4010
|
+
# @return [::Gapic::Config::Method]
|
4011
|
+
#
|
4012
|
+
attr_reader :get_cluster
|
4013
|
+
##
|
4014
|
+
# RPC-specific configuration for `create_cluster`
|
4015
|
+
# @return [::Gapic::Config::Method]
|
4016
|
+
#
|
4017
|
+
attr_reader :create_cluster
|
4018
|
+
##
|
4019
|
+
# RPC-specific configuration for `update_cluster`
|
4020
|
+
# @return [::Gapic::Config::Method]
|
4021
|
+
#
|
4022
|
+
attr_reader :update_cluster
|
4023
|
+
##
|
4024
|
+
# RPC-specific configuration for `upgrade_cluster`
|
4025
|
+
# @return [::Gapic::Config::Method]
|
4026
|
+
#
|
4027
|
+
attr_reader :upgrade_cluster
|
4028
|
+
##
|
4029
|
+
# RPC-specific configuration for `delete_cluster`
|
4030
|
+
# @return [::Gapic::Config::Method]
|
4031
|
+
#
|
4032
|
+
attr_reader :delete_cluster
|
4033
|
+
##
|
4034
|
+
# RPC-specific configuration for `promote_cluster`
|
4035
|
+
# @return [::Gapic::Config::Method]
|
4036
|
+
#
|
4037
|
+
attr_reader :promote_cluster
|
4038
|
+
##
|
4039
|
+
# RPC-specific configuration for `switchover_cluster`
|
4040
|
+
# @return [::Gapic::Config::Method]
|
4041
|
+
#
|
4042
|
+
attr_reader :switchover_cluster
|
4043
|
+
##
|
4044
|
+
# RPC-specific configuration for `restore_cluster`
|
4045
|
+
# @return [::Gapic::Config::Method]
|
4046
|
+
#
|
4047
|
+
attr_reader :restore_cluster
|
4048
|
+
##
|
4049
|
+
# RPC-specific configuration for `create_secondary_cluster`
|
4050
|
+
# @return [::Gapic::Config::Method]
|
4051
|
+
#
|
4052
|
+
attr_reader :create_secondary_cluster
|
4053
|
+
##
|
4054
|
+
# RPC-specific configuration for `list_instances`
|
4055
|
+
# @return [::Gapic::Config::Method]
|
4056
|
+
#
|
4057
|
+
attr_reader :list_instances
|
4058
|
+
##
|
4059
|
+
# RPC-specific configuration for `get_instance`
|
4060
|
+
# @return [::Gapic::Config::Method]
|
4061
|
+
#
|
4062
|
+
attr_reader :get_instance
|
4063
|
+
##
|
4064
|
+
# RPC-specific configuration for `create_instance`
|
4065
|
+
# @return [::Gapic::Config::Method]
|
4066
|
+
#
|
4067
|
+
attr_reader :create_instance
|
4068
|
+
##
|
4069
|
+
# RPC-specific configuration for `create_secondary_instance`
|
4070
|
+
# @return [::Gapic::Config::Method]
|
4071
|
+
#
|
4072
|
+
attr_reader :create_secondary_instance
|
4073
|
+
##
|
4074
|
+
# RPC-specific configuration for `batch_create_instances`
|
4075
|
+
# @return [::Gapic::Config::Method]
|
4076
|
+
#
|
4077
|
+
attr_reader :batch_create_instances
|
4078
|
+
##
|
4079
|
+
# RPC-specific configuration for `update_instance`
|
4080
|
+
# @return [::Gapic::Config::Method]
|
4081
|
+
#
|
4082
|
+
attr_reader :update_instance
|
4083
|
+
##
|
4084
|
+
# RPC-specific configuration for `delete_instance`
|
4085
|
+
# @return [::Gapic::Config::Method]
|
4086
|
+
#
|
4087
|
+
attr_reader :delete_instance
|
4088
|
+
##
|
4089
|
+
# RPC-specific configuration for `failover_instance`
|
4090
|
+
# @return [::Gapic::Config::Method]
|
4091
|
+
#
|
4092
|
+
attr_reader :failover_instance
|
4093
|
+
##
|
4094
|
+
# RPC-specific configuration for `inject_fault`
|
4095
|
+
# @return [::Gapic::Config::Method]
|
4096
|
+
#
|
4097
|
+
attr_reader :inject_fault
|
4098
|
+
##
|
4099
|
+
# RPC-specific configuration for `restart_instance`
|
4100
|
+
# @return [::Gapic::Config::Method]
|
4101
|
+
#
|
4102
|
+
attr_reader :restart_instance
|
4103
|
+
##
|
4104
|
+
# RPC-specific configuration for `execute_sql`
|
4105
|
+
# @return [::Gapic::Config::Method]
|
4106
|
+
#
|
4107
|
+
attr_reader :execute_sql
|
4108
|
+
##
|
4109
|
+
# RPC-specific configuration for `list_backups`
|
4110
|
+
# @return [::Gapic::Config::Method]
|
4111
|
+
#
|
4112
|
+
attr_reader :list_backups
|
4113
|
+
##
|
4114
|
+
# RPC-specific configuration for `get_backup`
|
4115
|
+
# @return [::Gapic::Config::Method]
|
4116
|
+
#
|
4117
|
+
attr_reader :get_backup
|
4118
|
+
##
|
4119
|
+
# RPC-specific configuration for `create_backup`
|
4120
|
+
# @return [::Gapic::Config::Method]
|
4121
|
+
#
|
4122
|
+
attr_reader :create_backup
|
4123
|
+
##
|
4124
|
+
# RPC-specific configuration for `update_backup`
|
4125
|
+
# @return [::Gapic::Config::Method]
|
4126
|
+
#
|
4127
|
+
attr_reader :update_backup
|
4128
|
+
##
|
4129
|
+
# RPC-specific configuration for `delete_backup`
|
4130
|
+
# @return [::Gapic::Config::Method]
|
4131
|
+
#
|
4132
|
+
attr_reader :delete_backup
|
4133
|
+
##
|
4134
|
+
# RPC-specific configuration for `list_supported_database_flags`
|
4135
|
+
# @return [::Gapic::Config::Method]
|
4136
|
+
#
|
4137
|
+
attr_reader :list_supported_database_flags
|
4138
|
+
##
|
4139
|
+
# RPC-specific configuration for `generate_client_certificate`
|
4140
|
+
# @return [::Gapic::Config::Method]
|
4141
|
+
#
|
4142
|
+
attr_reader :generate_client_certificate
|
4143
|
+
##
|
4144
|
+
# RPC-specific configuration for `get_connection_info`
|
4145
|
+
# @return [::Gapic::Config::Method]
|
4146
|
+
#
|
4147
|
+
attr_reader :get_connection_info
|
4148
|
+
##
|
4149
|
+
# RPC-specific configuration for `list_users`
|
4150
|
+
# @return [::Gapic::Config::Method]
|
4151
|
+
#
|
4152
|
+
attr_reader :list_users
|
4153
|
+
##
|
4154
|
+
# RPC-specific configuration for `get_user`
|
4155
|
+
# @return [::Gapic::Config::Method]
|
4156
|
+
#
|
4157
|
+
attr_reader :get_user
|
4158
|
+
##
|
4159
|
+
# RPC-specific configuration for `create_user`
|
4160
|
+
# @return [::Gapic::Config::Method]
|
4161
|
+
#
|
4162
|
+
attr_reader :create_user
|
4163
|
+
##
|
4164
|
+
# RPC-specific configuration for `update_user`
|
4165
|
+
# @return [::Gapic::Config::Method]
|
4166
|
+
#
|
4167
|
+
attr_reader :update_user
|
4168
|
+
##
|
4169
|
+
# RPC-specific configuration for `delete_user`
|
4170
|
+
# @return [::Gapic::Config::Method]
|
4171
|
+
#
|
4172
|
+
attr_reader :delete_user
|
4173
|
+
##
|
4174
|
+
# RPC-specific configuration for `list_databases`
|
4175
|
+
# @return [::Gapic::Config::Method]
|
4176
|
+
#
|
4177
|
+
attr_reader :list_databases
|
4178
|
+
|
4179
|
+
# @private
|
4180
|
+
def initialize parent_rpcs = nil
|
4181
|
+
list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters
|
4182
|
+
@list_clusters = ::Gapic::Config::Method.new list_clusters_config
|
4183
|
+
get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster
|
4184
|
+
@get_cluster = ::Gapic::Config::Method.new get_cluster_config
|
4185
|
+
create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster
|
4186
|
+
@create_cluster = ::Gapic::Config::Method.new create_cluster_config
|
4187
|
+
update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster
|
4188
|
+
@update_cluster = ::Gapic::Config::Method.new update_cluster_config
|
4189
|
+
upgrade_cluster_config = parent_rpcs.upgrade_cluster if parent_rpcs.respond_to? :upgrade_cluster
|
4190
|
+
@upgrade_cluster = ::Gapic::Config::Method.new upgrade_cluster_config
|
4191
|
+
delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster
|
4192
|
+
@delete_cluster = ::Gapic::Config::Method.new delete_cluster_config
|
4193
|
+
promote_cluster_config = parent_rpcs.promote_cluster if parent_rpcs.respond_to? :promote_cluster
|
4194
|
+
@promote_cluster = ::Gapic::Config::Method.new promote_cluster_config
|
4195
|
+
switchover_cluster_config = parent_rpcs.switchover_cluster if parent_rpcs.respond_to? :switchover_cluster
|
4196
|
+
@switchover_cluster = ::Gapic::Config::Method.new switchover_cluster_config
|
4197
|
+
restore_cluster_config = parent_rpcs.restore_cluster if parent_rpcs.respond_to? :restore_cluster
|
4198
|
+
@restore_cluster = ::Gapic::Config::Method.new restore_cluster_config
|
4199
|
+
create_secondary_cluster_config = parent_rpcs.create_secondary_cluster if parent_rpcs.respond_to? :create_secondary_cluster
|
4200
|
+
@create_secondary_cluster = ::Gapic::Config::Method.new create_secondary_cluster_config
|
4201
|
+
list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
|
4202
|
+
@list_instances = ::Gapic::Config::Method.new list_instances_config
|
4203
|
+
get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
|
4204
|
+
@get_instance = ::Gapic::Config::Method.new get_instance_config
|
4205
|
+
create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
|
4206
|
+
@create_instance = ::Gapic::Config::Method.new create_instance_config
|
4207
|
+
create_secondary_instance_config = parent_rpcs.create_secondary_instance if parent_rpcs.respond_to? :create_secondary_instance
|
4208
|
+
@create_secondary_instance = ::Gapic::Config::Method.new create_secondary_instance_config
|
4209
|
+
batch_create_instances_config = parent_rpcs.batch_create_instances if parent_rpcs.respond_to? :batch_create_instances
|
4210
|
+
@batch_create_instances = ::Gapic::Config::Method.new batch_create_instances_config
|
4211
|
+
update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance
|
4212
|
+
@update_instance = ::Gapic::Config::Method.new update_instance_config
|
4213
|
+
delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
|
4214
|
+
@delete_instance = ::Gapic::Config::Method.new delete_instance_config
|
4215
|
+
failover_instance_config = parent_rpcs.failover_instance if parent_rpcs.respond_to? :failover_instance
|
4216
|
+
@failover_instance = ::Gapic::Config::Method.new failover_instance_config
|
4217
|
+
inject_fault_config = parent_rpcs.inject_fault if parent_rpcs.respond_to? :inject_fault
|
4218
|
+
@inject_fault = ::Gapic::Config::Method.new inject_fault_config
|
4219
|
+
restart_instance_config = parent_rpcs.restart_instance if parent_rpcs.respond_to? :restart_instance
|
4220
|
+
@restart_instance = ::Gapic::Config::Method.new restart_instance_config
|
4221
|
+
execute_sql_config = parent_rpcs.execute_sql if parent_rpcs.respond_to? :execute_sql
|
4222
|
+
@execute_sql = ::Gapic::Config::Method.new execute_sql_config
|
4223
|
+
list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
|
4224
|
+
@list_backups = ::Gapic::Config::Method.new list_backups_config
|
4225
|
+
get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
|
4226
|
+
@get_backup = ::Gapic::Config::Method.new get_backup_config
|
4227
|
+
create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup
|
4228
|
+
@create_backup = ::Gapic::Config::Method.new create_backup_config
|
4229
|
+
update_backup_config = parent_rpcs.update_backup if parent_rpcs.respond_to? :update_backup
|
4230
|
+
@update_backup = ::Gapic::Config::Method.new update_backup_config
|
4231
|
+
delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup
|
4232
|
+
@delete_backup = ::Gapic::Config::Method.new delete_backup_config
|
4233
|
+
list_supported_database_flags_config = parent_rpcs.list_supported_database_flags if parent_rpcs.respond_to? :list_supported_database_flags
|
4234
|
+
@list_supported_database_flags = ::Gapic::Config::Method.new list_supported_database_flags_config
|
4235
|
+
generate_client_certificate_config = parent_rpcs.generate_client_certificate if parent_rpcs.respond_to? :generate_client_certificate
|
4236
|
+
@generate_client_certificate = ::Gapic::Config::Method.new generate_client_certificate_config
|
4237
|
+
get_connection_info_config = parent_rpcs.get_connection_info if parent_rpcs.respond_to? :get_connection_info
|
4238
|
+
@get_connection_info = ::Gapic::Config::Method.new get_connection_info_config
|
4239
|
+
list_users_config = parent_rpcs.list_users if parent_rpcs.respond_to? :list_users
|
4240
|
+
@list_users = ::Gapic::Config::Method.new list_users_config
|
4241
|
+
get_user_config = parent_rpcs.get_user if parent_rpcs.respond_to? :get_user
|
4242
|
+
@get_user = ::Gapic::Config::Method.new get_user_config
|
4243
|
+
create_user_config = parent_rpcs.create_user if parent_rpcs.respond_to? :create_user
|
4244
|
+
@create_user = ::Gapic::Config::Method.new create_user_config
|
4245
|
+
update_user_config = parent_rpcs.update_user if parent_rpcs.respond_to? :update_user
|
4246
|
+
@update_user = ::Gapic::Config::Method.new update_user_config
|
4247
|
+
delete_user_config = parent_rpcs.delete_user if parent_rpcs.respond_to? :delete_user
|
4248
|
+
@delete_user = ::Gapic::Config::Method.new delete_user_config
|
4249
|
+
list_databases_config = parent_rpcs.list_databases if parent_rpcs.respond_to? :list_databases
|
4250
|
+
@list_databases = ::Gapic::Config::Method.new list_databases_config
|
4251
|
+
|
4252
|
+
yield self if block_given?
|
4253
|
+
end
|
4254
|
+
end
|
4255
|
+
end
|
4256
|
+
end
|
4257
|
+
end
|
4258
|
+
end
|
4259
|
+
end
|
4260
|
+
end
|
4261
|
+
end
|
4262
|
+
end
|