google-cloud-redis-cluster-v1beta1 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +122 -0
- data/LICENSE.md +201 -0
- data/README.md +144 -0
- data/lib/google/cloud/redis/cluster/v1beta1/bindings_override.rb +104 -0
- data/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb +1048 -0
- data/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials.rb +49 -0
- data/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations.rb +811 -0
- data/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths.rb +90 -0
- data/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client.rb +987 -0
- data/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations.rb +903 -0
- data/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub.rb +427 -0
- data/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest.rb +76 -0
- data/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb +78 -0
- data/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb.rb +84 -0
- data/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb.rb +97 -0
- data/lib/google/cloud/redis/cluster/v1beta1/rest.rb +40 -0
- data/lib/google/cloud/redis/cluster/v1beta1/version.rb +30 -0
- data/lib/google/cloud/redis/cluster/v1beta1.rb +47 -0
- data/lib/google-cloud-redis-cluster-v1beta1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +399 -0
- data/proto_docs/google/api/field_behavior.rb +85 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +222 -0
- data/proto_docs/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb +564 -0
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/protobuf/any.rb +145 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +34 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +127 -0
- data/proto_docs/google/rpc/status.rb +48 -0
- metadata +132 -0
@@ -0,0 +1,1048 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2024 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb"
|
21
|
+
require "google/cloud/location"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module Redis
|
26
|
+
module Cluster
|
27
|
+
module V1beta1
|
28
|
+
module CloudRedisCluster
|
29
|
+
##
|
30
|
+
# Client for the CloudRedisCluster service.
|
31
|
+
#
|
32
|
+
# Configures and manages Cloud Memorystore for Redis clusters
|
33
|
+
#
|
34
|
+
# Google Cloud Memorystore for Redis Cluster
|
35
|
+
#
|
36
|
+
# The `redis.googleapis.com` service implements the Google Cloud Memorystore
|
37
|
+
# for Redis API and defines the following resource model for managing Redis
|
38
|
+
# clusters:
|
39
|
+
# * The service works with a collection of cloud projects, named: `/projects/*`
|
40
|
+
# * Each project has a collection of available locations, named: `/locations/*`
|
41
|
+
# * Each location has a collection of Redis clusters, named: `/clusters/*`
|
42
|
+
# * As such, Redis clusters are resources of the form:
|
43
|
+
# `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}`
|
44
|
+
#
|
45
|
+
# Note that location_id must be a GCP `region`; for example:
|
46
|
+
# * `projects/redpepper-1290/locations/us-central1/clusters/my-redis`
|
47
|
+
#
|
48
|
+
# We use API version selector for Flex APIs
|
49
|
+
# * The versioning strategy is release-based versioning
|
50
|
+
# * Our backend CLH only deals with the superset version (called v1main)
|
51
|
+
# * Existing backend for Redis Gen1 and MRR is not touched.
|
52
|
+
# * More details in go/redis-flex-api-versioning
|
53
|
+
#
|
54
|
+
class Client
|
55
|
+
# @private
|
56
|
+
API_VERSION = ""
|
57
|
+
|
58
|
+
# @private
|
59
|
+
DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$"
|
60
|
+
|
61
|
+
include Paths
|
62
|
+
|
63
|
+
# @private
|
64
|
+
attr_reader :cloud_redis_cluster_stub
|
65
|
+
|
66
|
+
##
|
67
|
+
# Configure the CloudRedisCluster Client class.
|
68
|
+
#
|
69
|
+
# See {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client::Configuration}
|
70
|
+
# for a description of the configuration fields.
|
71
|
+
#
|
72
|
+
# @example
|
73
|
+
#
|
74
|
+
# # Modify the configuration for all CloudRedisCluster clients
|
75
|
+
# ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.configure do |config|
|
76
|
+
# config.timeout = 10.0
|
77
|
+
# end
|
78
|
+
#
|
79
|
+
# @yield [config] Configure the Client client.
|
80
|
+
# @yieldparam config [Client::Configuration]
|
81
|
+
#
|
82
|
+
# @return [Client::Configuration]
|
83
|
+
#
|
84
|
+
def self.configure
|
85
|
+
@configure ||= begin
|
86
|
+
namespace = ["Google", "Cloud", "Redis", "Cluster", "V1beta1"]
|
87
|
+
parent_config = while namespace.any?
|
88
|
+
parent_name = namespace.join "::"
|
89
|
+
parent_const = const_get parent_name
|
90
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
91
|
+
namespace.pop
|
92
|
+
end
|
93
|
+
default_config = Client::Configuration.new parent_config
|
94
|
+
|
95
|
+
default_config.rpcs.list_clusters.timeout = 600.0
|
96
|
+
|
97
|
+
default_config.rpcs.get_cluster.timeout = 600.0
|
98
|
+
|
99
|
+
default_config.rpcs.update_cluster.timeout = 600.0
|
100
|
+
|
101
|
+
default_config.rpcs.delete_cluster.timeout = 600.0
|
102
|
+
|
103
|
+
default_config.rpcs.create_cluster.timeout = 600.0
|
104
|
+
|
105
|
+
default_config.rpcs.get_cluster_certificate_authority.timeout = 600.0
|
106
|
+
|
107
|
+
default_config
|
108
|
+
end
|
109
|
+
yield @configure if block_given?
|
110
|
+
@configure
|
111
|
+
end
|
112
|
+
|
113
|
+
##
|
114
|
+
# Configure the CloudRedisCluster Client instance.
|
115
|
+
#
|
116
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
117
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
118
|
+
# should be made on {Client.configure}.
|
119
|
+
#
|
120
|
+
# See {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client::Configuration}
|
121
|
+
# for a description of the configuration fields.
|
122
|
+
#
|
123
|
+
# @yield [config] Configure the Client client.
|
124
|
+
# @yieldparam config [Client::Configuration]
|
125
|
+
#
|
126
|
+
# @return [Client::Configuration]
|
127
|
+
#
|
128
|
+
def configure
|
129
|
+
yield @config if block_given?
|
130
|
+
@config
|
131
|
+
end
|
132
|
+
|
133
|
+
##
|
134
|
+
# The effective universe domain
|
135
|
+
#
|
136
|
+
# @return [String]
|
137
|
+
#
|
138
|
+
def universe_domain
|
139
|
+
@cloud_redis_cluster_stub.universe_domain
|
140
|
+
end
|
141
|
+
|
142
|
+
##
|
143
|
+
# Create a new CloudRedisCluster client object.
|
144
|
+
#
|
145
|
+
# @example
|
146
|
+
#
|
147
|
+
# # Create a client using the default configuration
|
148
|
+
# client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new
|
149
|
+
#
|
150
|
+
# # Create a client using a custom configuration
|
151
|
+
# client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config|
|
152
|
+
# config.timeout = 10.0
|
153
|
+
# end
|
154
|
+
#
|
155
|
+
# @yield [config] Configure the CloudRedisCluster client.
|
156
|
+
# @yieldparam config [Client::Configuration]
|
157
|
+
#
|
158
|
+
def initialize
|
159
|
+
# These require statements are intentionally placed here to initialize
|
160
|
+
# the gRPC module only when it's required.
|
161
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
162
|
+
require "gapic/grpc"
|
163
|
+
require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb"
|
164
|
+
|
165
|
+
# Create the configuration object
|
166
|
+
@config = Configuration.new Client.configure
|
167
|
+
|
168
|
+
# Yield the configuration if needed
|
169
|
+
yield @config if block_given?
|
170
|
+
|
171
|
+
# Create credentials
|
172
|
+
credentials = @config.credentials
|
173
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
174
|
+
# but only if the default endpoint does not have a region prefix.
|
175
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
176
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
177
|
+
!@config.endpoint.split(".").first.include?("-"))
|
178
|
+
credentials ||= Credentials.default scope: @config.scope,
|
179
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
180
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
181
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
182
|
+
end
|
183
|
+
@quota_project_id = @config.quota_project
|
184
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
185
|
+
|
186
|
+
@operations_client = Operations.new do |config|
|
187
|
+
config.credentials = credentials
|
188
|
+
config.quota_project = @quota_project_id
|
189
|
+
config.endpoint = @config.endpoint
|
190
|
+
config.universe_domain = @config.universe_domain
|
191
|
+
end
|
192
|
+
|
193
|
+
@cloud_redis_cluster_stub = ::Gapic::ServiceStub.new(
|
194
|
+
::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Stub,
|
195
|
+
credentials: credentials,
|
196
|
+
endpoint: @config.endpoint,
|
197
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
198
|
+
universe_domain: @config.universe_domain,
|
199
|
+
channel_args: @config.channel_args,
|
200
|
+
interceptors: @config.interceptors,
|
201
|
+
channel_pool_config: @config.channel_pool
|
202
|
+
)
|
203
|
+
|
204
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
205
|
+
config.credentials = credentials
|
206
|
+
config.quota_project = @quota_project_id
|
207
|
+
config.endpoint = @cloud_redis_cluster_stub.endpoint
|
208
|
+
config.universe_domain = @cloud_redis_cluster_stub.universe_domain
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
##
|
213
|
+
# Get the associated client for long-running operations.
|
214
|
+
#
|
215
|
+
# @return [::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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
|
+
# Service calls
|
227
|
+
|
228
|
+
##
|
229
|
+
# Lists all Redis clusters owned by a project in either the specified
|
230
|
+
# location (region) or all locations.
|
231
|
+
#
|
232
|
+
# The location should have the following format:
|
233
|
+
#
|
234
|
+
# * `projects/{project_id}/locations/{location_id}`
|
235
|
+
#
|
236
|
+
# If `location_id` is specified as `-` (wildcard), then all regions
|
237
|
+
# available to the project are queried, and the results are aggregated.
|
238
|
+
#
|
239
|
+
# @overload list_clusters(request, options = nil)
|
240
|
+
# Pass arguments to `list_clusters` via a request object, either of type
|
241
|
+
# {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest} or an equivalent Hash.
|
242
|
+
#
|
243
|
+
# @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest, ::Hash]
|
244
|
+
# A request object representing the call parameters. Required. To specify no
|
245
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
246
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
247
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
248
|
+
#
|
249
|
+
# @overload list_clusters(parent: nil, page_size: nil, page_token: nil)
|
250
|
+
# Pass arguments to `list_clusters` via keyword arguments. Note that at
|
251
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
252
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
253
|
+
#
|
254
|
+
# @param parent [::String]
|
255
|
+
# Required. The resource name of the cluster location using the form:
|
256
|
+
# `projects/{project_id}/locations/{location_id}`
|
257
|
+
# where `location_id` refers to a GCP region.
|
258
|
+
# @param page_size [::Integer]
|
259
|
+
# The maximum number of items to return.
|
260
|
+
#
|
261
|
+
# If not specified, a default value of 1000 will be used by the service.
|
262
|
+
# Regardless of the page_size value, the response may include a partial list
|
263
|
+
# and a caller should only rely on response's
|
264
|
+
# {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse#next_page_token `next_page_token`}
|
265
|
+
# to determine if there are more clusters left to be queried.
|
266
|
+
# @param page_token [::String]
|
267
|
+
# The `next_page_token` value returned from a previous
|
268
|
+
# [ListClusters][CloudRedis.ListClusters] request, if any.
|
269
|
+
#
|
270
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
271
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>]
|
272
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
273
|
+
#
|
274
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>]
|
275
|
+
#
|
276
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
277
|
+
#
|
278
|
+
# @example Basic example
|
279
|
+
# require "google/cloud/redis/cluster/v1beta1"
|
280
|
+
#
|
281
|
+
# # Create a client object. The client can be reused for multiple calls.
|
282
|
+
# client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new
|
283
|
+
#
|
284
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
285
|
+
# request = Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new
|
286
|
+
#
|
287
|
+
# # Call the list_clusters method.
|
288
|
+
# result = client.list_clusters request
|
289
|
+
#
|
290
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
291
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
292
|
+
# result.each do |item|
|
293
|
+
# # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Cluster.
|
294
|
+
# p item
|
295
|
+
# end
|
296
|
+
#
|
297
|
+
def list_clusters request, options = nil
|
298
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
299
|
+
|
300
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest
|
301
|
+
|
302
|
+
# Converts hash and nil to an options object
|
303
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
304
|
+
|
305
|
+
# Customize the options with defaults
|
306
|
+
metadata = @config.rpcs.list_clusters.metadata.to_h
|
307
|
+
|
308
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
309
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
310
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
311
|
+
gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION
|
312
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
313
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
314
|
+
|
315
|
+
header_params = {}
|
316
|
+
if request.parent
|
317
|
+
header_params["parent"] = request.parent
|
318
|
+
end
|
319
|
+
|
320
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
321
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
322
|
+
|
323
|
+
options.apply_defaults timeout: @config.rpcs.list_clusters.timeout,
|
324
|
+
metadata: metadata,
|
325
|
+
retry_policy: @config.rpcs.list_clusters.retry_policy
|
326
|
+
|
327
|
+
options.apply_defaults timeout: @config.timeout,
|
328
|
+
metadata: @config.metadata,
|
329
|
+
retry_policy: @config.retry_policy
|
330
|
+
|
331
|
+
@cloud_redis_cluster_stub.call_rpc :list_clusters, request, options: options do |response, operation|
|
332
|
+
response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_clusters, request, response, operation, options
|
333
|
+
yield response, operation if block_given?
|
334
|
+
return response
|
335
|
+
end
|
336
|
+
rescue ::GRPC::BadStatus => e
|
337
|
+
raise ::Google::Cloud::Error.from_error(e)
|
338
|
+
end
|
339
|
+
|
340
|
+
##
|
341
|
+
# Gets the details of a specific Redis cluster.
|
342
|
+
#
|
343
|
+
# @overload get_cluster(request, options = nil)
|
344
|
+
# Pass arguments to `get_cluster` via a request object, either of type
|
345
|
+
# {::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest} or an equivalent Hash.
|
346
|
+
#
|
347
|
+
# @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest, ::Hash]
|
348
|
+
# A request object representing the call parameters. Required. To specify no
|
349
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
350
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
351
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
352
|
+
#
|
353
|
+
# @overload get_cluster(name: nil)
|
354
|
+
# Pass arguments to `get_cluster` via keyword arguments. Note that at
|
355
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
356
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
357
|
+
#
|
358
|
+
# @param name [::String]
|
359
|
+
# Required. Redis cluster resource name using the form:
|
360
|
+
# `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
|
361
|
+
# where `location_id` refers to a GCP region.
|
362
|
+
#
|
363
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
364
|
+
# @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::Cluster]
|
365
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
366
|
+
#
|
367
|
+
# @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster]
|
368
|
+
#
|
369
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
370
|
+
#
|
371
|
+
# @example Basic example
|
372
|
+
# require "google/cloud/redis/cluster/v1beta1"
|
373
|
+
#
|
374
|
+
# # Create a client object. The client can be reused for multiple calls.
|
375
|
+
# client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new
|
376
|
+
#
|
377
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
378
|
+
# request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new
|
379
|
+
#
|
380
|
+
# # Call the get_cluster method.
|
381
|
+
# result = client.get_cluster request
|
382
|
+
#
|
383
|
+
# # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Cluster.
|
384
|
+
# p result
|
385
|
+
#
|
386
|
+
def get_cluster request, options = nil
|
387
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
388
|
+
|
389
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest
|
390
|
+
|
391
|
+
# Converts hash and nil to an options object
|
392
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
393
|
+
|
394
|
+
# Customize the options with defaults
|
395
|
+
metadata = @config.rpcs.get_cluster.metadata.to_h
|
396
|
+
|
397
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
398
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
399
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
400
|
+
gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION
|
401
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
402
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
403
|
+
|
404
|
+
header_params = {}
|
405
|
+
if request.name
|
406
|
+
header_params["name"] = request.name
|
407
|
+
end
|
408
|
+
|
409
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
410
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
411
|
+
|
412
|
+
options.apply_defaults timeout: @config.rpcs.get_cluster.timeout,
|
413
|
+
metadata: metadata,
|
414
|
+
retry_policy: @config.rpcs.get_cluster.retry_policy
|
415
|
+
|
416
|
+
options.apply_defaults timeout: @config.timeout,
|
417
|
+
metadata: @config.metadata,
|
418
|
+
retry_policy: @config.retry_policy
|
419
|
+
|
420
|
+
@cloud_redis_cluster_stub.call_rpc :get_cluster, request, options: options do |response, operation|
|
421
|
+
yield response, operation if block_given?
|
422
|
+
return response
|
423
|
+
end
|
424
|
+
rescue ::GRPC::BadStatus => e
|
425
|
+
raise ::Google::Cloud::Error.from_error(e)
|
426
|
+
end
|
427
|
+
|
428
|
+
##
|
429
|
+
# Updates the metadata and configuration of a specific Redis cluster.
|
430
|
+
#
|
431
|
+
# Completed longrunning.Operation will contain the new cluster object
|
432
|
+
# in the response field. The returned operation is automatically deleted
|
433
|
+
# after a few hours, so there is no need to call DeleteOperation.
|
434
|
+
#
|
435
|
+
# @overload update_cluster(request, options = nil)
|
436
|
+
# Pass arguments to `update_cluster` via a request object, either of type
|
437
|
+
# {::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest} or an equivalent Hash.
|
438
|
+
#
|
439
|
+
# @param request [::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest, ::Hash]
|
440
|
+
# A request object representing the call parameters. Required. To specify no
|
441
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
442
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
443
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
444
|
+
#
|
445
|
+
# @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil)
|
446
|
+
# Pass arguments to `update_cluster` via keyword arguments. Note that at
|
447
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
448
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
449
|
+
#
|
450
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
451
|
+
# Required. Mask of fields to update. At least one path must be supplied in
|
452
|
+
# this field. The elements of the repeated paths field may only include these
|
453
|
+
# fields from {::Google::Cloud::Redis::Cluster::V1beta1::Cluster Cluster}:
|
454
|
+
#
|
455
|
+
# * `size_gb`
|
456
|
+
# * `replica_count`
|
457
|
+
# @param cluster [::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash]
|
458
|
+
# Required. Update description.
|
459
|
+
# Only fields specified in update_mask are updated.
|
460
|
+
# @param request_id [::String]
|
461
|
+
# Idempotent request UUID.
|
462
|
+
#
|
463
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
464
|
+
# @yieldparam response [::Gapic::Operation]
|
465
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
466
|
+
#
|
467
|
+
# @return [::Gapic::Operation]
|
468
|
+
#
|
469
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
470
|
+
#
|
471
|
+
# @example Basic example
|
472
|
+
# require "google/cloud/redis/cluster/v1beta1"
|
473
|
+
#
|
474
|
+
# # Create a client object. The client can be reused for multiple calls.
|
475
|
+
# client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new
|
476
|
+
#
|
477
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
478
|
+
# request = Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new
|
479
|
+
#
|
480
|
+
# # Call the update_cluster method.
|
481
|
+
# result = client.update_cluster request
|
482
|
+
#
|
483
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
484
|
+
# # check the status of an operation, cancel it, or wait for results.
|
485
|
+
# # Here is how to wait for a response.
|
486
|
+
# result.wait_until_done! timeout: 60
|
487
|
+
# if result.response?
|
488
|
+
# p result.response
|
489
|
+
# else
|
490
|
+
# puts "No response received."
|
491
|
+
# end
|
492
|
+
#
|
493
|
+
def update_cluster request, options = nil
|
494
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
495
|
+
|
496
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest
|
497
|
+
|
498
|
+
# Converts hash and nil to an options object
|
499
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
500
|
+
|
501
|
+
# Customize the options with defaults
|
502
|
+
metadata = @config.rpcs.update_cluster.metadata.to_h
|
503
|
+
|
504
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
505
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
506
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
507
|
+
gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION
|
508
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
509
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
510
|
+
|
511
|
+
header_params = {}
|
512
|
+
if request.cluster&.name
|
513
|
+
header_params["cluster.name"] = request.cluster.name
|
514
|
+
end
|
515
|
+
|
516
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
517
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
518
|
+
|
519
|
+
options.apply_defaults timeout: @config.rpcs.update_cluster.timeout,
|
520
|
+
metadata: metadata,
|
521
|
+
retry_policy: @config.rpcs.update_cluster.retry_policy
|
522
|
+
|
523
|
+
options.apply_defaults timeout: @config.timeout,
|
524
|
+
metadata: @config.metadata,
|
525
|
+
retry_policy: @config.retry_policy
|
526
|
+
|
527
|
+
@cloud_redis_cluster_stub.call_rpc :update_cluster, request, options: options do |response, operation|
|
528
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
529
|
+
yield response, operation if block_given?
|
530
|
+
return response
|
531
|
+
end
|
532
|
+
rescue ::GRPC::BadStatus => e
|
533
|
+
raise ::Google::Cloud::Error.from_error(e)
|
534
|
+
end
|
535
|
+
|
536
|
+
##
|
537
|
+
# Deletes a specific Redis cluster. Cluster stops serving and data is
|
538
|
+
# deleted.
|
539
|
+
#
|
540
|
+
# @overload delete_cluster(request, options = nil)
|
541
|
+
# Pass arguments to `delete_cluster` via a request object, either of type
|
542
|
+
# {::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest} or an equivalent Hash.
|
543
|
+
#
|
544
|
+
# @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest, ::Hash]
|
545
|
+
# A request object representing the call parameters. Required. To specify no
|
546
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
547
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
548
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
549
|
+
#
|
550
|
+
# @overload delete_cluster(name: nil, request_id: nil)
|
551
|
+
# Pass arguments to `delete_cluster` via keyword arguments. Note that at
|
552
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
553
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
554
|
+
#
|
555
|
+
# @param name [::String]
|
556
|
+
# Required. Redis cluster resource name using the form:
|
557
|
+
# `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
|
558
|
+
# where `location_id` refers to a GCP region.
|
559
|
+
# @param request_id [::String]
|
560
|
+
# Idempotent request UUID.
|
561
|
+
#
|
562
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
563
|
+
# @yieldparam response [::Gapic::Operation]
|
564
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
565
|
+
#
|
566
|
+
# @return [::Gapic::Operation]
|
567
|
+
#
|
568
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
569
|
+
#
|
570
|
+
# @example Basic example
|
571
|
+
# require "google/cloud/redis/cluster/v1beta1"
|
572
|
+
#
|
573
|
+
# # Create a client object. The client can be reused for multiple calls.
|
574
|
+
# client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new
|
575
|
+
#
|
576
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
577
|
+
# request = Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new
|
578
|
+
#
|
579
|
+
# # Call the delete_cluster method.
|
580
|
+
# result = client.delete_cluster request
|
581
|
+
#
|
582
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
583
|
+
# # check the status of an operation, cancel it, or wait for results.
|
584
|
+
# # Here is how to wait for a response.
|
585
|
+
# result.wait_until_done! timeout: 60
|
586
|
+
# if result.response?
|
587
|
+
# p result.response
|
588
|
+
# else
|
589
|
+
# puts "No response received."
|
590
|
+
# end
|
591
|
+
#
|
592
|
+
def delete_cluster request, options = nil
|
593
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
594
|
+
|
595
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest
|
596
|
+
|
597
|
+
# Converts hash and nil to an options object
|
598
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
599
|
+
|
600
|
+
# Customize the options with defaults
|
601
|
+
metadata = @config.rpcs.delete_cluster.metadata.to_h
|
602
|
+
|
603
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
604
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
605
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
606
|
+
gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION
|
607
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
608
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
609
|
+
|
610
|
+
header_params = {}
|
611
|
+
if request.name
|
612
|
+
header_params["name"] = request.name
|
613
|
+
end
|
614
|
+
|
615
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
616
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
617
|
+
|
618
|
+
options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout,
|
619
|
+
metadata: metadata,
|
620
|
+
retry_policy: @config.rpcs.delete_cluster.retry_policy
|
621
|
+
|
622
|
+
options.apply_defaults timeout: @config.timeout,
|
623
|
+
metadata: @config.metadata,
|
624
|
+
retry_policy: @config.retry_policy
|
625
|
+
|
626
|
+
@cloud_redis_cluster_stub.call_rpc :delete_cluster, request, options: options do |response, operation|
|
627
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
628
|
+
yield response, operation if block_given?
|
629
|
+
return response
|
630
|
+
end
|
631
|
+
rescue ::GRPC::BadStatus => e
|
632
|
+
raise ::Google::Cloud::Error.from_error(e)
|
633
|
+
end
|
634
|
+
|
635
|
+
##
|
636
|
+
# Creates a Redis cluster based on the specified properties.
|
637
|
+
# The creation is executed asynchronously and callers may check the returned
|
638
|
+
# operation to track its progress. Once the operation is completed the Redis
|
639
|
+
# cluster will be fully functional. The completed longrunning.Operation will
|
640
|
+
# contain the new cluster object in the response field.
|
641
|
+
#
|
642
|
+
# The returned operation is automatically deleted after a few hours, so there
|
643
|
+
# is no need to call DeleteOperation.
|
644
|
+
#
|
645
|
+
# @overload create_cluster(request, options = nil)
|
646
|
+
# Pass arguments to `create_cluster` via a request object, either of type
|
647
|
+
# {::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest} or an equivalent Hash.
|
648
|
+
#
|
649
|
+
# @param request [::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest, ::Hash]
|
650
|
+
# A request object representing the call parameters. Required. To specify no
|
651
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
652
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
653
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
654
|
+
#
|
655
|
+
# @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil)
|
656
|
+
# Pass arguments to `create_cluster` via keyword arguments. Note that at
|
657
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
658
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
659
|
+
#
|
660
|
+
# @param parent [::String]
|
661
|
+
# Required. The resource name of the cluster location using the form:
|
662
|
+
# `projects/{project_id}/locations/{location_id}`
|
663
|
+
# where `location_id` refers to a GCP region.
|
664
|
+
# @param cluster_id [::String]
|
665
|
+
# Required. The logical name of the Redis cluster in the customer project
|
666
|
+
# with the following restrictions:
|
667
|
+
#
|
668
|
+
# * Must contain only lowercase letters, numbers, and hyphens.
|
669
|
+
# * Must start with a letter.
|
670
|
+
# * Must be between 1-63 characters.
|
671
|
+
# * Must end with a number or a letter.
|
672
|
+
# * Must be unique within the customer project / location
|
673
|
+
# @param cluster [::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash]
|
674
|
+
# Required. The cluster that is to be created.
|
675
|
+
# @param request_id [::String]
|
676
|
+
# Idempotent request UUID.
|
677
|
+
#
|
678
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
679
|
+
# @yieldparam response [::Gapic::Operation]
|
680
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
681
|
+
#
|
682
|
+
# @return [::Gapic::Operation]
|
683
|
+
#
|
684
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
685
|
+
#
|
686
|
+
# @example Basic example
|
687
|
+
# require "google/cloud/redis/cluster/v1beta1"
|
688
|
+
#
|
689
|
+
# # Create a client object. The client can be reused for multiple calls.
|
690
|
+
# client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new
|
691
|
+
#
|
692
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
693
|
+
# request = Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new
|
694
|
+
#
|
695
|
+
# # Call the create_cluster method.
|
696
|
+
# result = client.create_cluster request
|
697
|
+
#
|
698
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
699
|
+
# # check the status of an operation, cancel it, or wait for results.
|
700
|
+
# # Here is how to wait for a response.
|
701
|
+
# result.wait_until_done! timeout: 60
|
702
|
+
# if result.response?
|
703
|
+
# p result.response
|
704
|
+
# else
|
705
|
+
# puts "No response received."
|
706
|
+
# end
|
707
|
+
#
|
708
|
+
def create_cluster request, options = nil
|
709
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
710
|
+
|
711
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest
|
712
|
+
|
713
|
+
# Converts hash and nil to an options object
|
714
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
715
|
+
|
716
|
+
# Customize the options with defaults
|
717
|
+
metadata = @config.rpcs.create_cluster.metadata.to_h
|
718
|
+
|
719
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
720
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
721
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
722
|
+
gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION
|
723
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
724
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
725
|
+
|
726
|
+
header_params = {}
|
727
|
+
if request.parent
|
728
|
+
header_params["parent"] = request.parent
|
729
|
+
end
|
730
|
+
|
731
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
732
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
733
|
+
|
734
|
+
options.apply_defaults timeout: @config.rpcs.create_cluster.timeout,
|
735
|
+
metadata: metadata,
|
736
|
+
retry_policy: @config.rpcs.create_cluster.retry_policy
|
737
|
+
|
738
|
+
options.apply_defaults timeout: @config.timeout,
|
739
|
+
metadata: @config.metadata,
|
740
|
+
retry_policy: @config.retry_policy
|
741
|
+
|
742
|
+
@cloud_redis_cluster_stub.call_rpc :create_cluster, request, options: options do |response, operation|
|
743
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
744
|
+
yield response, operation if block_given?
|
745
|
+
return response
|
746
|
+
end
|
747
|
+
rescue ::GRPC::BadStatus => e
|
748
|
+
raise ::Google::Cloud::Error.from_error(e)
|
749
|
+
end
|
750
|
+
|
751
|
+
##
|
752
|
+
# Gets the details of certificate authority information for Redis cluster.
|
753
|
+
#
|
754
|
+
# @overload get_cluster_certificate_authority(request, options = nil)
|
755
|
+
# Pass arguments to `get_cluster_certificate_authority` via a request object, either of type
|
756
|
+
# {::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest} or an equivalent Hash.
|
757
|
+
#
|
758
|
+
# @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest, ::Hash]
|
759
|
+
# A request object representing the call parameters. Required. To specify no
|
760
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
761
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
762
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
763
|
+
#
|
764
|
+
# @overload get_cluster_certificate_authority(name: nil)
|
765
|
+
# Pass arguments to `get_cluster_certificate_authority` via keyword arguments. Note that at
|
766
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
767
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
768
|
+
#
|
769
|
+
# @param name [::String]
|
770
|
+
# Required. Redis cluster certificate authority resource name using the form:
|
771
|
+
# `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority`
|
772
|
+
# where `location_id` refers to a GCP region.
|
773
|
+
#
|
774
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
775
|
+
# @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority]
|
776
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
777
|
+
#
|
778
|
+
# @return [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority]
|
779
|
+
#
|
780
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
781
|
+
#
|
782
|
+
# @example Basic example
|
783
|
+
# require "google/cloud/redis/cluster/v1beta1"
|
784
|
+
#
|
785
|
+
# # Create a client object. The client can be reused for multiple calls.
|
786
|
+
# client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new
|
787
|
+
#
|
788
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
789
|
+
# request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new
|
790
|
+
#
|
791
|
+
# # Call the get_cluster_certificate_authority method.
|
792
|
+
# result = client.get_cluster_certificate_authority request
|
793
|
+
#
|
794
|
+
# # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority.
|
795
|
+
# p result
|
796
|
+
#
|
797
|
+
def get_cluster_certificate_authority request, options = nil
|
798
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
799
|
+
|
800
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest
|
801
|
+
|
802
|
+
# Converts hash and nil to an options object
|
803
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
804
|
+
|
805
|
+
# Customize the options with defaults
|
806
|
+
metadata = @config.rpcs.get_cluster_certificate_authority.metadata.to_h
|
807
|
+
|
808
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
809
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
810
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
811
|
+
gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION
|
812
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
813
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
814
|
+
|
815
|
+
header_params = {}
|
816
|
+
if request.name
|
817
|
+
header_params["name"] = request.name
|
818
|
+
end
|
819
|
+
|
820
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
821
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
822
|
+
|
823
|
+
options.apply_defaults timeout: @config.rpcs.get_cluster_certificate_authority.timeout,
|
824
|
+
metadata: metadata,
|
825
|
+
retry_policy: @config.rpcs.get_cluster_certificate_authority.retry_policy
|
826
|
+
|
827
|
+
options.apply_defaults timeout: @config.timeout,
|
828
|
+
metadata: @config.metadata,
|
829
|
+
retry_policy: @config.retry_policy
|
830
|
+
|
831
|
+
@cloud_redis_cluster_stub.call_rpc :get_cluster_certificate_authority, request, options: options do |response, operation|
|
832
|
+
yield response, operation if block_given?
|
833
|
+
return response
|
834
|
+
end
|
835
|
+
rescue ::GRPC::BadStatus => e
|
836
|
+
raise ::Google::Cloud::Error.from_error(e)
|
837
|
+
end
|
838
|
+
|
839
|
+
##
|
840
|
+
# Configuration class for the CloudRedisCluster API.
|
841
|
+
#
|
842
|
+
# This class represents the configuration for CloudRedisCluster,
|
843
|
+
# providing control over timeouts, retry behavior, logging, transport
|
844
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
845
|
+
# applied individually to specific RPCs. See
|
846
|
+
# {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client::Configuration::Rpcs}
|
847
|
+
# for a list of RPCs that can be configured independently.
|
848
|
+
#
|
849
|
+
# Configuration can be applied globally to all clients, or to a single client
|
850
|
+
# on construction.
|
851
|
+
#
|
852
|
+
# @example
|
853
|
+
#
|
854
|
+
# # Modify the global config, setting the timeout for
|
855
|
+
# # list_clusters to 20 seconds,
|
856
|
+
# # and all remaining timeouts to 10 seconds.
|
857
|
+
# ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.configure do |config|
|
858
|
+
# config.timeout = 10.0
|
859
|
+
# config.rpcs.list_clusters.timeout = 20.0
|
860
|
+
# end
|
861
|
+
#
|
862
|
+
# # Apply the above configuration only to a new client.
|
863
|
+
# client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config|
|
864
|
+
# config.timeout = 10.0
|
865
|
+
# config.rpcs.list_clusters.timeout = 20.0
|
866
|
+
# end
|
867
|
+
#
|
868
|
+
# @!attribute [rw] endpoint
|
869
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
870
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
871
|
+
# @return [::String,nil]
|
872
|
+
# @!attribute [rw] credentials
|
873
|
+
# Credentials to send with calls. You may provide any of the following types:
|
874
|
+
# * (`String`) The path to a service account key file in JSON format
|
875
|
+
# * (`Hash`) A service account key as a Hash
|
876
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
877
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
878
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
879
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
880
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
881
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
882
|
+
# * (`nil`) indicating no credentials
|
883
|
+
# @return [::Object]
|
884
|
+
# @!attribute [rw] scope
|
885
|
+
# The OAuth scopes
|
886
|
+
# @return [::Array<::String>]
|
887
|
+
# @!attribute [rw] lib_name
|
888
|
+
# The library name as recorded in instrumentation and logging
|
889
|
+
# @return [::String]
|
890
|
+
# @!attribute [rw] lib_version
|
891
|
+
# The library version as recorded in instrumentation and logging
|
892
|
+
# @return [::String]
|
893
|
+
# @!attribute [rw] channel_args
|
894
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
895
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
896
|
+
# @return [::Hash]
|
897
|
+
# @!attribute [rw] interceptors
|
898
|
+
# An array of interceptors that are run before calls are executed.
|
899
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
900
|
+
# @!attribute [rw] timeout
|
901
|
+
# The call timeout in seconds.
|
902
|
+
# @return [::Numeric]
|
903
|
+
# @!attribute [rw] metadata
|
904
|
+
# Additional gRPC headers to be sent with the call.
|
905
|
+
# @return [::Hash{::Symbol=>::String}]
|
906
|
+
# @!attribute [rw] retry_policy
|
907
|
+
# The retry policy. The value is a hash with the following keys:
|
908
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
909
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
910
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
911
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
912
|
+
# trigger a retry.
|
913
|
+
# @return [::Hash]
|
914
|
+
# @!attribute [rw] quota_project
|
915
|
+
# A separate project against which to charge quota.
|
916
|
+
# @return [::String]
|
917
|
+
# @!attribute [rw] universe_domain
|
918
|
+
# The universe domain within which to make requests. This determines the
|
919
|
+
# default endpoint URL. The default value of nil uses the environment
|
920
|
+
# universe (usually the default "googleapis.com" universe).
|
921
|
+
# @return [::String,nil]
|
922
|
+
#
|
923
|
+
class Configuration
|
924
|
+
extend ::Gapic::Config
|
925
|
+
|
926
|
+
# @private
|
927
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
928
|
+
DEFAULT_ENDPOINT = "redis.googleapis.com"
|
929
|
+
|
930
|
+
config_attr :endpoint, nil, ::String, nil
|
931
|
+
config_attr :credentials, nil do |value|
|
932
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
933
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
934
|
+
allowed.any? { |klass| klass === value }
|
935
|
+
end
|
936
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
937
|
+
config_attr :lib_name, nil, ::String, nil
|
938
|
+
config_attr :lib_version, nil, ::String, nil
|
939
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
940
|
+
config_attr :interceptors, nil, ::Array, nil
|
941
|
+
config_attr :timeout, nil, ::Numeric, nil
|
942
|
+
config_attr :metadata, nil, ::Hash, nil
|
943
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
944
|
+
config_attr :quota_project, nil, ::String, nil
|
945
|
+
config_attr :universe_domain, nil, ::String, nil
|
946
|
+
|
947
|
+
# @private
|
948
|
+
def initialize parent_config = nil
|
949
|
+
@parent_config = parent_config unless parent_config.nil?
|
950
|
+
|
951
|
+
yield self if block_given?
|
952
|
+
end
|
953
|
+
|
954
|
+
##
|
955
|
+
# Configurations for individual RPCs
|
956
|
+
# @return [Rpcs]
|
957
|
+
#
|
958
|
+
def rpcs
|
959
|
+
@rpcs ||= begin
|
960
|
+
parent_rpcs = nil
|
961
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
962
|
+
Rpcs.new parent_rpcs
|
963
|
+
end
|
964
|
+
end
|
965
|
+
|
966
|
+
##
|
967
|
+
# Configuration for the channel pool
|
968
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
969
|
+
#
|
970
|
+
def channel_pool
|
971
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
972
|
+
end
|
973
|
+
|
974
|
+
##
|
975
|
+
# Configuration RPC class for the CloudRedisCluster API.
|
976
|
+
#
|
977
|
+
# Includes fields providing the configuration for each RPC in this service.
|
978
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
979
|
+
# the following configuration fields:
|
980
|
+
#
|
981
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
982
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
983
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
984
|
+
# include the following keys:
|
985
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
986
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
987
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
988
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
989
|
+
# trigger a retry.
|
990
|
+
#
|
991
|
+
class Rpcs
|
992
|
+
##
|
993
|
+
# RPC-specific configuration for `list_clusters`
|
994
|
+
# @return [::Gapic::Config::Method]
|
995
|
+
#
|
996
|
+
attr_reader :list_clusters
|
997
|
+
##
|
998
|
+
# RPC-specific configuration for `get_cluster`
|
999
|
+
# @return [::Gapic::Config::Method]
|
1000
|
+
#
|
1001
|
+
attr_reader :get_cluster
|
1002
|
+
##
|
1003
|
+
# RPC-specific configuration for `update_cluster`
|
1004
|
+
# @return [::Gapic::Config::Method]
|
1005
|
+
#
|
1006
|
+
attr_reader :update_cluster
|
1007
|
+
##
|
1008
|
+
# RPC-specific configuration for `delete_cluster`
|
1009
|
+
# @return [::Gapic::Config::Method]
|
1010
|
+
#
|
1011
|
+
attr_reader :delete_cluster
|
1012
|
+
##
|
1013
|
+
# RPC-specific configuration for `create_cluster`
|
1014
|
+
# @return [::Gapic::Config::Method]
|
1015
|
+
#
|
1016
|
+
attr_reader :create_cluster
|
1017
|
+
##
|
1018
|
+
# RPC-specific configuration for `get_cluster_certificate_authority`
|
1019
|
+
# @return [::Gapic::Config::Method]
|
1020
|
+
#
|
1021
|
+
attr_reader :get_cluster_certificate_authority
|
1022
|
+
|
1023
|
+
# @private
|
1024
|
+
def initialize parent_rpcs = nil
|
1025
|
+
list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters
|
1026
|
+
@list_clusters = ::Gapic::Config::Method.new list_clusters_config
|
1027
|
+
get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster
|
1028
|
+
@get_cluster = ::Gapic::Config::Method.new get_cluster_config
|
1029
|
+
update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster
|
1030
|
+
@update_cluster = ::Gapic::Config::Method.new update_cluster_config
|
1031
|
+
delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster
|
1032
|
+
@delete_cluster = ::Gapic::Config::Method.new delete_cluster_config
|
1033
|
+
create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster
|
1034
|
+
@create_cluster = ::Gapic::Config::Method.new create_cluster_config
|
1035
|
+
get_cluster_certificate_authority_config = parent_rpcs.get_cluster_certificate_authority if parent_rpcs.respond_to? :get_cluster_certificate_authority
|
1036
|
+
@get_cluster_certificate_authority = ::Gapic::Config::Method.new get_cluster_certificate_authority_config
|
1037
|
+
|
1038
|
+
yield self if block_given?
|
1039
|
+
end
|
1040
|
+
end
|
1041
|
+
end
|
1042
|
+
end
|
1043
|
+
end
|
1044
|
+
end
|
1045
|
+
end
|
1046
|
+
end
|
1047
|
+
end
|
1048
|
+
end
|