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