google-cloud-memorystore-v1 1.6.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +4 -4
- data/README.md +2 -2
- data/lib/google/cloud/memorystore/v1/memorystore/client.rb +2036 -0
- data/lib/google/cloud/memorystore/v1/memorystore/operations.rb +841 -0
- data/lib/google/cloud/memorystore/v1/memorystore/paths.rb +36 -0
- data/lib/google/cloud/memorystore/v1/memorystore/rest/client.rb +88 -0
- data/lib/google/cloud/memorystore/v1/memorystore/rest/service_stub.rb +61 -0
- data/lib/google/cloud/memorystore/v1/memorystore.rb +8 -0
- data/lib/google/cloud/memorystore/v1/memorystore_pb.rb +6 -1
- data/lib/google/cloud/memorystore/v1/memorystore_services_pb.rb +3 -0
- data/lib/google/cloud/memorystore/v1/version.rb +1 -1
- data/lib/google/cloud/memorystore/v1.rb +5 -0
- data/proto_docs/google/api/client.rb +149 -29
- data/proto_docs/google/cloud/memorystore/v1/memorystore.rb +98 -0
- data/proto_docs/google/type/timeofday.rb +10 -6
- metadata +3 -1
|
@@ -0,0 +1,2036 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2026 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/memorystore/v1/memorystore_pb"
|
|
21
|
+
require "google/cloud/location"
|
|
22
|
+
|
|
23
|
+
module Google
|
|
24
|
+
module Cloud
|
|
25
|
+
module Memorystore
|
|
26
|
+
module V1
|
|
27
|
+
module Memorystore
|
|
28
|
+
##
|
|
29
|
+
# Client for the Memorystore service.
|
|
30
|
+
#
|
|
31
|
+
# Service describing handlers for resources
|
|
32
|
+
#
|
|
33
|
+
class Client
|
|
34
|
+
# @private
|
|
35
|
+
API_VERSION = ""
|
|
36
|
+
|
|
37
|
+
# @private
|
|
38
|
+
DEFAULT_ENDPOINT_TEMPLATE = "memorystore.$UNIVERSE_DOMAIN$"
|
|
39
|
+
|
|
40
|
+
include Paths
|
|
41
|
+
|
|
42
|
+
# @private
|
|
43
|
+
attr_reader :memorystore_stub
|
|
44
|
+
|
|
45
|
+
##
|
|
46
|
+
# Configure the Memorystore Client class.
|
|
47
|
+
#
|
|
48
|
+
# See {::Google::Cloud::Memorystore::V1::Memorystore::Client::Configuration}
|
|
49
|
+
# for a description of the configuration fields.
|
|
50
|
+
#
|
|
51
|
+
# @example
|
|
52
|
+
#
|
|
53
|
+
# # Modify the configuration for all Memorystore clients
|
|
54
|
+
# ::Google::Cloud::Memorystore::V1::Memorystore::Client.configure do |config|
|
|
55
|
+
# config.timeout = 10.0
|
|
56
|
+
# end
|
|
57
|
+
#
|
|
58
|
+
# @yield [config] Configure the Client client.
|
|
59
|
+
# @yieldparam config [Client::Configuration]
|
|
60
|
+
#
|
|
61
|
+
# @return [Client::Configuration]
|
|
62
|
+
#
|
|
63
|
+
def self.configure
|
|
64
|
+
@configure ||= begin
|
|
65
|
+
namespace = ["Google", "Cloud", "Memorystore", "V1"]
|
|
66
|
+
parent_config = while namespace.any?
|
|
67
|
+
parent_name = namespace.join "::"
|
|
68
|
+
parent_const = const_get parent_name
|
|
69
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
|
70
|
+
namespace.pop
|
|
71
|
+
end
|
|
72
|
+
default_config = Client::Configuration.new parent_config
|
|
73
|
+
|
|
74
|
+
default_config.rpcs.list_instances.timeout = 60.0
|
|
75
|
+
default_config.rpcs.list_instances.retry_policy = {
|
|
76
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
default_config.rpcs.get_instance.timeout = 60.0
|
|
80
|
+
default_config.rpcs.get_instance.retry_policy = {
|
|
81
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
default_config.rpcs.create_instance.timeout = 600.0
|
|
85
|
+
|
|
86
|
+
default_config.rpcs.update_instance.timeout = 600.0
|
|
87
|
+
|
|
88
|
+
default_config.rpcs.delete_instance.timeout = 600.0
|
|
89
|
+
|
|
90
|
+
default_config.rpcs.get_certificate_authority.timeout = 60.0
|
|
91
|
+
default_config.rpcs.get_certificate_authority.retry_policy = {
|
|
92
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
default_config
|
|
96
|
+
end
|
|
97
|
+
yield @configure if block_given?
|
|
98
|
+
@configure
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
##
|
|
102
|
+
# Configure the Memorystore Client instance.
|
|
103
|
+
#
|
|
104
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
|
105
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
|
106
|
+
# should be made on {Client.configure}.
|
|
107
|
+
#
|
|
108
|
+
# See {::Google::Cloud::Memorystore::V1::Memorystore::Client::Configuration}
|
|
109
|
+
# for a description of the configuration fields.
|
|
110
|
+
#
|
|
111
|
+
# @yield [config] Configure the Client client.
|
|
112
|
+
# @yieldparam config [Client::Configuration]
|
|
113
|
+
#
|
|
114
|
+
# @return [Client::Configuration]
|
|
115
|
+
#
|
|
116
|
+
def configure
|
|
117
|
+
yield @config if block_given?
|
|
118
|
+
@config
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
##
|
|
122
|
+
# The effective universe domain
|
|
123
|
+
#
|
|
124
|
+
# @return [String]
|
|
125
|
+
#
|
|
126
|
+
def universe_domain
|
|
127
|
+
@memorystore_stub.universe_domain
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
##
|
|
131
|
+
# Create a new Memorystore client object.
|
|
132
|
+
#
|
|
133
|
+
# @example
|
|
134
|
+
#
|
|
135
|
+
# # Create a client using the default configuration
|
|
136
|
+
# client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new
|
|
137
|
+
#
|
|
138
|
+
# # Create a client using a custom configuration
|
|
139
|
+
# client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config|
|
|
140
|
+
# config.timeout = 10.0
|
|
141
|
+
# end
|
|
142
|
+
#
|
|
143
|
+
# @yield [config] Configure the Memorystore client.
|
|
144
|
+
# @yieldparam config [Client::Configuration]
|
|
145
|
+
#
|
|
146
|
+
def initialize
|
|
147
|
+
# These require statements are intentionally placed here to initialize
|
|
148
|
+
# the gRPC module only when it's required.
|
|
149
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
|
150
|
+
require "gapic/grpc"
|
|
151
|
+
require "google/cloud/memorystore/v1/memorystore_services_pb"
|
|
152
|
+
|
|
153
|
+
# Create the configuration object
|
|
154
|
+
@config = Configuration.new Client.configure
|
|
155
|
+
|
|
156
|
+
# Yield the configuration if needed
|
|
157
|
+
yield @config if block_given?
|
|
158
|
+
|
|
159
|
+
# Create credentials
|
|
160
|
+
credentials = @config.credentials
|
|
161
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
|
162
|
+
# but only if the default endpoint does not have a region prefix.
|
|
163
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
|
164
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
|
165
|
+
!@config.endpoint.split(".").first.include?("-"))
|
|
166
|
+
credentials ||= Credentials.default scope: @config.scope,
|
|
167
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
|
168
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
|
169
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
|
170
|
+
end
|
|
171
|
+
@quota_project_id = @config.quota_project
|
|
172
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
|
173
|
+
|
|
174
|
+
@operations_client = Operations.new do |config|
|
|
175
|
+
config.credentials = credentials
|
|
176
|
+
config.quota_project = @quota_project_id
|
|
177
|
+
config.endpoint = @config.endpoint
|
|
178
|
+
config.universe_domain = @config.universe_domain
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
@memorystore_stub = ::Gapic::ServiceStub.new(
|
|
182
|
+
::Google::Cloud::Memorystore::V1::Memorystore::Stub,
|
|
183
|
+
credentials: credentials,
|
|
184
|
+
endpoint: @config.endpoint,
|
|
185
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
|
186
|
+
universe_domain: @config.universe_domain,
|
|
187
|
+
channel_args: @config.channel_args,
|
|
188
|
+
interceptors: @config.interceptors,
|
|
189
|
+
channel_pool_config: @config.channel_pool,
|
|
190
|
+
logger: @config.logger
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
@memorystore_stub.stub_logger&.info do |entry|
|
|
194
|
+
entry.set_system_name
|
|
195
|
+
entry.set_service
|
|
196
|
+
entry.message = "Created client for #{entry.service}"
|
|
197
|
+
entry.set_credentials_fields credentials
|
|
198
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
|
199
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
|
200
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
|
204
|
+
config.credentials = credentials
|
|
205
|
+
config.quota_project = @quota_project_id
|
|
206
|
+
config.endpoint = @memorystore_stub.endpoint
|
|
207
|
+
config.universe_domain = @memorystore_stub.universe_domain
|
|
208
|
+
config.logger = @memorystore_stub.logger if config.respond_to? :logger=
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
##
|
|
213
|
+
# Get the associated client for long-running operations.
|
|
214
|
+
#
|
|
215
|
+
# @return [::Google::Cloud::Memorystore::V1::Memorystore::Operations]
|
|
216
|
+
#
|
|
217
|
+
attr_reader :operations_client
|
|
218
|
+
|
|
219
|
+
##
|
|
220
|
+
# Get the associated client for mix-in of the Locations.
|
|
221
|
+
#
|
|
222
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
|
223
|
+
#
|
|
224
|
+
attr_reader :location_client
|
|
225
|
+
|
|
226
|
+
##
|
|
227
|
+
# The logger used for request/response debug logging.
|
|
228
|
+
#
|
|
229
|
+
# @return [Logger]
|
|
230
|
+
#
|
|
231
|
+
def logger
|
|
232
|
+
@memorystore_stub.logger
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Service calls
|
|
236
|
+
|
|
237
|
+
##
|
|
238
|
+
# Lists Instances in a given project and location.
|
|
239
|
+
#
|
|
240
|
+
# @overload list_instances(request, options = nil)
|
|
241
|
+
# Pass arguments to `list_instances` via a request object, either of type
|
|
242
|
+
# {::Google::Cloud::Memorystore::V1::ListInstancesRequest} or an equivalent Hash.
|
|
243
|
+
#
|
|
244
|
+
# @param request [::Google::Cloud::Memorystore::V1::ListInstancesRequest, ::Hash]
|
|
245
|
+
# A request object representing the call parameters. Required. To specify no
|
|
246
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
247
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
248
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
249
|
+
#
|
|
250
|
+
# @overload list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
|
251
|
+
# Pass arguments to `list_instances` via keyword arguments. Note that at
|
|
252
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
253
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
254
|
+
#
|
|
255
|
+
# @param parent [::String]
|
|
256
|
+
# Required. The parent to list instances from.
|
|
257
|
+
# Format: projects/\\{project}/locations/\\{location}
|
|
258
|
+
# @param page_size [::Integer]
|
|
259
|
+
# Optional. Requested page size. Server may return fewer items than
|
|
260
|
+
# requested. If unspecified, server will pick an appropriate default.
|
|
261
|
+
# @param page_token [::String]
|
|
262
|
+
# Optional. A token identifying a page of results the server should return.
|
|
263
|
+
# @param filter [::String]
|
|
264
|
+
# Optional. Expression for filtering results.
|
|
265
|
+
# @param order_by [::String]
|
|
266
|
+
# Optional. Sort results by a defined order. Supported values: "name",
|
|
267
|
+
# "create_time".
|
|
268
|
+
#
|
|
269
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
270
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1::Instance>]
|
|
271
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
272
|
+
#
|
|
273
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1::Instance>]
|
|
274
|
+
#
|
|
275
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
276
|
+
#
|
|
277
|
+
# @example Basic example
|
|
278
|
+
# require "google/cloud/memorystore/v1"
|
|
279
|
+
#
|
|
280
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
281
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Client.new
|
|
282
|
+
#
|
|
283
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
284
|
+
# request = Google::Cloud::Memorystore::V1::ListInstancesRequest.new
|
|
285
|
+
#
|
|
286
|
+
# # Call the list_instances method.
|
|
287
|
+
# result = client.list_instances request
|
|
288
|
+
#
|
|
289
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
|
290
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
|
291
|
+
# result.each do |item|
|
|
292
|
+
# # Each element is of type ::Google::Cloud::Memorystore::V1::Instance.
|
|
293
|
+
# p item
|
|
294
|
+
# end
|
|
295
|
+
#
|
|
296
|
+
def list_instances request, options = nil
|
|
297
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
298
|
+
|
|
299
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::ListInstancesRequest
|
|
300
|
+
|
|
301
|
+
# Converts hash and nil to an options object
|
|
302
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
303
|
+
|
|
304
|
+
# Customize the options with defaults
|
|
305
|
+
metadata = @config.rpcs.list_instances.metadata.to_h
|
|
306
|
+
|
|
307
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
308
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
309
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
310
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION
|
|
311
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
312
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
313
|
+
|
|
314
|
+
header_params = {}
|
|
315
|
+
if request.parent
|
|
316
|
+
header_params["parent"] = request.parent
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
320
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
321
|
+
|
|
322
|
+
options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
|
|
323
|
+
metadata: metadata,
|
|
324
|
+
retry_policy: @config.rpcs.list_instances.retry_policy
|
|
325
|
+
|
|
326
|
+
options.apply_defaults timeout: @config.timeout,
|
|
327
|
+
metadata: @config.metadata,
|
|
328
|
+
retry_policy: @config.retry_policy
|
|
329
|
+
|
|
330
|
+
@memorystore_stub.call_rpc :list_instances, request, options: options do |response, operation|
|
|
331
|
+
response = ::Gapic::PagedEnumerable.new @memorystore_stub, :list_instances, request, response, operation, options
|
|
332
|
+
yield response, operation if block_given?
|
|
333
|
+
throw :response, response
|
|
334
|
+
end
|
|
335
|
+
rescue ::GRPC::BadStatus => e
|
|
336
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
##
|
|
340
|
+
# Gets details of a single Instance.
|
|
341
|
+
#
|
|
342
|
+
# @overload get_instance(request, options = nil)
|
|
343
|
+
# Pass arguments to `get_instance` via a request object, either of type
|
|
344
|
+
# {::Google::Cloud::Memorystore::V1::GetInstanceRequest} or an equivalent Hash.
|
|
345
|
+
#
|
|
346
|
+
# @param request [::Google::Cloud::Memorystore::V1::GetInstanceRequest, ::Hash]
|
|
347
|
+
# A request object representing the call parameters. Required. To specify no
|
|
348
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
349
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
350
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
351
|
+
#
|
|
352
|
+
# @overload get_instance(name: nil)
|
|
353
|
+
# Pass arguments to `get_instance` via keyword arguments. Note that at
|
|
354
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
355
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
356
|
+
#
|
|
357
|
+
# @param name [::String]
|
|
358
|
+
# Required. The name of the instance to retrieve.
|
|
359
|
+
# Format: projects/\\{project}/locations/\\{location}/instances/\\{instance}
|
|
360
|
+
#
|
|
361
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
362
|
+
# @yieldparam response [::Google::Cloud::Memorystore::V1::Instance]
|
|
363
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
364
|
+
#
|
|
365
|
+
# @return [::Google::Cloud::Memorystore::V1::Instance]
|
|
366
|
+
#
|
|
367
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
368
|
+
#
|
|
369
|
+
# @example Basic example
|
|
370
|
+
# require "google/cloud/memorystore/v1"
|
|
371
|
+
#
|
|
372
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
373
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Client.new
|
|
374
|
+
#
|
|
375
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
376
|
+
# request = Google::Cloud::Memorystore::V1::GetInstanceRequest.new
|
|
377
|
+
#
|
|
378
|
+
# # Call the get_instance method.
|
|
379
|
+
# result = client.get_instance request
|
|
380
|
+
#
|
|
381
|
+
# # The returned object is of type Google::Cloud::Memorystore::V1::Instance.
|
|
382
|
+
# p result
|
|
383
|
+
#
|
|
384
|
+
def get_instance request, options = nil
|
|
385
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
386
|
+
|
|
387
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::GetInstanceRequest
|
|
388
|
+
|
|
389
|
+
# Converts hash and nil to an options object
|
|
390
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
391
|
+
|
|
392
|
+
# Customize the options with defaults
|
|
393
|
+
metadata = @config.rpcs.get_instance.metadata.to_h
|
|
394
|
+
|
|
395
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
396
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
397
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
398
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION
|
|
399
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
400
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
401
|
+
|
|
402
|
+
header_params = {}
|
|
403
|
+
if request.name
|
|
404
|
+
header_params["name"] = request.name
|
|
405
|
+
end
|
|
406
|
+
|
|
407
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
408
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
409
|
+
|
|
410
|
+
options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
|
|
411
|
+
metadata: metadata,
|
|
412
|
+
retry_policy: @config.rpcs.get_instance.retry_policy
|
|
413
|
+
|
|
414
|
+
options.apply_defaults timeout: @config.timeout,
|
|
415
|
+
metadata: @config.metadata,
|
|
416
|
+
retry_policy: @config.retry_policy
|
|
417
|
+
|
|
418
|
+
@memorystore_stub.call_rpc :get_instance, request, options: options do |response, operation|
|
|
419
|
+
yield response, operation if block_given?
|
|
420
|
+
end
|
|
421
|
+
rescue ::GRPC::BadStatus => e
|
|
422
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
423
|
+
end
|
|
424
|
+
|
|
425
|
+
##
|
|
426
|
+
# Creates a new Instance in a given project and location.
|
|
427
|
+
#
|
|
428
|
+
# @overload create_instance(request, options = nil)
|
|
429
|
+
# Pass arguments to `create_instance` via a request object, either of type
|
|
430
|
+
# {::Google::Cloud::Memorystore::V1::CreateInstanceRequest} or an equivalent Hash.
|
|
431
|
+
#
|
|
432
|
+
# @param request [::Google::Cloud::Memorystore::V1::CreateInstanceRequest, ::Hash]
|
|
433
|
+
# A request object representing the call parameters. Required. To specify no
|
|
434
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
435
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
436
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
437
|
+
#
|
|
438
|
+
# @overload create_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil)
|
|
439
|
+
# Pass arguments to `create_instance` via keyword arguments. Note that at
|
|
440
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
441
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
442
|
+
#
|
|
443
|
+
# @param parent [::String]
|
|
444
|
+
# Required. The parent resource where this instance will be created.
|
|
445
|
+
# Format: projects/\\{project}/locations/\\{location}
|
|
446
|
+
# @param instance_id [::String]
|
|
447
|
+
# Required. The ID to use for the instance, which will become the final
|
|
448
|
+
# component of the instance's resource name.
|
|
449
|
+
#
|
|
450
|
+
# This value is subject to the following restrictions:
|
|
451
|
+
#
|
|
452
|
+
# * Must be 4-63 characters in length
|
|
453
|
+
# * Must begin with a letter or digit
|
|
454
|
+
# * Must contain only lowercase letters, digits, and hyphens
|
|
455
|
+
# * Must not end with a hyphen
|
|
456
|
+
# * Must be unique within a location
|
|
457
|
+
# @param instance [::Google::Cloud::Memorystore::V1::Instance, ::Hash]
|
|
458
|
+
# Required. The instance to create.
|
|
459
|
+
# @param request_id [::String]
|
|
460
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
|
461
|
+
# request ID so that if you must retry your request, the server will know to
|
|
462
|
+
# ignore the request if it has already been completed. The server will
|
|
463
|
+
# guarantee that for at least 60 minutes since the first request.
|
|
464
|
+
#
|
|
465
|
+
# For example, consider a situation where you make an initial request and the
|
|
466
|
+
# request times out. If you make the request again with the same request
|
|
467
|
+
# ID, the server can check if original operation with the same request ID
|
|
468
|
+
# was received, and if so, will ignore the second request. This prevents
|
|
469
|
+
# clients from accidentally creating duplicate commitments.
|
|
470
|
+
#
|
|
471
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
|
472
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
|
473
|
+
#
|
|
474
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
475
|
+
# @yieldparam response [::Gapic::Operation]
|
|
476
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
477
|
+
#
|
|
478
|
+
# @return [::Gapic::Operation]
|
|
479
|
+
#
|
|
480
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
481
|
+
#
|
|
482
|
+
# @example Basic example
|
|
483
|
+
# require "google/cloud/memorystore/v1"
|
|
484
|
+
#
|
|
485
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
486
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Client.new
|
|
487
|
+
#
|
|
488
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
489
|
+
# request = Google::Cloud::Memorystore::V1::CreateInstanceRequest.new
|
|
490
|
+
#
|
|
491
|
+
# # Call the create_instance method.
|
|
492
|
+
# result = client.create_instance request
|
|
493
|
+
#
|
|
494
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
495
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
496
|
+
# # Here is how to wait for a response.
|
|
497
|
+
# result.wait_until_done! timeout: 60
|
|
498
|
+
# if result.response?
|
|
499
|
+
# p result.response
|
|
500
|
+
# else
|
|
501
|
+
# puts "No response received."
|
|
502
|
+
# end
|
|
503
|
+
#
|
|
504
|
+
def create_instance request, options = nil
|
|
505
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
506
|
+
|
|
507
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::CreateInstanceRequest
|
|
508
|
+
|
|
509
|
+
# Converts hash and nil to an options object
|
|
510
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
511
|
+
|
|
512
|
+
# Customize the options with defaults
|
|
513
|
+
metadata = @config.rpcs.create_instance.metadata.to_h
|
|
514
|
+
|
|
515
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
516
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
517
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
518
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION
|
|
519
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
520
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
521
|
+
|
|
522
|
+
header_params = {}
|
|
523
|
+
if request.parent
|
|
524
|
+
header_params["parent"] = request.parent
|
|
525
|
+
end
|
|
526
|
+
|
|
527
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
528
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
529
|
+
|
|
530
|
+
options.apply_defaults timeout: @config.rpcs.create_instance.timeout,
|
|
531
|
+
metadata: metadata,
|
|
532
|
+
retry_policy: @config.rpcs.create_instance.retry_policy
|
|
533
|
+
|
|
534
|
+
options.apply_defaults timeout: @config.timeout,
|
|
535
|
+
metadata: @config.metadata,
|
|
536
|
+
retry_policy: @config.retry_policy
|
|
537
|
+
|
|
538
|
+
@memorystore_stub.call_rpc :create_instance, request, options: options do |response, operation|
|
|
539
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
|
540
|
+
yield response, operation if block_given?
|
|
541
|
+
throw :response, response
|
|
542
|
+
end
|
|
543
|
+
rescue ::GRPC::BadStatus => e
|
|
544
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
545
|
+
end
|
|
546
|
+
|
|
547
|
+
##
|
|
548
|
+
# Updates the parameters of a single Instance.
|
|
549
|
+
#
|
|
550
|
+
# @overload update_instance(request, options = nil)
|
|
551
|
+
# Pass arguments to `update_instance` via a request object, either of type
|
|
552
|
+
# {::Google::Cloud::Memorystore::V1::UpdateInstanceRequest} or an equivalent Hash.
|
|
553
|
+
#
|
|
554
|
+
# @param request [::Google::Cloud::Memorystore::V1::UpdateInstanceRequest, ::Hash]
|
|
555
|
+
# A request object representing the call parameters. Required. To specify no
|
|
556
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
557
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
558
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
559
|
+
#
|
|
560
|
+
# @overload update_instance(update_mask: nil, instance: nil, request_id: nil)
|
|
561
|
+
# Pass arguments to `update_instance` via keyword arguments. Note that at
|
|
562
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
563
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
564
|
+
#
|
|
565
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
|
566
|
+
# Optional. The list of fields to be updated on the instance. At least one
|
|
567
|
+
# field must be specified.
|
|
568
|
+
# @param instance [::Google::Cloud::Memorystore::V1::Instance, ::Hash]
|
|
569
|
+
# Required. The instance to update.
|
|
570
|
+
# @param request_id [::String]
|
|
571
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
|
572
|
+
# request ID so that if you must retry your request, the server will know to
|
|
573
|
+
# ignore the request if it has already been completed. The server will
|
|
574
|
+
# guarantee that for at least 60 minutes since the first request.
|
|
575
|
+
#
|
|
576
|
+
# For example, consider a situation where you make an initial request and the
|
|
577
|
+
# request times out. If you make the request again with the same request
|
|
578
|
+
# ID, the server can check if original operation with the same request ID
|
|
579
|
+
# was received, and if so, will ignore the second request. This prevents
|
|
580
|
+
# clients from accidentally creating duplicate commitments.
|
|
581
|
+
#
|
|
582
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
|
583
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
|
584
|
+
#
|
|
585
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
586
|
+
# @yieldparam response [::Gapic::Operation]
|
|
587
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
588
|
+
#
|
|
589
|
+
# @return [::Gapic::Operation]
|
|
590
|
+
#
|
|
591
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
592
|
+
#
|
|
593
|
+
# @example Basic example
|
|
594
|
+
# require "google/cloud/memorystore/v1"
|
|
595
|
+
#
|
|
596
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
597
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Client.new
|
|
598
|
+
#
|
|
599
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
600
|
+
# request = Google::Cloud::Memorystore::V1::UpdateInstanceRequest.new
|
|
601
|
+
#
|
|
602
|
+
# # Call the update_instance method.
|
|
603
|
+
# result = client.update_instance request
|
|
604
|
+
#
|
|
605
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
606
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
607
|
+
# # Here is how to wait for a response.
|
|
608
|
+
# result.wait_until_done! timeout: 60
|
|
609
|
+
# if result.response?
|
|
610
|
+
# p result.response
|
|
611
|
+
# else
|
|
612
|
+
# puts "No response received."
|
|
613
|
+
# end
|
|
614
|
+
#
|
|
615
|
+
def update_instance request, options = nil
|
|
616
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
617
|
+
|
|
618
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::UpdateInstanceRequest
|
|
619
|
+
|
|
620
|
+
# Converts hash and nil to an options object
|
|
621
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
622
|
+
|
|
623
|
+
# Customize the options with defaults
|
|
624
|
+
metadata = @config.rpcs.update_instance.metadata.to_h
|
|
625
|
+
|
|
626
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
627
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
628
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
629
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION
|
|
630
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
631
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
632
|
+
|
|
633
|
+
header_params = {}
|
|
634
|
+
if request.instance&.name
|
|
635
|
+
header_params["instance.name"] = request.instance.name
|
|
636
|
+
end
|
|
637
|
+
|
|
638
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
639
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
640
|
+
|
|
641
|
+
options.apply_defaults timeout: @config.rpcs.update_instance.timeout,
|
|
642
|
+
metadata: metadata,
|
|
643
|
+
retry_policy: @config.rpcs.update_instance.retry_policy
|
|
644
|
+
|
|
645
|
+
options.apply_defaults timeout: @config.timeout,
|
|
646
|
+
metadata: @config.metadata,
|
|
647
|
+
retry_policy: @config.retry_policy
|
|
648
|
+
|
|
649
|
+
@memorystore_stub.call_rpc :update_instance, request, options: options do |response, operation|
|
|
650
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
|
651
|
+
yield response, operation if block_given?
|
|
652
|
+
throw :response, response
|
|
653
|
+
end
|
|
654
|
+
rescue ::GRPC::BadStatus => e
|
|
655
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
656
|
+
end
|
|
657
|
+
|
|
658
|
+
##
|
|
659
|
+
# Deletes a single Instance.
|
|
660
|
+
#
|
|
661
|
+
# @overload delete_instance(request, options = nil)
|
|
662
|
+
# Pass arguments to `delete_instance` via a request object, either of type
|
|
663
|
+
# {::Google::Cloud::Memorystore::V1::DeleteInstanceRequest} or an equivalent Hash.
|
|
664
|
+
#
|
|
665
|
+
# @param request [::Google::Cloud::Memorystore::V1::DeleteInstanceRequest, ::Hash]
|
|
666
|
+
# A request object representing the call parameters. Required. To specify no
|
|
667
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
668
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
669
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
670
|
+
#
|
|
671
|
+
# @overload delete_instance(name: nil, request_id: nil)
|
|
672
|
+
# Pass arguments to `delete_instance` via keyword arguments. Note that at
|
|
673
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
674
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
675
|
+
#
|
|
676
|
+
# @param name [::String]
|
|
677
|
+
# Required. The name of the instance to delete.
|
|
678
|
+
# Format: projects/\\{project}/locations/\\{location}/instances/\\{instance}
|
|
679
|
+
# @param request_id [::String]
|
|
680
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
|
681
|
+
# request ID so that if you must retry your request, the server will know to
|
|
682
|
+
# ignore the request if it has already been completed. The server will
|
|
683
|
+
# guarantee that for at least 60 minutes after the first request.
|
|
684
|
+
#
|
|
685
|
+
# For example, consider a situation where you make an initial request and the
|
|
686
|
+
# request times out. If you make the request again with the same request
|
|
687
|
+
# ID, the server can check if original operation with the same request ID
|
|
688
|
+
# was received, and if so, will ignore the second request. This prevents
|
|
689
|
+
# clients from accidentally creating duplicate commitments.
|
|
690
|
+
#
|
|
691
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
|
692
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
|
693
|
+
#
|
|
694
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
695
|
+
# @yieldparam response [::Gapic::Operation]
|
|
696
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
697
|
+
#
|
|
698
|
+
# @return [::Gapic::Operation]
|
|
699
|
+
#
|
|
700
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
701
|
+
#
|
|
702
|
+
# @example Basic example
|
|
703
|
+
# require "google/cloud/memorystore/v1"
|
|
704
|
+
#
|
|
705
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
706
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Client.new
|
|
707
|
+
#
|
|
708
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
709
|
+
# request = Google::Cloud::Memorystore::V1::DeleteInstanceRequest.new
|
|
710
|
+
#
|
|
711
|
+
# # Call the delete_instance method.
|
|
712
|
+
# result = client.delete_instance request
|
|
713
|
+
#
|
|
714
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
715
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
716
|
+
# # Here is how to wait for a response.
|
|
717
|
+
# result.wait_until_done! timeout: 60
|
|
718
|
+
# if result.response?
|
|
719
|
+
# p result.response
|
|
720
|
+
# else
|
|
721
|
+
# puts "No response received."
|
|
722
|
+
# end
|
|
723
|
+
#
|
|
724
|
+
def delete_instance request, options = nil
|
|
725
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
726
|
+
|
|
727
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::DeleteInstanceRequest
|
|
728
|
+
|
|
729
|
+
# Converts hash and nil to an options object
|
|
730
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
731
|
+
|
|
732
|
+
# Customize the options with defaults
|
|
733
|
+
metadata = @config.rpcs.delete_instance.metadata.to_h
|
|
734
|
+
|
|
735
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
736
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
737
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
738
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION
|
|
739
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
740
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
741
|
+
|
|
742
|
+
header_params = {}
|
|
743
|
+
if request.name
|
|
744
|
+
header_params["name"] = request.name
|
|
745
|
+
end
|
|
746
|
+
|
|
747
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
748
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
749
|
+
|
|
750
|
+
options.apply_defaults timeout: @config.rpcs.delete_instance.timeout,
|
|
751
|
+
metadata: metadata,
|
|
752
|
+
retry_policy: @config.rpcs.delete_instance.retry_policy
|
|
753
|
+
|
|
754
|
+
options.apply_defaults timeout: @config.timeout,
|
|
755
|
+
metadata: @config.metadata,
|
|
756
|
+
retry_policy: @config.retry_policy
|
|
757
|
+
|
|
758
|
+
@memorystore_stub.call_rpc :delete_instance, request, options: options do |response, operation|
|
|
759
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
|
760
|
+
yield response, operation if block_given?
|
|
761
|
+
throw :response, response
|
|
762
|
+
end
|
|
763
|
+
rescue ::GRPC::BadStatus => e
|
|
764
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
765
|
+
end
|
|
766
|
+
|
|
767
|
+
##
|
|
768
|
+
# Gets details about the certificate authority for an Instance.
|
|
769
|
+
#
|
|
770
|
+
# @overload get_certificate_authority(request, options = nil)
|
|
771
|
+
# Pass arguments to `get_certificate_authority` via a request object, either of type
|
|
772
|
+
# {::Google::Cloud::Memorystore::V1::GetCertificateAuthorityRequest} or an equivalent Hash.
|
|
773
|
+
#
|
|
774
|
+
# @param request [::Google::Cloud::Memorystore::V1::GetCertificateAuthorityRequest, ::Hash]
|
|
775
|
+
# A request object representing the call parameters. Required. To specify no
|
|
776
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
777
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
778
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
779
|
+
#
|
|
780
|
+
# @overload get_certificate_authority(name: nil)
|
|
781
|
+
# Pass arguments to `get_certificate_authority` via keyword arguments. Note that at
|
|
782
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
783
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
784
|
+
#
|
|
785
|
+
# @param name [::String]
|
|
786
|
+
# Required. The name of the certificate authority.
|
|
787
|
+
# Format:
|
|
788
|
+
# projects/\\{project}/locations/\\{location}/instances/\\{instance}/certificateAuthority
|
|
789
|
+
#
|
|
790
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
791
|
+
# @yieldparam response [::Google::Cloud::Memorystore::V1::CertificateAuthority]
|
|
792
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
793
|
+
#
|
|
794
|
+
# @return [::Google::Cloud::Memorystore::V1::CertificateAuthority]
|
|
795
|
+
#
|
|
796
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
797
|
+
#
|
|
798
|
+
# @example Basic example
|
|
799
|
+
# require "google/cloud/memorystore/v1"
|
|
800
|
+
#
|
|
801
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
802
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Client.new
|
|
803
|
+
#
|
|
804
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
805
|
+
# request = Google::Cloud::Memorystore::V1::GetCertificateAuthorityRequest.new
|
|
806
|
+
#
|
|
807
|
+
# # Call the get_certificate_authority method.
|
|
808
|
+
# result = client.get_certificate_authority request
|
|
809
|
+
#
|
|
810
|
+
# # The returned object is of type Google::Cloud::Memorystore::V1::CertificateAuthority.
|
|
811
|
+
# p result
|
|
812
|
+
#
|
|
813
|
+
def get_certificate_authority request, options = nil
|
|
814
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
815
|
+
|
|
816
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::GetCertificateAuthorityRequest
|
|
817
|
+
|
|
818
|
+
# Converts hash and nil to an options object
|
|
819
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
820
|
+
|
|
821
|
+
# Customize the options with defaults
|
|
822
|
+
metadata = @config.rpcs.get_certificate_authority.metadata.to_h
|
|
823
|
+
|
|
824
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
825
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
826
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
827
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION
|
|
828
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
829
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
830
|
+
|
|
831
|
+
header_params = {}
|
|
832
|
+
if request.name
|
|
833
|
+
header_params["name"] = request.name
|
|
834
|
+
end
|
|
835
|
+
|
|
836
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
837
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
838
|
+
|
|
839
|
+
options.apply_defaults timeout: @config.rpcs.get_certificate_authority.timeout,
|
|
840
|
+
metadata: metadata,
|
|
841
|
+
retry_policy: @config.rpcs.get_certificate_authority.retry_policy
|
|
842
|
+
|
|
843
|
+
options.apply_defaults timeout: @config.timeout,
|
|
844
|
+
metadata: @config.metadata,
|
|
845
|
+
retry_policy: @config.retry_policy
|
|
846
|
+
|
|
847
|
+
@memorystore_stub.call_rpc :get_certificate_authority, request, options: options do |response, operation|
|
|
848
|
+
yield response, operation if block_given?
|
|
849
|
+
end
|
|
850
|
+
rescue ::GRPC::BadStatus => e
|
|
851
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
852
|
+
end
|
|
853
|
+
|
|
854
|
+
##
|
|
855
|
+
# Gets the details of shared regional certificate authority information for
|
|
856
|
+
# Memorystore instance.
|
|
857
|
+
#
|
|
858
|
+
# @overload get_shared_regional_certificate_authority(request, options = nil)
|
|
859
|
+
# Pass arguments to `get_shared_regional_certificate_authority` via a request object, either of type
|
|
860
|
+
# {::Google::Cloud::Memorystore::V1::GetSharedRegionalCertificateAuthorityRequest} or an equivalent Hash.
|
|
861
|
+
#
|
|
862
|
+
# @param request [::Google::Cloud::Memorystore::V1::GetSharedRegionalCertificateAuthorityRequest, ::Hash]
|
|
863
|
+
# A request object representing the call parameters. Required. To specify no
|
|
864
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
865
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
866
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
867
|
+
#
|
|
868
|
+
# @overload get_shared_regional_certificate_authority(name: nil)
|
|
869
|
+
# Pass arguments to `get_shared_regional_certificate_authority` via keyword arguments. Note that at
|
|
870
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
871
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
872
|
+
#
|
|
873
|
+
# @param name [::String]
|
|
874
|
+
# Required. Regional certificate authority resource name using the form:
|
|
875
|
+
# `projects/{project}/locations/{location}/sharedRegionalCertificateAuthority`
|
|
876
|
+
# where `location_id` refers to a Google Cloud region.
|
|
877
|
+
#
|
|
878
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
879
|
+
# @yieldparam response [::Google::Cloud::Memorystore::V1::SharedRegionalCertificateAuthority]
|
|
880
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
881
|
+
#
|
|
882
|
+
# @return [::Google::Cloud::Memorystore::V1::SharedRegionalCertificateAuthority]
|
|
883
|
+
#
|
|
884
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
885
|
+
#
|
|
886
|
+
# @example Basic example
|
|
887
|
+
# require "google/cloud/memorystore/v1"
|
|
888
|
+
#
|
|
889
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
890
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Client.new
|
|
891
|
+
#
|
|
892
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
893
|
+
# request = Google::Cloud::Memorystore::V1::GetSharedRegionalCertificateAuthorityRequest.new
|
|
894
|
+
#
|
|
895
|
+
# # Call the get_shared_regional_certificate_authority method.
|
|
896
|
+
# result = client.get_shared_regional_certificate_authority request
|
|
897
|
+
#
|
|
898
|
+
# # The returned object is of type Google::Cloud::Memorystore::V1::SharedRegionalCertificateAuthority.
|
|
899
|
+
# p result
|
|
900
|
+
#
|
|
901
|
+
def get_shared_regional_certificate_authority request, options = nil
|
|
902
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
903
|
+
|
|
904
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::GetSharedRegionalCertificateAuthorityRequest
|
|
905
|
+
|
|
906
|
+
# Converts hash and nil to an options object
|
|
907
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
908
|
+
|
|
909
|
+
# Customize the options with defaults
|
|
910
|
+
metadata = @config.rpcs.get_shared_regional_certificate_authority.metadata.to_h
|
|
911
|
+
|
|
912
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
913
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
914
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
915
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION
|
|
916
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
917
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
918
|
+
|
|
919
|
+
header_params = {}
|
|
920
|
+
if request.name
|
|
921
|
+
header_params["name"] = request.name
|
|
922
|
+
end
|
|
923
|
+
|
|
924
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
925
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
926
|
+
|
|
927
|
+
options.apply_defaults timeout: @config.rpcs.get_shared_regional_certificate_authority.timeout,
|
|
928
|
+
metadata: metadata,
|
|
929
|
+
retry_policy: @config.rpcs.get_shared_regional_certificate_authority.retry_policy
|
|
930
|
+
|
|
931
|
+
options.apply_defaults timeout: @config.timeout,
|
|
932
|
+
metadata: @config.metadata,
|
|
933
|
+
retry_policy: @config.retry_policy
|
|
934
|
+
|
|
935
|
+
@memorystore_stub.call_rpc :get_shared_regional_certificate_authority, request, options: options do |response, operation|
|
|
936
|
+
yield response, operation if block_given?
|
|
937
|
+
end
|
|
938
|
+
rescue ::GRPC::BadStatus => e
|
|
939
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
940
|
+
end
|
|
941
|
+
|
|
942
|
+
##
|
|
943
|
+
# Reschedules upcoming maintenance event.
|
|
944
|
+
#
|
|
945
|
+
# @overload reschedule_maintenance(request, options = nil)
|
|
946
|
+
# Pass arguments to `reschedule_maintenance` via a request object, either of type
|
|
947
|
+
# {::Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest} or an equivalent Hash.
|
|
948
|
+
#
|
|
949
|
+
# @param request [::Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest, ::Hash]
|
|
950
|
+
# A request object representing the call parameters. Required. To specify no
|
|
951
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
952
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
953
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
954
|
+
#
|
|
955
|
+
# @overload reschedule_maintenance(name: nil, reschedule_type: nil, schedule_time: nil)
|
|
956
|
+
# Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at
|
|
957
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
958
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
959
|
+
#
|
|
960
|
+
# @param name [::String]
|
|
961
|
+
# Required. Name of the instance to reschedule maintenance for:
|
|
962
|
+
# `projects/{project}/locations/{location_id}/instances/{instance}`
|
|
963
|
+
# @param reschedule_type [::Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest::RescheduleType]
|
|
964
|
+
# Required. If reschedule type is SPECIFIC_TIME, schedule_time must be set.
|
|
965
|
+
# @param schedule_time [::Google::Protobuf::Timestamp, ::Hash]
|
|
966
|
+
# Optional. Timestamp when the maintenance shall be rescheduled to if
|
|
967
|
+
# reschedule_type=SPECIFIC_TIME, in RFC 3339 format.
|
|
968
|
+
# Example: `2012-11-15T16:19:00.094Z`.
|
|
969
|
+
#
|
|
970
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
971
|
+
# @yieldparam response [::Gapic::Operation]
|
|
972
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
973
|
+
#
|
|
974
|
+
# @return [::Gapic::Operation]
|
|
975
|
+
#
|
|
976
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
977
|
+
#
|
|
978
|
+
# @example Basic example
|
|
979
|
+
# require "google/cloud/memorystore/v1"
|
|
980
|
+
#
|
|
981
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
982
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Client.new
|
|
983
|
+
#
|
|
984
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
985
|
+
# request = Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest.new
|
|
986
|
+
#
|
|
987
|
+
# # Call the reschedule_maintenance method.
|
|
988
|
+
# result = client.reschedule_maintenance request
|
|
989
|
+
#
|
|
990
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
991
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
992
|
+
# # Here is how to wait for a response.
|
|
993
|
+
# result.wait_until_done! timeout: 60
|
|
994
|
+
# if result.response?
|
|
995
|
+
# p result.response
|
|
996
|
+
# else
|
|
997
|
+
# puts "No response received."
|
|
998
|
+
# end
|
|
999
|
+
#
|
|
1000
|
+
def reschedule_maintenance request, options = nil
|
|
1001
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1002
|
+
|
|
1003
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest
|
|
1004
|
+
|
|
1005
|
+
# Converts hash and nil to an options object
|
|
1006
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1007
|
+
|
|
1008
|
+
# Customize the options with defaults
|
|
1009
|
+
metadata = @config.rpcs.reschedule_maintenance.metadata.to_h
|
|
1010
|
+
|
|
1011
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1012
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1013
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1014
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION
|
|
1015
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1016
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1017
|
+
|
|
1018
|
+
header_params = {}
|
|
1019
|
+
if request.name
|
|
1020
|
+
header_params["name"] = request.name
|
|
1021
|
+
end
|
|
1022
|
+
|
|
1023
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
1024
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
1025
|
+
|
|
1026
|
+
options.apply_defaults timeout: @config.rpcs.reschedule_maintenance.timeout,
|
|
1027
|
+
metadata: metadata,
|
|
1028
|
+
retry_policy: @config.rpcs.reschedule_maintenance.retry_policy
|
|
1029
|
+
|
|
1030
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1031
|
+
metadata: @config.metadata,
|
|
1032
|
+
retry_policy: @config.retry_policy
|
|
1033
|
+
|
|
1034
|
+
@memorystore_stub.call_rpc :reschedule_maintenance, request, options: options do |response, operation|
|
|
1035
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
|
1036
|
+
yield response, operation if block_given?
|
|
1037
|
+
throw :response, response
|
|
1038
|
+
end
|
|
1039
|
+
rescue ::GRPC::BadStatus => e
|
|
1040
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1041
|
+
end
|
|
1042
|
+
|
|
1043
|
+
##
|
|
1044
|
+
# Lists all backup collections owned by a consumer project in either the
|
|
1045
|
+
# specified location (region) or all locations.
|
|
1046
|
+
#
|
|
1047
|
+
# If `location_id` is specified as `-` (wildcard), then all regions
|
|
1048
|
+
# available to the project are queried, and the results are aggregated.
|
|
1049
|
+
#
|
|
1050
|
+
# @overload list_backup_collections(request, options = nil)
|
|
1051
|
+
# Pass arguments to `list_backup_collections` via a request object, either of type
|
|
1052
|
+
# {::Google::Cloud::Memorystore::V1::ListBackupCollectionsRequest} or an equivalent Hash.
|
|
1053
|
+
#
|
|
1054
|
+
# @param request [::Google::Cloud::Memorystore::V1::ListBackupCollectionsRequest, ::Hash]
|
|
1055
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1056
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1057
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1058
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
1059
|
+
#
|
|
1060
|
+
# @overload list_backup_collections(parent: nil, page_size: nil, page_token: nil)
|
|
1061
|
+
# Pass arguments to `list_backup_collections` via keyword arguments. Note that at
|
|
1062
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1063
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1064
|
+
#
|
|
1065
|
+
# @param parent [::String]
|
|
1066
|
+
# Required. The resource name of the backupCollection location using the
|
|
1067
|
+
# form:
|
|
1068
|
+
# `projects/{project_id}/locations/{location_id}`
|
|
1069
|
+
# where `location_id` refers to a Google Cloud region.
|
|
1070
|
+
# @param page_size [::Integer]
|
|
1071
|
+
# Optional. The maximum number of items to return.
|
|
1072
|
+
#
|
|
1073
|
+
# If not specified, a default value of 1000 will be used by the service.
|
|
1074
|
+
# Regardless of the page_size value, the response may include a partial list
|
|
1075
|
+
# and a caller should only rely on response's
|
|
1076
|
+
# {::Google::Cloud::Memorystore::V1::ListBackupCollectionsResponse#next_page_token `next_page_token`}
|
|
1077
|
+
# to determine if there are more clusters left to be queried.
|
|
1078
|
+
# @param page_token [::String]
|
|
1079
|
+
# Optional. The `next_page_token` value returned from a previous
|
|
1080
|
+
# [ListBackupCollections] request, if any.
|
|
1081
|
+
#
|
|
1082
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
1083
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1::BackupCollection>]
|
|
1084
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
1085
|
+
#
|
|
1086
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1::BackupCollection>]
|
|
1087
|
+
#
|
|
1088
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
1089
|
+
#
|
|
1090
|
+
# @example Basic example
|
|
1091
|
+
# require "google/cloud/memorystore/v1"
|
|
1092
|
+
#
|
|
1093
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1094
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Client.new
|
|
1095
|
+
#
|
|
1096
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1097
|
+
# request = Google::Cloud::Memorystore::V1::ListBackupCollectionsRequest.new
|
|
1098
|
+
#
|
|
1099
|
+
# # Call the list_backup_collections method.
|
|
1100
|
+
# result = client.list_backup_collections request
|
|
1101
|
+
#
|
|
1102
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
|
1103
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
|
1104
|
+
# result.each do |item|
|
|
1105
|
+
# # Each element is of type ::Google::Cloud::Memorystore::V1::BackupCollection.
|
|
1106
|
+
# p item
|
|
1107
|
+
# end
|
|
1108
|
+
#
|
|
1109
|
+
def list_backup_collections request, options = nil
|
|
1110
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1111
|
+
|
|
1112
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::ListBackupCollectionsRequest
|
|
1113
|
+
|
|
1114
|
+
# Converts hash and nil to an options object
|
|
1115
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1116
|
+
|
|
1117
|
+
# Customize the options with defaults
|
|
1118
|
+
metadata = @config.rpcs.list_backup_collections.metadata.to_h
|
|
1119
|
+
|
|
1120
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1121
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1122
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1123
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION
|
|
1124
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1125
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1126
|
+
|
|
1127
|
+
header_params = {}
|
|
1128
|
+
if request.parent
|
|
1129
|
+
header_params["parent"] = request.parent
|
|
1130
|
+
end
|
|
1131
|
+
|
|
1132
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
1133
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
1134
|
+
|
|
1135
|
+
options.apply_defaults timeout: @config.rpcs.list_backup_collections.timeout,
|
|
1136
|
+
metadata: metadata,
|
|
1137
|
+
retry_policy: @config.rpcs.list_backup_collections.retry_policy
|
|
1138
|
+
|
|
1139
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1140
|
+
metadata: @config.metadata,
|
|
1141
|
+
retry_policy: @config.retry_policy
|
|
1142
|
+
|
|
1143
|
+
@memorystore_stub.call_rpc :list_backup_collections, request, options: options do |response, operation|
|
|
1144
|
+
response = ::Gapic::PagedEnumerable.new @memorystore_stub, :list_backup_collections, request, response, operation, options
|
|
1145
|
+
yield response, operation if block_given?
|
|
1146
|
+
throw :response, response
|
|
1147
|
+
end
|
|
1148
|
+
rescue ::GRPC::BadStatus => e
|
|
1149
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1150
|
+
end
|
|
1151
|
+
|
|
1152
|
+
##
|
|
1153
|
+
# Get a backup collection.
|
|
1154
|
+
#
|
|
1155
|
+
# @overload get_backup_collection(request, options = nil)
|
|
1156
|
+
# Pass arguments to `get_backup_collection` via a request object, either of type
|
|
1157
|
+
# {::Google::Cloud::Memorystore::V1::GetBackupCollectionRequest} or an equivalent Hash.
|
|
1158
|
+
#
|
|
1159
|
+
# @param request [::Google::Cloud::Memorystore::V1::GetBackupCollectionRequest, ::Hash]
|
|
1160
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1161
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1162
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1163
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
1164
|
+
#
|
|
1165
|
+
# @overload get_backup_collection(name: nil)
|
|
1166
|
+
# Pass arguments to `get_backup_collection` via keyword arguments. Note that at
|
|
1167
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1168
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1169
|
+
#
|
|
1170
|
+
# @param name [::String]
|
|
1171
|
+
# Required. Instance backupCollection resource name using the form:
|
|
1172
|
+
# `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}`
|
|
1173
|
+
# where `location_id` refers to a Google Cloud region.
|
|
1174
|
+
#
|
|
1175
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
1176
|
+
# @yieldparam response [::Google::Cloud::Memorystore::V1::BackupCollection]
|
|
1177
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
1178
|
+
#
|
|
1179
|
+
# @return [::Google::Cloud::Memorystore::V1::BackupCollection]
|
|
1180
|
+
#
|
|
1181
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
1182
|
+
#
|
|
1183
|
+
# @example Basic example
|
|
1184
|
+
# require "google/cloud/memorystore/v1"
|
|
1185
|
+
#
|
|
1186
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1187
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Client.new
|
|
1188
|
+
#
|
|
1189
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1190
|
+
# request = Google::Cloud::Memorystore::V1::GetBackupCollectionRequest.new
|
|
1191
|
+
#
|
|
1192
|
+
# # Call the get_backup_collection method.
|
|
1193
|
+
# result = client.get_backup_collection request
|
|
1194
|
+
#
|
|
1195
|
+
# # The returned object is of type Google::Cloud::Memorystore::V1::BackupCollection.
|
|
1196
|
+
# p result
|
|
1197
|
+
#
|
|
1198
|
+
def get_backup_collection request, options = nil
|
|
1199
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1200
|
+
|
|
1201
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::GetBackupCollectionRequest
|
|
1202
|
+
|
|
1203
|
+
# Converts hash and nil to an options object
|
|
1204
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1205
|
+
|
|
1206
|
+
# Customize the options with defaults
|
|
1207
|
+
metadata = @config.rpcs.get_backup_collection.metadata.to_h
|
|
1208
|
+
|
|
1209
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1210
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1211
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1212
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION
|
|
1213
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1214
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1215
|
+
|
|
1216
|
+
header_params = {}
|
|
1217
|
+
if request.name
|
|
1218
|
+
header_params["name"] = request.name
|
|
1219
|
+
end
|
|
1220
|
+
|
|
1221
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
1222
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
1223
|
+
|
|
1224
|
+
options.apply_defaults timeout: @config.rpcs.get_backup_collection.timeout,
|
|
1225
|
+
metadata: metadata,
|
|
1226
|
+
retry_policy: @config.rpcs.get_backup_collection.retry_policy
|
|
1227
|
+
|
|
1228
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1229
|
+
metadata: @config.metadata,
|
|
1230
|
+
retry_policy: @config.retry_policy
|
|
1231
|
+
|
|
1232
|
+
@memorystore_stub.call_rpc :get_backup_collection, request, options: options do |response, operation|
|
|
1233
|
+
yield response, operation if block_given?
|
|
1234
|
+
end
|
|
1235
|
+
rescue ::GRPC::BadStatus => e
|
|
1236
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1237
|
+
end
|
|
1238
|
+
|
|
1239
|
+
##
|
|
1240
|
+
# Lists all backups owned by a backup collection.
|
|
1241
|
+
#
|
|
1242
|
+
# @overload list_backups(request, options = nil)
|
|
1243
|
+
# Pass arguments to `list_backups` via a request object, either of type
|
|
1244
|
+
# {::Google::Cloud::Memorystore::V1::ListBackupsRequest} or an equivalent Hash.
|
|
1245
|
+
#
|
|
1246
|
+
# @param request [::Google::Cloud::Memorystore::V1::ListBackupsRequest, ::Hash]
|
|
1247
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1248
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1249
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1250
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
1251
|
+
#
|
|
1252
|
+
# @overload list_backups(parent: nil, page_size: nil, page_token: nil)
|
|
1253
|
+
# Pass arguments to `list_backups` via keyword arguments. Note that at
|
|
1254
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1255
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1256
|
+
#
|
|
1257
|
+
# @param parent [::String]
|
|
1258
|
+
# Required. The resource name of the backupCollection using the form:
|
|
1259
|
+
# `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}`
|
|
1260
|
+
# @param page_size [::Integer]
|
|
1261
|
+
# Optional. The maximum number of items to return.
|
|
1262
|
+
#
|
|
1263
|
+
# If not specified, a default value of 1000 will be used by the service.
|
|
1264
|
+
# Regardless of the page_size value, the response may include a partial list
|
|
1265
|
+
# and a caller should only rely on response's
|
|
1266
|
+
# {::Google::Cloud::Memorystore::V1::ListBackupsResponse#next_page_token `next_page_token`}
|
|
1267
|
+
# to determine if there are more clusters left to be queried.
|
|
1268
|
+
# @param page_token [::String]
|
|
1269
|
+
# Optional. The `next_page_token` value returned from a previous
|
|
1270
|
+
# [ListBackupCollections] request, if any.
|
|
1271
|
+
#
|
|
1272
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
1273
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1::Backup>]
|
|
1274
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
1275
|
+
#
|
|
1276
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1::Backup>]
|
|
1277
|
+
#
|
|
1278
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
1279
|
+
#
|
|
1280
|
+
# @example Basic example
|
|
1281
|
+
# require "google/cloud/memorystore/v1"
|
|
1282
|
+
#
|
|
1283
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1284
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Client.new
|
|
1285
|
+
#
|
|
1286
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1287
|
+
# request = Google::Cloud::Memorystore::V1::ListBackupsRequest.new
|
|
1288
|
+
#
|
|
1289
|
+
# # Call the list_backups method.
|
|
1290
|
+
# result = client.list_backups request
|
|
1291
|
+
#
|
|
1292
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
|
1293
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
|
1294
|
+
# result.each do |item|
|
|
1295
|
+
# # Each element is of type ::Google::Cloud::Memorystore::V1::Backup.
|
|
1296
|
+
# p item
|
|
1297
|
+
# end
|
|
1298
|
+
#
|
|
1299
|
+
def list_backups request, options = nil
|
|
1300
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1301
|
+
|
|
1302
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::ListBackupsRequest
|
|
1303
|
+
|
|
1304
|
+
# Converts hash and nil to an options object
|
|
1305
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1306
|
+
|
|
1307
|
+
# Customize the options with defaults
|
|
1308
|
+
metadata = @config.rpcs.list_backups.metadata.to_h
|
|
1309
|
+
|
|
1310
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1311
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1312
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1313
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION
|
|
1314
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1315
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1316
|
+
|
|
1317
|
+
header_params = {}
|
|
1318
|
+
if request.parent
|
|
1319
|
+
header_params["parent"] = request.parent
|
|
1320
|
+
end
|
|
1321
|
+
|
|
1322
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
1323
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
1324
|
+
|
|
1325
|
+
options.apply_defaults timeout: @config.rpcs.list_backups.timeout,
|
|
1326
|
+
metadata: metadata,
|
|
1327
|
+
retry_policy: @config.rpcs.list_backups.retry_policy
|
|
1328
|
+
|
|
1329
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1330
|
+
metadata: @config.metadata,
|
|
1331
|
+
retry_policy: @config.retry_policy
|
|
1332
|
+
|
|
1333
|
+
@memorystore_stub.call_rpc :list_backups, request, options: options do |response, operation|
|
|
1334
|
+
response = ::Gapic::PagedEnumerable.new @memorystore_stub, :list_backups, request, response, operation, options
|
|
1335
|
+
yield response, operation if block_given?
|
|
1336
|
+
throw :response, response
|
|
1337
|
+
end
|
|
1338
|
+
rescue ::GRPC::BadStatus => e
|
|
1339
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1340
|
+
end
|
|
1341
|
+
|
|
1342
|
+
##
|
|
1343
|
+
# Gets the details of a specific backup.
|
|
1344
|
+
#
|
|
1345
|
+
# @overload get_backup(request, options = nil)
|
|
1346
|
+
# Pass arguments to `get_backup` via a request object, either of type
|
|
1347
|
+
# {::Google::Cloud::Memorystore::V1::GetBackupRequest} or an equivalent Hash.
|
|
1348
|
+
#
|
|
1349
|
+
# @param request [::Google::Cloud::Memorystore::V1::GetBackupRequest, ::Hash]
|
|
1350
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1351
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1352
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1353
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
1354
|
+
#
|
|
1355
|
+
# @overload get_backup(name: nil)
|
|
1356
|
+
# Pass arguments to `get_backup` via keyword arguments. Note that at
|
|
1357
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1358
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1359
|
+
#
|
|
1360
|
+
# @param name [::String]
|
|
1361
|
+
# Required. Instance backup resource name using the form:
|
|
1362
|
+
# `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}`
|
|
1363
|
+
#
|
|
1364
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
1365
|
+
# @yieldparam response [::Google::Cloud::Memorystore::V1::Backup]
|
|
1366
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
1367
|
+
#
|
|
1368
|
+
# @return [::Google::Cloud::Memorystore::V1::Backup]
|
|
1369
|
+
#
|
|
1370
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
1371
|
+
#
|
|
1372
|
+
# @example Basic example
|
|
1373
|
+
# require "google/cloud/memorystore/v1"
|
|
1374
|
+
#
|
|
1375
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1376
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Client.new
|
|
1377
|
+
#
|
|
1378
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1379
|
+
# request = Google::Cloud::Memorystore::V1::GetBackupRequest.new
|
|
1380
|
+
#
|
|
1381
|
+
# # Call the get_backup method.
|
|
1382
|
+
# result = client.get_backup request
|
|
1383
|
+
#
|
|
1384
|
+
# # The returned object is of type Google::Cloud::Memorystore::V1::Backup.
|
|
1385
|
+
# p result
|
|
1386
|
+
#
|
|
1387
|
+
def get_backup request, options = nil
|
|
1388
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1389
|
+
|
|
1390
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::GetBackupRequest
|
|
1391
|
+
|
|
1392
|
+
# Converts hash and nil to an options object
|
|
1393
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1394
|
+
|
|
1395
|
+
# Customize the options with defaults
|
|
1396
|
+
metadata = @config.rpcs.get_backup.metadata.to_h
|
|
1397
|
+
|
|
1398
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1399
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1400
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1401
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION
|
|
1402
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1403
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1404
|
+
|
|
1405
|
+
header_params = {}
|
|
1406
|
+
if request.name
|
|
1407
|
+
header_params["name"] = request.name
|
|
1408
|
+
end
|
|
1409
|
+
|
|
1410
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
1411
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
1412
|
+
|
|
1413
|
+
options.apply_defaults timeout: @config.rpcs.get_backup.timeout,
|
|
1414
|
+
metadata: metadata,
|
|
1415
|
+
retry_policy: @config.rpcs.get_backup.retry_policy
|
|
1416
|
+
|
|
1417
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1418
|
+
metadata: @config.metadata,
|
|
1419
|
+
retry_policy: @config.retry_policy
|
|
1420
|
+
|
|
1421
|
+
@memorystore_stub.call_rpc :get_backup, request, options: options do |response, operation|
|
|
1422
|
+
yield response, operation if block_given?
|
|
1423
|
+
end
|
|
1424
|
+
rescue ::GRPC::BadStatus => e
|
|
1425
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1426
|
+
end
|
|
1427
|
+
|
|
1428
|
+
##
|
|
1429
|
+
# Deletes a specific backup.
|
|
1430
|
+
#
|
|
1431
|
+
# @overload delete_backup(request, options = nil)
|
|
1432
|
+
# Pass arguments to `delete_backup` via a request object, either of type
|
|
1433
|
+
# {::Google::Cloud::Memorystore::V1::DeleteBackupRequest} or an equivalent Hash.
|
|
1434
|
+
#
|
|
1435
|
+
# @param request [::Google::Cloud::Memorystore::V1::DeleteBackupRequest, ::Hash]
|
|
1436
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1437
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1438
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1439
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
1440
|
+
#
|
|
1441
|
+
# @overload delete_backup(name: nil, request_id: nil)
|
|
1442
|
+
# Pass arguments to `delete_backup` via keyword arguments. Note that at
|
|
1443
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1444
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1445
|
+
#
|
|
1446
|
+
# @param name [::String]
|
|
1447
|
+
# Required. Instance backup resource name using the form:
|
|
1448
|
+
# `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}`
|
|
1449
|
+
# @param request_id [::String]
|
|
1450
|
+
# Optional. Idempotent request UUID.
|
|
1451
|
+
#
|
|
1452
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
1453
|
+
# @yieldparam response [::Gapic::Operation]
|
|
1454
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
1455
|
+
#
|
|
1456
|
+
# @return [::Gapic::Operation]
|
|
1457
|
+
#
|
|
1458
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
1459
|
+
#
|
|
1460
|
+
# @example Basic example
|
|
1461
|
+
# require "google/cloud/memorystore/v1"
|
|
1462
|
+
#
|
|
1463
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1464
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Client.new
|
|
1465
|
+
#
|
|
1466
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1467
|
+
# request = Google::Cloud::Memorystore::V1::DeleteBackupRequest.new
|
|
1468
|
+
#
|
|
1469
|
+
# # Call the delete_backup method.
|
|
1470
|
+
# result = client.delete_backup request
|
|
1471
|
+
#
|
|
1472
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
1473
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
1474
|
+
# # Here is how to wait for a response.
|
|
1475
|
+
# result.wait_until_done! timeout: 60
|
|
1476
|
+
# if result.response?
|
|
1477
|
+
# p result.response
|
|
1478
|
+
# else
|
|
1479
|
+
# puts "No response received."
|
|
1480
|
+
# end
|
|
1481
|
+
#
|
|
1482
|
+
def delete_backup request, options = nil
|
|
1483
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1484
|
+
|
|
1485
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::DeleteBackupRequest
|
|
1486
|
+
|
|
1487
|
+
# Converts hash and nil to an options object
|
|
1488
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1489
|
+
|
|
1490
|
+
# Customize the options with defaults
|
|
1491
|
+
metadata = @config.rpcs.delete_backup.metadata.to_h
|
|
1492
|
+
|
|
1493
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1494
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1495
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1496
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION
|
|
1497
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1498
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1499
|
+
|
|
1500
|
+
header_params = {}
|
|
1501
|
+
if request.name
|
|
1502
|
+
header_params["name"] = request.name
|
|
1503
|
+
end
|
|
1504
|
+
|
|
1505
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
1506
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
1507
|
+
|
|
1508
|
+
options.apply_defaults timeout: @config.rpcs.delete_backup.timeout,
|
|
1509
|
+
metadata: metadata,
|
|
1510
|
+
retry_policy: @config.rpcs.delete_backup.retry_policy
|
|
1511
|
+
|
|
1512
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1513
|
+
metadata: @config.metadata,
|
|
1514
|
+
retry_policy: @config.retry_policy
|
|
1515
|
+
|
|
1516
|
+
@memorystore_stub.call_rpc :delete_backup, request, options: options do |response, operation|
|
|
1517
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
|
1518
|
+
yield response, operation if block_given?
|
|
1519
|
+
throw :response, response
|
|
1520
|
+
end
|
|
1521
|
+
rescue ::GRPC::BadStatus => e
|
|
1522
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1523
|
+
end
|
|
1524
|
+
|
|
1525
|
+
##
|
|
1526
|
+
# Exports a specific backup to a customer target Cloud Storage URI.
|
|
1527
|
+
#
|
|
1528
|
+
# @overload export_backup(request, options = nil)
|
|
1529
|
+
# Pass arguments to `export_backup` via a request object, either of type
|
|
1530
|
+
# {::Google::Cloud::Memorystore::V1::ExportBackupRequest} or an equivalent Hash.
|
|
1531
|
+
#
|
|
1532
|
+
# @param request [::Google::Cloud::Memorystore::V1::ExportBackupRequest, ::Hash]
|
|
1533
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1534
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1535
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1536
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
1537
|
+
#
|
|
1538
|
+
# @overload export_backup(gcs_bucket: nil, name: nil)
|
|
1539
|
+
# Pass arguments to `export_backup` via keyword arguments. Note that at
|
|
1540
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1541
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1542
|
+
#
|
|
1543
|
+
# @param gcs_bucket [::String]
|
|
1544
|
+
# Google Cloud Storage bucket, like "my-bucket".
|
|
1545
|
+
# @param name [::String]
|
|
1546
|
+
# Required. Instance backup resource name using the form:
|
|
1547
|
+
# `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}`
|
|
1548
|
+
#
|
|
1549
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
1550
|
+
# @yieldparam response [::Gapic::Operation]
|
|
1551
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
1552
|
+
#
|
|
1553
|
+
# @return [::Gapic::Operation]
|
|
1554
|
+
#
|
|
1555
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
1556
|
+
#
|
|
1557
|
+
# @example Basic example
|
|
1558
|
+
# require "google/cloud/memorystore/v1"
|
|
1559
|
+
#
|
|
1560
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1561
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Client.new
|
|
1562
|
+
#
|
|
1563
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1564
|
+
# request = Google::Cloud::Memorystore::V1::ExportBackupRequest.new
|
|
1565
|
+
#
|
|
1566
|
+
# # Call the export_backup method.
|
|
1567
|
+
# result = client.export_backup request
|
|
1568
|
+
#
|
|
1569
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
1570
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
1571
|
+
# # Here is how to wait for a response.
|
|
1572
|
+
# result.wait_until_done! timeout: 60
|
|
1573
|
+
# if result.response?
|
|
1574
|
+
# p result.response
|
|
1575
|
+
# else
|
|
1576
|
+
# puts "No response received."
|
|
1577
|
+
# end
|
|
1578
|
+
#
|
|
1579
|
+
def export_backup request, options = nil
|
|
1580
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1581
|
+
|
|
1582
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::ExportBackupRequest
|
|
1583
|
+
|
|
1584
|
+
# Converts hash and nil to an options object
|
|
1585
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1586
|
+
|
|
1587
|
+
# Customize the options with defaults
|
|
1588
|
+
metadata = @config.rpcs.export_backup.metadata.to_h
|
|
1589
|
+
|
|
1590
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1591
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1592
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1593
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION
|
|
1594
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1595
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1596
|
+
|
|
1597
|
+
header_params = {}
|
|
1598
|
+
if request.name
|
|
1599
|
+
header_params["name"] = request.name
|
|
1600
|
+
end
|
|
1601
|
+
|
|
1602
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
1603
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
1604
|
+
|
|
1605
|
+
options.apply_defaults timeout: @config.rpcs.export_backup.timeout,
|
|
1606
|
+
metadata: metadata,
|
|
1607
|
+
retry_policy: @config.rpcs.export_backup.retry_policy
|
|
1608
|
+
|
|
1609
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1610
|
+
metadata: @config.metadata,
|
|
1611
|
+
retry_policy: @config.retry_policy
|
|
1612
|
+
|
|
1613
|
+
@memorystore_stub.call_rpc :export_backup, request, options: options do |response, operation|
|
|
1614
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
|
1615
|
+
yield response, operation if block_given?
|
|
1616
|
+
throw :response, response
|
|
1617
|
+
end
|
|
1618
|
+
rescue ::GRPC::BadStatus => e
|
|
1619
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1620
|
+
end
|
|
1621
|
+
|
|
1622
|
+
##
|
|
1623
|
+
# Backup Instance.
|
|
1624
|
+
# If this is the first time a backup is being created, a backup collection
|
|
1625
|
+
# will be created at the backend, and this backup belongs to this collection.
|
|
1626
|
+
# Both collection and backup will have a resource name. Backup will be
|
|
1627
|
+
# executed for each shard. A replica (primary if nonHA) will be selected to
|
|
1628
|
+
# perform the execution. Backup call will be rejected if there is an ongoing
|
|
1629
|
+
# backup or update operation. Be aware that during preview, if the instance's
|
|
1630
|
+
# internal software version is too old, critical update will be performed
|
|
1631
|
+
# before actual backup. Once the internal software version is updated to the
|
|
1632
|
+
# minimum version required by the backup feature, subsequent backups will not
|
|
1633
|
+
# require critical update. After preview, there will be no critical update
|
|
1634
|
+
# needed for backup.
|
|
1635
|
+
#
|
|
1636
|
+
# @overload backup_instance(request, options = nil)
|
|
1637
|
+
# Pass arguments to `backup_instance` via a request object, either of type
|
|
1638
|
+
# {::Google::Cloud::Memorystore::V1::BackupInstanceRequest} or an equivalent Hash.
|
|
1639
|
+
#
|
|
1640
|
+
# @param request [::Google::Cloud::Memorystore::V1::BackupInstanceRequest, ::Hash]
|
|
1641
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1642
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1643
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1644
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
1645
|
+
#
|
|
1646
|
+
# @overload backup_instance(name: nil, ttl: nil, backup_id: nil)
|
|
1647
|
+
# Pass arguments to `backup_instance` via keyword arguments. Note that at
|
|
1648
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1649
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1650
|
+
#
|
|
1651
|
+
# @param name [::String]
|
|
1652
|
+
# Required. Instance resource name using the form:
|
|
1653
|
+
# `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
|
|
1654
|
+
# where `location_id` refers to a Google Cloud region.
|
|
1655
|
+
# @param ttl [::Google::Protobuf::Duration, ::Hash]
|
|
1656
|
+
# Optional. TTL for the backup to expire. Value range is 1 day to 100 years.
|
|
1657
|
+
# If not specified, the default value is 100 years.
|
|
1658
|
+
# @param backup_id [::String]
|
|
1659
|
+
# Optional. The id of the backup to be created. If not specified, the
|
|
1660
|
+
# default value ([YYYYMMDDHHMMSS]_[Shortened Instance UID] is used.
|
|
1661
|
+
#
|
|
1662
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
1663
|
+
# @yieldparam response [::Gapic::Operation]
|
|
1664
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
1665
|
+
#
|
|
1666
|
+
# @return [::Gapic::Operation]
|
|
1667
|
+
#
|
|
1668
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
1669
|
+
#
|
|
1670
|
+
# @example Basic example
|
|
1671
|
+
# require "google/cloud/memorystore/v1"
|
|
1672
|
+
#
|
|
1673
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1674
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Client.new
|
|
1675
|
+
#
|
|
1676
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1677
|
+
# request = Google::Cloud::Memorystore::V1::BackupInstanceRequest.new
|
|
1678
|
+
#
|
|
1679
|
+
# # Call the backup_instance method.
|
|
1680
|
+
# result = client.backup_instance request
|
|
1681
|
+
#
|
|
1682
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
1683
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
1684
|
+
# # Here is how to wait for a response.
|
|
1685
|
+
# result.wait_until_done! timeout: 60
|
|
1686
|
+
# if result.response?
|
|
1687
|
+
# p result.response
|
|
1688
|
+
# else
|
|
1689
|
+
# puts "No response received."
|
|
1690
|
+
# end
|
|
1691
|
+
#
|
|
1692
|
+
def backup_instance request, options = nil
|
|
1693
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1694
|
+
|
|
1695
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::BackupInstanceRequest
|
|
1696
|
+
|
|
1697
|
+
# Converts hash and nil to an options object
|
|
1698
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1699
|
+
|
|
1700
|
+
# Customize the options with defaults
|
|
1701
|
+
metadata = @config.rpcs.backup_instance.metadata.to_h
|
|
1702
|
+
|
|
1703
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1704
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1705
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1706
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION
|
|
1707
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1708
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1709
|
+
|
|
1710
|
+
header_params = {}
|
|
1711
|
+
if request.name
|
|
1712
|
+
header_params["name"] = request.name
|
|
1713
|
+
end
|
|
1714
|
+
|
|
1715
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
1716
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
1717
|
+
|
|
1718
|
+
options.apply_defaults timeout: @config.rpcs.backup_instance.timeout,
|
|
1719
|
+
metadata: metadata,
|
|
1720
|
+
retry_policy: @config.rpcs.backup_instance.retry_policy
|
|
1721
|
+
|
|
1722
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1723
|
+
metadata: @config.metadata,
|
|
1724
|
+
retry_policy: @config.retry_policy
|
|
1725
|
+
|
|
1726
|
+
@memorystore_stub.call_rpc :backup_instance, request, options: options do |response, operation|
|
|
1727
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
|
1728
|
+
yield response, operation if block_given?
|
|
1729
|
+
throw :response, response
|
|
1730
|
+
end
|
|
1731
|
+
rescue ::GRPC::BadStatus => e
|
|
1732
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1733
|
+
end
|
|
1734
|
+
|
|
1735
|
+
##
|
|
1736
|
+
# Configuration class for the Memorystore API.
|
|
1737
|
+
#
|
|
1738
|
+
# This class represents the configuration for Memorystore,
|
|
1739
|
+
# providing control over timeouts, retry behavior, logging, transport
|
|
1740
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
|
1741
|
+
# applied individually to specific RPCs. See
|
|
1742
|
+
# {::Google::Cloud::Memorystore::V1::Memorystore::Client::Configuration::Rpcs}
|
|
1743
|
+
# for a list of RPCs that can be configured independently.
|
|
1744
|
+
#
|
|
1745
|
+
# Configuration can be applied globally to all clients, or to a single client
|
|
1746
|
+
# on construction.
|
|
1747
|
+
#
|
|
1748
|
+
# @example
|
|
1749
|
+
#
|
|
1750
|
+
# # Modify the global config, setting the timeout for
|
|
1751
|
+
# # list_instances to 20 seconds,
|
|
1752
|
+
# # and all remaining timeouts to 10 seconds.
|
|
1753
|
+
# ::Google::Cloud::Memorystore::V1::Memorystore::Client.configure do |config|
|
|
1754
|
+
# config.timeout = 10.0
|
|
1755
|
+
# config.rpcs.list_instances.timeout = 20.0
|
|
1756
|
+
# end
|
|
1757
|
+
#
|
|
1758
|
+
# # Apply the above configuration only to a new client.
|
|
1759
|
+
# client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config|
|
|
1760
|
+
# config.timeout = 10.0
|
|
1761
|
+
# config.rpcs.list_instances.timeout = 20.0
|
|
1762
|
+
# end
|
|
1763
|
+
#
|
|
1764
|
+
# @!attribute [rw] endpoint
|
|
1765
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
|
1766
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
|
1767
|
+
# @return [::String,nil]
|
|
1768
|
+
# @!attribute [rw] credentials
|
|
1769
|
+
# Credentials to send with calls. You may provide any of the following types:
|
|
1770
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
|
1771
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
|
1772
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
|
1773
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
|
1774
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
|
1775
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
|
1776
|
+
# * (`nil`) indicating no credentials
|
|
1777
|
+
#
|
|
1778
|
+
# @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
|
|
1779
|
+
# is deprecated. Providing an unvalidated credential configuration to
|
|
1780
|
+
# Google APIs can compromise the security of your systems and data.
|
|
1781
|
+
#
|
|
1782
|
+
# @example
|
|
1783
|
+
#
|
|
1784
|
+
# # The recommended way to provide credentials is to use the `make_creds` method
|
|
1785
|
+
# # on the appropriate credentials class for your environment.
|
|
1786
|
+
#
|
|
1787
|
+
# require "googleauth"
|
|
1788
|
+
#
|
|
1789
|
+
# credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
|
|
1790
|
+
# json_key_io: ::File.open("/path/to/keyfile.json")
|
|
1791
|
+
# )
|
|
1792
|
+
#
|
|
1793
|
+
# client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config|
|
|
1794
|
+
# config.credentials = credentials
|
|
1795
|
+
# end
|
|
1796
|
+
#
|
|
1797
|
+
# @note Warning: If you accept a credential configuration (JSON file or Hash) from an
|
|
1798
|
+
# external source for authentication to Google Cloud, you must validate it before
|
|
1799
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
|
1800
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
|
1801
|
+
# For more information, refer to [Validate credential configurations from external
|
|
1802
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
|
1803
|
+
# @return [::Object]
|
|
1804
|
+
# @!attribute [rw] scope
|
|
1805
|
+
# The OAuth scopes
|
|
1806
|
+
# @return [::Array<::String>]
|
|
1807
|
+
# @!attribute [rw] lib_name
|
|
1808
|
+
# The library name as recorded in instrumentation and logging
|
|
1809
|
+
# @return [::String]
|
|
1810
|
+
# @!attribute [rw] lib_version
|
|
1811
|
+
# The library version as recorded in instrumentation and logging
|
|
1812
|
+
# @return [::String]
|
|
1813
|
+
# @!attribute [rw] channel_args
|
|
1814
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
|
1815
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
|
1816
|
+
# @return [::Hash]
|
|
1817
|
+
# @!attribute [rw] interceptors
|
|
1818
|
+
# An array of interceptors that are run before calls are executed.
|
|
1819
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
|
1820
|
+
# @!attribute [rw] timeout
|
|
1821
|
+
# The call timeout in seconds.
|
|
1822
|
+
# @return [::Numeric]
|
|
1823
|
+
# @!attribute [rw] metadata
|
|
1824
|
+
# Additional gRPC headers to be sent with the call.
|
|
1825
|
+
# @return [::Hash{::Symbol=>::String}]
|
|
1826
|
+
# @!attribute [rw] retry_policy
|
|
1827
|
+
# The retry policy. The value is a hash with the following keys:
|
|
1828
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
|
1829
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
|
1830
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
|
1831
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
|
1832
|
+
# trigger a retry.
|
|
1833
|
+
# @return [::Hash]
|
|
1834
|
+
# @!attribute [rw] quota_project
|
|
1835
|
+
# A separate project against which to charge quota.
|
|
1836
|
+
# @return [::String]
|
|
1837
|
+
# @!attribute [rw] universe_domain
|
|
1838
|
+
# The universe domain within which to make requests. This determines the
|
|
1839
|
+
# default endpoint URL. The default value of nil uses the environment
|
|
1840
|
+
# universe (usually the default "googleapis.com" universe).
|
|
1841
|
+
# @return [::String,nil]
|
|
1842
|
+
# @!attribute [rw] logger
|
|
1843
|
+
# A custom logger to use for request/response debug logging, or the value
|
|
1844
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
|
1845
|
+
# explicitly disable logging.
|
|
1846
|
+
# @return [::Logger,:default,nil]
|
|
1847
|
+
#
|
|
1848
|
+
class Configuration
|
|
1849
|
+
extend ::Gapic::Config
|
|
1850
|
+
|
|
1851
|
+
# @private
|
|
1852
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
|
1853
|
+
DEFAULT_ENDPOINT = "memorystore.googleapis.com"
|
|
1854
|
+
|
|
1855
|
+
config_attr :endpoint, nil, ::String, nil
|
|
1856
|
+
config_attr :credentials, nil do |value|
|
|
1857
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
|
|
1858
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
|
|
1859
|
+
allowed.any? { |klass| klass === value }
|
|
1860
|
+
end
|
|
1861
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
|
1862
|
+
config_attr :lib_name, nil, ::String, nil
|
|
1863
|
+
config_attr :lib_version, nil, ::String, nil
|
|
1864
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
|
1865
|
+
config_attr :interceptors, nil, ::Array, nil
|
|
1866
|
+
config_attr :timeout, nil, ::Numeric, nil
|
|
1867
|
+
config_attr :metadata, nil, ::Hash, nil
|
|
1868
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
|
1869
|
+
config_attr :quota_project, nil, ::String, nil
|
|
1870
|
+
config_attr :universe_domain, nil, ::String, nil
|
|
1871
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
|
1872
|
+
|
|
1873
|
+
# @private
|
|
1874
|
+
def initialize parent_config = nil
|
|
1875
|
+
@parent_config = parent_config unless parent_config.nil?
|
|
1876
|
+
|
|
1877
|
+
yield self if block_given?
|
|
1878
|
+
end
|
|
1879
|
+
|
|
1880
|
+
##
|
|
1881
|
+
# Configurations for individual RPCs
|
|
1882
|
+
# @return [Rpcs]
|
|
1883
|
+
#
|
|
1884
|
+
def rpcs
|
|
1885
|
+
@rpcs ||= begin
|
|
1886
|
+
parent_rpcs = nil
|
|
1887
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
|
1888
|
+
Rpcs.new parent_rpcs
|
|
1889
|
+
end
|
|
1890
|
+
end
|
|
1891
|
+
|
|
1892
|
+
##
|
|
1893
|
+
# Configuration for the channel pool
|
|
1894
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
|
1895
|
+
#
|
|
1896
|
+
def channel_pool
|
|
1897
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
|
1898
|
+
end
|
|
1899
|
+
|
|
1900
|
+
##
|
|
1901
|
+
# Configuration RPC class for the Memorystore API.
|
|
1902
|
+
#
|
|
1903
|
+
# Includes fields providing the configuration for each RPC in this service.
|
|
1904
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
|
1905
|
+
# the following configuration fields:
|
|
1906
|
+
#
|
|
1907
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
|
1908
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
|
1909
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
|
1910
|
+
# include the following keys:
|
|
1911
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
|
1912
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
|
1913
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
|
1914
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
|
1915
|
+
# trigger a retry.
|
|
1916
|
+
#
|
|
1917
|
+
class Rpcs
|
|
1918
|
+
##
|
|
1919
|
+
# RPC-specific configuration for `list_instances`
|
|
1920
|
+
# @return [::Gapic::Config::Method]
|
|
1921
|
+
#
|
|
1922
|
+
attr_reader :list_instances
|
|
1923
|
+
##
|
|
1924
|
+
# RPC-specific configuration for `get_instance`
|
|
1925
|
+
# @return [::Gapic::Config::Method]
|
|
1926
|
+
#
|
|
1927
|
+
attr_reader :get_instance
|
|
1928
|
+
##
|
|
1929
|
+
# RPC-specific configuration for `create_instance`
|
|
1930
|
+
# @return [::Gapic::Config::Method]
|
|
1931
|
+
#
|
|
1932
|
+
attr_reader :create_instance
|
|
1933
|
+
##
|
|
1934
|
+
# RPC-specific configuration for `update_instance`
|
|
1935
|
+
# @return [::Gapic::Config::Method]
|
|
1936
|
+
#
|
|
1937
|
+
attr_reader :update_instance
|
|
1938
|
+
##
|
|
1939
|
+
# RPC-specific configuration for `delete_instance`
|
|
1940
|
+
# @return [::Gapic::Config::Method]
|
|
1941
|
+
#
|
|
1942
|
+
attr_reader :delete_instance
|
|
1943
|
+
##
|
|
1944
|
+
# RPC-specific configuration for `get_certificate_authority`
|
|
1945
|
+
# @return [::Gapic::Config::Method]
|
|
1946
|
+
#
|
|
1947
|
+
attr_reader :get_certificate_authority
|
|
1948
|
+
##
|
|
1949
|
+
# RPC-specific configuration for `get_shared_regional_certificate_authority`
|
|
1950
|
+
# @return [::Gapic::Config::Method]
|
|
1951
|
+
#
|
|
1952
|
+
attr_reader :get_shared_regional_certificate_authority
|
|
1953
|
+
##
|
|
1954
|
+
# RPC-specific configuration for `reschedule_maintenance`
|
|
1955
|
+
# @return [::Gapic::Config::Method]
|
|
1956
|
+
#
|
|
1957
|
+
attr_reader :reschedule_maintenance
|
|
1958
|
+
##
|
|
1959
|
+
# RPC-specific configuration for `list_backup_collections`
|
|
1960
|
+
# @return [::Gapic::Config::Method]
|
|
1961
|
+
#
|
|
1962
|
+
attr_reader :list_backup_collections
|
|
1963
|
+
##
|
|
1964
|
+
# RPC-specific configuration for `get_backup_collection`
|
|
1965
|
+
# @return [::Gapic::Config::Method]
|
|
1966
|
+
#
|
|
1967
|
+
attr_reader :get_backup_collection
|
|
1968
|
+
##
|
|
1969
|
+
# RPC-specific configuration for `list_backups`
|
|
1970
|
+
# @return [::Gapic::Config::Method]
|
|
1971
|
+
#
|
|
1972
|
+
attr_reader :list_backups
|
|
1973
|
+
##
|
|
1974
|
+
# RPC-specific configuration for `get_backup`
|
|
1975
|
+
# @return [::Gapic::Config::Method]
|
|
1976
|
+
#
|
|
1977
|
+
attr_reader :get_backup
|
|
1978
|
+
##
|
|
1979
|
+
# RPC-specific configuration for `delete_backup`
|
|
1980
|
+
# @return [::Gapic::Config::Method]
|
|
1981
|
+
#
|
|
1982
|
+
attr_reader :delete_backup
|
|
1983
|
+
##
|
|
1984
|
+
# RPC-specific configuration for `export_backup`
|
|
1985
|
+
# @return [::Gapic::Config::Method]
|
|
1986
|
+
#
|
|
1987
|
+
attr_reader :export_backup
|
|
1988
|
+
##
|
|
1989
|
+
# RPC-specific configuration for `backup_instance`
|
|
1990
|
+
# @return [::Gapic::Config::Method]
|
|
1991
|
+
#
|
|
1992
|
+
attr_reader :backup_instance
|
|
1993
|
+
|
|
1994
|
+
# @private
|
|
1995
|
+
def initialize parent_rpcs = nil
|
|
1996
|
+
list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
|
|
1997
|
+
@list_instances = ::Gapic::Config::Method.new list_instances_config
|
|
1998
|
+
get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
|
|
1999
|
+
@get_instance = ::Gapic::Config::Method.new get_instance_config
|
|
2000
|
+
create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
|
|
2001
|
+
@create_instance = ::Gapic::Config::Method.new create_instance_config
|
|
2002
|
+
update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance
|
|
2003
|
+
@update_instance = ::Gapic::Config::Method.new update_instance_config
|
|
2004
|
+
delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
|
|
2005
|
+
@delete_instance = ::Gapic::Config::Method.new delete_instance_config
|
|
2006
|
+
get_certificate_authority_config = parent_rpcs.get_certificate_authority if parent_rpcs.respond_to? :get_certificate_authority
|
|
2007
|
+
@get_certificate_authority = ::Gapic::Config::Method.new get_certificate_authority_config
|
|
2008
|
+
get_shared_regional_certificate_authority_config = parent_rpcs.get_shared_regional_certificate_authority if parent_rpcs.respond_to? :get_shared_regional_certificate_authority
|
|
2009
|
+
@get_shared_regional_certificate_authority = ::Gapic::Config::Method.new get_shared_regional_certificate_authority_config
|
|
2010
|
+
reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance
|
|
2011
|
+
@reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config
|
|
2012
|
+
list_backup_collections_config = parent_rpcs.list_backup_collections if parent_rpcs.respond_to? :list_backup_collections
|
|
2013
|
+
@list_backup_collections = ::Gapic::Config::Method.new list_backup_collections_config
|
|
2014
|
+
get_backup_collection_config = parent_rpcs.get_backup_collection if parent_rpcs.respond_to? :get_backup_collection
|
|
2015
|
+
@get_backup_collection = ::Gapic::Config::Method.new get_backup_collection_config
|
|
2016
|
+
list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
|
|
2017
|
+
@list_backups = ::Gapic::Config::Method.new list_backups_config
|
|
2018
|
+
get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
|
|
2019
|
+
@get_backup = ::Gapic::Config::Method.new get_backup_config
|
|
2020
|
+
delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup
|
|
2021
|
+
@delete_backup = ::Gapic::Config::Method.new delete_backup_config
|
|
2022
|
+
export_backup_config = parent_rpcs.export_backup if parent_rpcs.respond_to? :export_backup
|
|
2023
|
+
@export_backup = ::Gapic::Config::Method.new export_backup_config
|
|
2024
|
+
backup_instance_config = parent_rpcs.backup_instance if parent_rpcs.respond_to? :backup_instance
|
|
2025
|
+
@backup_instance = ::Gapic::Config::Method.new backup_instance_config
|
|
2026
|
+
|
|
2027
|
+
yield self if block_given?
|
|
2028
|
+
end
|
|
2029
|
+
end
|
|
2030
|
+
end
|
|
2031
|
+
end
|
|
2032
|
+
end
|
|
2033
|
+
end
|
|
2034
|
+
end
|
|
2035
|
+
end
|
|
2036
|
+
end
|