google-cloud-redis-v1 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +8 -8
- data/README.md +1 -1
- data/lib/google/cloud/redis/v1/cloud_redis/client.rb +294 -74
- data/lib/google/cloud/redis/v1/cloud_redis/operations.rb +149 -37
- data/lib/google/cloud/redis/v1/cloud_redis_pb.rb +18 -2
- data/lib/google/cloud/redis/v1/cloud_redis_services_pb.rb +2 -2
- data/lib/google/cloud/redis/v1/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +7 -1
- data/proto_docs/google/cloud/redis/v1/cloud_redis.rb +77 -22
- metadata +13 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 595fd860e4b4ce42b1f1b6026a8fde7eca130a34f2f6957962a2f276ccb832bf
|
4
|
+
data.tar.gz: 4777b3e84b558879f989c60225ceb86e281bc1e18fa71ab6f5c223b960e4b959
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9528438d9f79e3295b15a308a0c0f884211271ba6f80cfd577ad12f8c727b39427bf593e69c674d73b84ddb4234716420c173dca9db1e70c5da06574155d1a3e
|
7
|
+
data.tar.gz: 859fdf7ac313ac590e33175419ae5baf5d2c7cfb09141b3f9968ed9fa6775fc381fd11765373cfe962e2ad6e1157a9fd3897eba0c65620138856c07f2cdd5e64
|
data/AUTHENTICATION.md
CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-redis-v1
|
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
67
|
{::Google::Cloud::Redis::V1::CloudRedis::Credentials}):
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
69
|
+
* `REDIS_CREDENTIALS` - Path to JSON file, or JSON contents
|
70
|
+
* `REDIS_KEYFILE` - Path to JSON file, or JSON contents
|
71
|
+
* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
|
72
|
+
* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
|
73
|
+
* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
|
74
74
|
|
75
75
|
```ruby
|
76
76
|
require "google/cloud/redis/v1"
|
@@ -82,8 +82,8 @@ client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new
|
|
82
82
|
|
83
83
|
### Configuration
|
84
84
|
|
85
|
-
The **Credentials JSON** can be configured instead of
|
86
|
-
environment
|
85
|
+
The path to the **Credentials JSON** file can be configured instead of storing
|
86
|
+
it in an environment variable. Either on an individual client initialization:
|
87
87
|
|
88
88
|
```ruby
|
89
89
|
require "google/cloud/redis/v1"
|
@@ -93,7 +93,7 @@ client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config|
|
|
93
93
|
end
|
94
94
|
```
|
95
95
|
|
96
|
-
Or
|
96
|
+
Or globally for all clients:
|
97
97
|
|
98
98
|
```ruby
|
99
99
|
require "google/cloud/redis/v1"
|
data/README.md
CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
|
|
33
33
|
require "google/cloud/redis/v1"
|
34
34
|
|
35
35
|
client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new
|
36
|
-
request =
|
36
|
+
request = ::Google::Cloud::Redis::V1::ListInstancesRequest.new # (request fields as keyword arguments...)
|
37
37
|
response = client.list_instances request
|
38
38
|
```
|
39
39
|
|
@@ -55,13 +55,12 @@ module Google
|
|
55
55
|
# See {::Google::Cloud::Redis::V1::CloudRedis::Client::Configuration}
|
56
56
|
# for a description of the configuration fields.
|
57
57
|
#
|
58
|
-
#
|
58
|
+
# @example
|
59
59
|
#
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
# end
|
60
|
+
# # Modify the configuration for all CloudRedis clients
|
61
|
+
# ::Google::Cloud::Redis::V1::CloudRedis::Client.configure do |config|
|
62
|
+
# config.timeout = 10.0
|
63
|
+
# end
|
65
64
|
#
|
66
65
|
# @yield [config] Configure the Client client.
|
67
66
|
# @yieldparam config [Client::Configuration]
|
@@ -126,19 +125,15 @@ module Google
|
|
126
125
|
##
|
127
126
|
# Create a new CloudRedis client object.
|
128
127
|
#
|
129
|
-
#
|
130
|
-
#
|
131
|
-
# To create a new CloudRedis client with the default
|
132
|
-
# configuration:
|
133
|
-
#
|
134
|
-
# client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new
|
128
|
+
# @example
|
135
129
|
#
|
136
|
-
#
|
137
|
-
#
|
130
|
+
# # Create a client using the default configuration
|
131
|
+
# client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new
|
138
132
|
#
|
139
|
-
#
|
140
|
-
#
|
141
|
-
#
|
133
|
+
# # Create a client using a custom configuration
|
134
|
+
# client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config|
|
135
|
+
# config.timeout = 10.0
|
136
|
+
# end
|
142
137
|
#
|
143
138
|
# @yield [config] Configure the CloudRedis client.
|
144
139
|
# @yieldparam config [Client::Configuration]
|
@@ -158,14 +153,13 @@ module Google
|
|
158
153
|
|
159
154
|
# Create credentials
|
160
155
|
credentials = @config.credentials
|
161
|
-
# Use self-signed JWT if the
|
156
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
162
157
|
# but only if the default endpoint does not have a region prefix.
|
163
|
-
enable_self_signed_jwt = @config.
|
164
|
-
@config.endpoint == Client.configure.endpoint &&
|
158
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
165
159
|
!@config.endpoint.split(".").first.include?("-")
|
166
160
|
credentials ||= Credentials.default scope: @config.scope,
|
167
161
|
enable_self_signed_jwt: enable_self_signed_jwt
|
168
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
162
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
169
163
|
credentials = Credentials.new credentials, scope: @config.scope
|
170
164
|
end
|
171
165
|
@quota_project_id = @config.quota_project
|
@@ -244,6 +238,27 @@ module Google
|
|
244
238
|
#
|
245
239
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
246
240
|
#
|
241
|
+
# @example Basic example
|
242
|
+
# require "google/cloud/redis/v1"
|
243
|
+
#
|
244
|
+
# # Create a client object. The client can be reused for multiple calls.
|
245
|
+
# client = Google::Cloud::Redis::V1::CloudRedis::Client.new
|
246
|
+
#
|
247
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
248
|
+
# request = Google::Cloud::Redis::V1::ListInstancesRequest.new
|
249
|
+
#
|
250
|
+
# # Call the list_instances method.
|
251
|
+
# result = client.list_instances request
|
252
|
+
#
|
253
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
254
|
+
# # iterate over all elements by calling #each, and the enumerable
|
255
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
256
|
+
# # methods are also available for managing paging directly.
|
257
|
+
# result.each do |response|
|
258
|
+
# # Each element is of type ::Google::Cloud::Redis::V1::Instance.
|
259
|
+
# p response
|
260
|
+
# end
|
261
|
+
#
|
247
262
|
def list_instances request, options = nil
|
248
263
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
249
264
|
|
@@ -261,16 +276,20 @@ module Google
|
|
261
276
|
gapic_version: ::Google::Cloud::Redis::V1::VERSION
|
262
277
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
263
278
|
|
264
|
-
header_params = {
|
265
|
-
|
266
|
-
|
279
|
+
header_params = {}
|
280
|
+
if request.parent
|
281
|
+
header_params["parent"] = request.parent
|
282
|
+
end
|
283
|
+
|
267
284
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
268
285
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
269
286
|
|
270
287
|
options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
|
271
288
|
metadata: metadata,
|
272
289
|
retry_policy: @config.rpcs.list_instances.retry_policy
|
273
|
-
|
290
|
+
|
291
|
+
options.apply_defaults timeout: @config.timeout,
|
292
|
+
metadata: @config.metadata,
|
274
293
|
retry_policy: @config.retry_policy
|
275
294
|
|
276
295
|
@cloud_redis_stub.call_rpc :list_instances, request, options: options do |response, operation|
|
@@ -313,6 +332,21 @@ module Google
|
|
313
332
|
#
|
314
333
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
315
334
|
#
|
335
|
+
# @example Basic example
|
336
|
+
# require "google/cloud/redis/v1"
|
337
|
+
#
|
338
|
+
# # Create a client object. The client can be reused for multiple calls.
|
339
|
+
# client = Google::Cloud::Redis::V1::CloudRedis::Client.new
|
340
|
+
#
|
341
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
342
|
+
# request = Google::Cloud::Redis::V1::GetInstanceRequest.new
|
343
|
+
#
|
344
|
+
# # Call the get_instance method.
|
345
|
+
# result = client.get_instance request
|
346
|
+
#
|
347
|
+
# # The returned object is of type Google::Cloud::Redis::V1::Instance.
|
348
|
+
# p result
|
349
|
+
#
|
316
350
|
def get_instance request, options = nil
|
317
351
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
318
352
|
|
@@ -330,16 +364,20 @@ module Google
|
|
330
364
|
gapic_version: ::Google::Cloud::Redis::V1::VERSION
|
331
365
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
332
366
|
|
333
|
-
header_params = {
|
334
|
-
|
335
|
-
|
367
|
+
header_params = {}
|
368
|
+
if request.name
|
369
|
+
header_params["name"] = request.name
|
370
|
+
end
|
371
|
+
|
336
372
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
337
373
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
338
374
|
|
339
375
|
options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
|
340
376
|
metadata: metadata,
|
341
377
|
retry_policy: @config.rpcs.get_instance.retry_policy
|
342
|
-
|
378
|
+
|
379
|
+
options.apply_defaults timeout: @config.timeout,
|
380
|
+
metadata: @config.metadata,
|
343
381
|
retry_policy: @config.retry_policy
|
344
382
|
|
345
383
|
@cloud_redis_stub.call_rpc :get_instance, request, options: options do |response, operation|
|
@@ -403,6 +441,28 @@ module Google
|
|
403
441
|
#
|
404
442
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
405
443
|
#
|
444
|
+
# @example Basic example
|
445
|
+
# require "google/cloud/redis/v1"
|
446
|
+
#
|
447
|
+
# # Create a client object. The client can be reused for multiple calls.
|
448
|
+
# client = Google::Cloud::Redis::V1::CloudRedis::Client.new
|
449
|
+
#
|
450
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
451
|
+
# request = Google::Cloud::Redis::V1::CreateInstanceRequest.new
|
452
|
+
#
|
453
|
+
# # Call the create_instance method.
|
454
|
+
# result = client.create_instance request
|
455
|
+
#
|
456
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
457
|
+
# # object to check the status of an operation, cancel it, or wait
|
458
|
+
# # for results. Here is how to block until completion:
|
459
|
+
# result.wait_until_done! timeout: 60
|
460
|
+
# if result.response?
|
461
|
+
# p result.response
|
462
|
+
# else
|
463
|
+
# puts "Error!"
|
464
|
+
# end
|
465
|
+
#
|
406
466
|
def create_instance request, options = nil
|
407
467
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
408
468
|
|
@@ -420,16 +480,20 @@ module Google
|
|
420
480
|
gapic_version: ::Google::Cloud::Redis::V1::VERSION
|
421
481
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
422
482
|
|
423
|
-
header_params = {
|
424
|
-
|
425
|
-
|
483
|
+
header_params = {}
|
484
|
+
if request.parent
|
485
|
+
header_params["parent"] = request.parent
|
486
|
+
end
|
487
|
+
|
426
488
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
427
489
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
428
490
|
|
429
491
|
options.apply_defaults timeout: @config.rpcs.create_instance.timeout,
|
430
492
|
metadata: metadata,
|
431
493
|
retry_policy: @config.rpcs.create_instance.retry_policy
|
432
|
-
|
494
|
+
|
495
|
+
options.apply_defaults timeout: @config.timeout,
|
496
|
+
metadata: @config.metadata,
|
433
497
|
retry_policy: @config.retry_policy
|
434
498
|
|
435
499
|
@cloud_redis_stub.call_rpc :create_instance, request, options: options do |response, operation|
|
@@ -472,6 +536,7 @@ module Google
|
|
472
536
|
# * `labels`
|
473
537
|
# * `memorySizeGb`
|
474
538
|
# * `redisConfig`
|
539
|
+
# * `replica_count`
|
475
540
|
# @param instance [::Google::Cloud::Redis::V1::Instance, ::Hash]
|
476
541
|
# Required. Update description.
|
477
542
|
# Only fields specified in update_mask are updated.
|
@@ -484,6 +549,28 @@ module Google
|
|
484
549
|
#
|
485
550
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
486
551
|
#
|
552
|
+
# @example Basic example
|
553
|
+
# require "google/cloud/redis/v1"
|
554
|
+
#
|
555
|
+
# # Create a client object. The client can be reused for multiple calls.
|
556
|
+
# client = Google::Cloud::Redis::V1::CloudRedis::Client.new
|
557
|
+
#
|
558
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
559
|
+
# request = Google::Cloud::Redis::V1::UpdateInstanceRequest.new
|
560
|
+
#
|
561
|
+
# # Call the update_instance method.
|
562
|
+
# result = client.update_instance request
|
563
|
+
#
|
564
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
565
|
+
# # object to check the status of an operation, cancel it, or wait
|
566
|
+
# # for results. Here is how to block until completion:
|
567
|
+
# result.wait_until_done! timeout: 60
|
568
|
+
# if result.response?
|
569
|
+
# p result.response
|
570
|
+
# else
|
571
|
+
# puts "Error!"
|
572
|
+
# end
|
573
|
+
#
|
487
574
|
def update_instance request, options = nil
|
488
575
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
489
576
|
|
@@ -501,16 +588,20 @@ module Google
|
|
501
588
|
gapic_version: ::Google::Cloud::Redis::V1::VERSION
|
502
589
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
503
590
|
|
504
|
-
header_params = {
|
505
|
-
|
506
|
-
|
591
|
+
header_params = {}
|
592
|
+
if request.instance&.name
|
593
|
+
header_params["instance.name"] = request.instance.name
|
594
|
+
end
|
595
|
+
|
507
596
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
508
597
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
509
598
|
|
510
599
|
options.apply_defaults timeout: @config.rpcs.update_instance.timeout,
|
511
600
|
metadata: metadata,
|
512
601
|
retry_policy: @config.rpcs.update_instance.retry_policy
|
513
|
-
|
602
|
+
|
603
|
+
options.apply_defaults timeout: @config.timeout,
|
604
|
+
metadata: @config.metadata,
|
514
605
|
retry_policy: @config.retry_policy
|
515
606
|
|
516
607
|
@cloud_redis_stub.call_rpc :update_instance, request, options: options do |response, operation|
|
@@ -556,6 +647,28 @@ module Google
|
|
556
647
|
#
|
557
648
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
558
649
|
#
|
650
|
+
# @example Basic example
|
651
|
+
# require "google/cloud/redis/v1"
|
652
|
+
#
|
653
|
+
# # Create a client object. The client can be reused for multiple calls.
|
654
|
+
# client = Google::Cloud::Redis::V1::CloudRedis::Client.new
|
655
|
+
#
|
656
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
657
|
+
# request = Google::Cloud::Redis::V1::UpgradeInstanceRequest.new
|
658
|
+
#
|
659
|
+
# # Call the upgrade_instance method.
|
660
|
+
# result = client.upgrade_instance request
|
661
|
+
#
|
662
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
663
|
+
# # object to check the status of an operation, cancel it, or wait
|
664
|
+
# # for results. Here is how to block until completion:
|
665
|
+
# result.wait_until_done! timeout: 60
|
666
|
+
# if result.response?
|
667
|
+
# p result.response
|
668
|
+
# else
|
669
|
+
# puts "Error!"
|
670
|
+
# end
|
671
|
+
#
|
559
672
|
def upgrade_instance request, options = nil
|
560
673
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
561
674
|
|
@@ -573,16 +686,20 @@ module Google
|
|
573
686
|
gapic_version: ::Google::Cloud::Redis::V1::VERSION
|
574
687
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
575
688
|
|
576
|
-
header_params = {
|
577
|
-
|
578
|
-
|
689
|
+
header_params = {}
|
690
|
+
if request.name
|
691
|
+
header_params["name"] = request.name
|
692
|
+
end
|
693
|
+
|
579
694
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
580
695
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
581
696
|
|
582
697
|
options.apply_defaults timeout: @config.rpcs.upgrade_instance.timeout,
|
583
698
|
metadata: metadata,
|
584
699
|
retry_policy: @config.rpcs.upgrade_instance.retry_policy
|
585
|
-
|
700
|
+
|
701
|
+
options.apply_defaults timeout: @config.timeout,
|
702
|
+
metadata: @config.metadata,
|
586
703
|
retry_policy: @config.retry_policy
|
587
704
|
|
588
705
|
@cloud_redis_stub.call_rpc :upgrade_instance, request, options: options do |response, operation|
|
@@ -634,6 +751,28 @@ module Google
|
|
634
751
|
#
|
635
752
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
636
753
|
#
|
754
|
+
# @example Basic example
|
755
|
+
# require "google/cloud/redis/v1"
|
756
|
+
#
|
757
|
+
# # Create a client object. The client can be reused for multiple calls.
|
758
|
+
# client = Google::Cloud::Redis::V1::CloudRedis::Client.new
|
759
|
+
#
|
760
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
761
|
+
# request = Google::Cloud::Redis::V1::ImportInstanceRequest.new
|
762
|
+
#
|
763
|
+
# # Call the import_instance method.
|
764
|
+
# result = client.import_instance request
|
765
|
+
#
|
766
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
767
|
+
# # object to check the status of an operation, cancel it, or wait
|
768
|
+
# # for results. Here is how to block until completion:
|
769
|
+
# result.wait_until_done! timeout: 60
|
770
|
+
# if result.response?
|
771
|
+
# p result.response
|
772
|
+
# else
|
773
|
+
# puts "Error!"
|
774
|
+
# end
|
775
|
+
#
|
637
776
|
def import_instance request, options = nil
|
638
777
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
639
778
|
|
@@ -651,16 +790,20 @@ module Google
|
|
651
790
|
gapic_version: ::Google::Cloud::Redis::V1::VERSION
|
652
791
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
653
792
|
|
654
|
-
header_params = {
|
655
|
-
|
656
|
-
|
793
|
+
header_params = {}
|
794
|
+
if request.name
|
795
|
+
header_params["name"] = request.name
|
796
|
+
end
|
797
|
+
|
657
798
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
658
799
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
659
800
|
|
660
801
|
options.apply_defaults timeout: @config.rpcs.import_instance.timeout,
|
661
802
|
metadata: metadata,
|
662
803
|
retry_policy: @config.rpcs.import_instance.retry_policy
|
663
|
-
|
804
|
+
|
805
|
+
options.apply_defaults timeout: @config.timeout,
|
806
|
+
metadata: @config.metadata,
|
664
807
|
retry_policy: @config.retry_policy
|
665
808
|
|
666
809
|
@cloud_redis_stub.call_rpc :import_instance, request, options: options do |response, operation|
|
@@ -710,6 +853,28 @@ module Google
|
|
710
853
|
#
|
711
854
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
712
855
|
#
|
856
|
+
# @example Basic example
|
857
|
+
# require "google/cloud/redis/v1"
|
858
|
+
#
|
859
|
+
# # Create a client object. The client can be reused for multiple calls.
|
860
|
+
# client = Google::Cloud::Redis::V1::CloudRedis::Client.new
|
861
|
+
#
|
862
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
863
|
+
# request = Google::Cloud::Redis::V1::ExportInstanceRequest.new
|
864
|
+
#
|
865
|
+
# # Call the export_instance method.
|
866
|
+
# result = client.export_instance request
|
867
|
+
#
|
868
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
869
|
+
# # object to check the status of an operation, cancel it, or wait
|
870
|
+
# # for results. Here is how to block until completion:
|
871
|
+
# result.wait_until_done! timeout: 60
|
872
|
+
# if result.response?
|
873
|
+
# p result.response
|
874
|
+
# else
|
875
|
+
# puts "Error!"
|
876
|
+
# end
|
877
|
+
#
|
713
878
|
def export_instance request, options = nil
|
714
879
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
715
880
|
|
@@ -727,16 +892,20 @@ module Google
|
|
727
892
|
gapic_version: ::Google::Cloud::Redis::V1::VERSION
|
728
893
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
729
894
|
|
730
|
-
header_params = {
|
731
|
-
|
732
|
-
|
895
|
+
header_params = {}
|
896
|
+
if request.name
|
897
|
+
header_params["name"] = request.name
|
898
|
+
end
|
899
|
+
|
733
900
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
734
901
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
735
902
|
|
736
903
|
options.apply_defaults timeout: @config.rpcs.export_instance.timeout,
|
737
904
|
metadata: metadata,
|
738
905
|
retry_policy: @config.rpcs.export_instance.retry_policy
|
739
|
-
|
906
|
+
|
907
|
+
options.apply_defaults timeout: @config.timeout,
|
908
|
+
metadata: @config.metadata,
|
740
909
|
retry_policy: @config.retry_policy
|
741
910
|
|
742
911
|
@cloud_redis_stub.call_rpc :export_instance, request, options: options do |response, operation|
|
@@ -749,7 +918,7 @@ module Google
|
|
749
918
|
end
|
750
919
|
|
751
920
|
##
|
752
|
-
# Initiates a failover of the
|
921
|
+
# Initiates a failover of the primary node to current replica node for a
|
753
922
|
# specific STANDARD tier Cloud Memorystore for Redis instance.
|
754
923
|
#
|
755
924
|
# @overload failover_instance(request, options = nil)
|
@@ -783,6 +952,28 @@ module Google
|
|
783
952
|
#
|
784
953
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
785
954
|
#
|
955
|
+
# @example Basic example
|
956
|
+
# require "google/cloud/redis/v1"
|
957
|
+
#
|
958
|
+
# # Create a client object. The client can be reused for multiple calls.
|
959
|
+
# client = Google::Cloud::Redis::V1::CloudRedis::Client.new
|
960
|
+
#
|
961
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
962
|
+
# request = Google::Cloud::Redis::V1::FailoverInstanceRequest.new
|
963
|
+
#
|
964
|
+
# # Call the failover_instance method.
|
965
|
+
# result = client.failover_instance request
|
966
|
+
#
|
967
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
968
|
+
# # object to check the status of an operation, cancel it, or wait
|
969
|
+
# # for results. Here is how to block until completion:
|
970
|
+
# result.wait_until_done! timeout: 60
|
971
|
+
# if result.response?
|
972
|
+
# p result.response
|
973
|
+
# else
|
974
|
+
# puts "Error!"
|
975
|
+
# end
|
976
|
+
#
|
786
977
|
def failover_instance request, options = nil
|
787
978
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
788
979
|
|
@@ -800,16 +991,20 @@ module Google
|
|
800
991
|
gapic_version: ::Google::Cloud::Redis::V1::VERSION
|
801
992
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
802
993
|
|
803
|
-
header_params = {
|
804
|
-
|
805
|
-
|
994
|
+
header_params = {}
|
995
|
+
if request.name
|
996
|
+
header_params["name"] = request.name
|
997
|
+
end
|
998
|
+
|
806
999
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
807
1000
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
808
1001
|
|
809
1002
|
options.apply_defaults timeout: @config.rpcs.failover_instance.timeout,
|
810
1003
|
metadata: metadata,
|
811
1004
|
retry_policy: @config.rpcs.failover_instance.retry_policy
|
812
|
-
|
1005
|
+
|
1006
|
+
options.apply_defaults timeout: @config.timeout,
|
1007
|
+
metadata: @config.metadata,
|
813
1008
|
retry_policy: @config.retry_policy
|
814
1009
|
|
815
1010
|
@cloud_redis_stub.call_rpc :failover_instance, request, options: options do |response, operation|
|
@@ -853,6 +1048,28 @@ module Google
|
|
853
1048
|
#
|
854
1049
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
855
1050
|
#
|
1051
|
+
# @example Basic example
|
1052
|
+
# require "google/cloud/redis/v1"
|
1053
|
+
#
|
1054
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1055
|
+
# client = Google::Cloud::Redis::V1::CloudRedis::Client.new
|
1056
|
+
#
|
1057
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1058
|
+
# request = Google::Cloud::Redis::V1::DeleteInstanceRequest.new
|
1059
|
+
#
|
1060
|
+
# # Call the delete_instance method.
|
1061
|
+
# result = client.delete_instance request
|
1062
|
+
#
|
1063
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
1064
|
+
# # object to check the status of an operation, cancel it, or wait
|
1065
|
+
# # for results. Here is how to block until completion:
|
1066
|
+
# result.wait_until_done! timeout: 60
|
1067
|
+
# if result.response?
|
1068
|
+
# p result.response
|
1069
|
+
# else
|
1070
|
+
# puts "Error!"
|
1071
|
+
# end
|
1072
|
+
#
|
856
1073
|
def delete_instance request, options = nil
|
857
1074
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
858
1075
|
|
@@ -870,16 +1087,20 @@ module Google
|
|
870
1087
|
gapic_version: ::Google::Cloud::Redis::V1::VERSION
|
871
1088
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
872
1089
|
|
873
|
-
header_params = {
|
874
|
-
|
875
|
-
|
1090
|
+
header_params = {}
|
1091
|
+
if request.name
|
1092
|
+
header_params["name"] = request.name
|
1093
|
+
end
|
1094
|
+
|
876
1095
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
877
1096
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
878
1097
|
|
879
1098
|
options.apply_defaults timeout: @config.rpcs.delete_instance.timeout,
|
880
1099
|
metadata: metadata,
|
881
1100
|
retry_policy: @config.rpcs.delete_instance.retry_policy
|
882
|
-
|
1101
|
+
|
1102
|
+
options.apply_defaults timeout: @config.timeout,
|
1103
|
+
metadata: @config.metadata,
|
883
1104
|
retry_policy: @config.retry_policy
|
884
1105
|
|
885
1106
|
@cloud_redis_stub.call_rpc :delete_instance, request, options: options do |response, operation|
|
@@ -904,22 +1125,21 @@ module Google
|
|
904
1125
|
# Configuration can be applied globally to all clients, or to a single client
|
905
1126
|
# on construction.
|
906
1127
|
#
|
907
|
-
#
|
908
|
-
#
|
909
|
-
#
|
910
|
-
# to 20 seconds,
|
911
|
-
#
|
912
|
-
#
|
913
|
-
#
|
914
|
-
#
|
915
|
-
#
|
916
|
-
#
|
917
|
-
#
|
918
|
-
#
|
919
|
-
#
|
920
|
-
#
|
921
|
-
#
|
922
|
-
# end
|
1128
|
+
# @example
|
1129
|
+
#
|
1130
|
+
# # Modify the global config, setting the timeout for
|
1131
|
+
# # list_instances to 20 seconds,
|
1132
|
+
# # and all remaining timeouts to 10 seconds.
|
1133
|
+
# ::Google::Cloud::Redis::V1::CloudRedis::Client.configure do |config|
|
1134
|
+
# config.timeout = 10.0
|
1135
|
+
# config.rpcs.list_instances.timeout = 20.0
|
1136
|
+
# end
|
1137
|
+
#
|
1138
|
+
# # Apply the above configuration only to a new client.
|
1139
|
+
# client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config|
|
1140
|
+
# config.timeout = 10.0
|
1141
|
+
# config.rpcs.list_instances.timeout = 20.0
|
1142
|
+
# end
|
923
1143
|
#
|
924
1144
|
# @!attribute [rw] endpoint
|
925
1145
|
# The hostname or hostname:port of the service endpoint.
|
@@ -82,7 +82,7 @@ module Google
|
|
82
82
|
# Create credentials
|
83
83
|
credentials = @config.credentials
|
84
84
|
credentials ||= Credentials.default scope: @config.scope
|
85
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
85
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
86
86
|
credentials = Credentials.new credentials, scope: @config.scope
|
87
87
|
end
|
88
88
|
@quota_project_id = @config.quota_project
|
@@ -143,6 +143,27 @@ module Google
|
|
143
143
|
#
|
144
144
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
145
145
|
#
|
146
|
+
# @example Basic example
|
147
|
+
# require "google/longrunning"
|
148
|
+
#
|
149
|
+
# # Create a client object. The client can be reused for multiple calls.
|
150
|
+
# client = Google::Longrunning::Operations::Client.new
|
151
|
+
#
|
152
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
153
|
+
# request = Google::Longrunning::ListOperationsRequest.new
|
154
|
+
#
|
155
|
+
# # Call the list_operations method.
|
156
|
+
# result = client.list_operations request
|
157
|
+
#
|
158
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
159
|
+
# # iterate over all elements by calling #each, and the enumerable
|
160
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
161
|
+
# # methods are also available for managing paging directly.
|
162
|
+
# result.each do |response|
|
163
|
+
# # Each element is of type ::Google::Longrunning::Operation.
|
164
|
+
# p response
|
165
|
+
# end
|
166
|
+
#
|
146
167
|
def list_operations request, options = nil
|
147
168
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
148
169
|
|
@@ -160,16 +181,20 @@ module Google
|
|
160
181
|
gapic_version: ::Google::Cloud::Redis::V1::VERSION
|
161
182
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
162
183
|
|
163
|
-
header_params = {
|
164
|
-
|
165
|
-
|
184
|
+
header_params = {}
|
185
|
+
if request.name
|
186
|
+
header_params["name"] = request.name
|
187
|
+
end
|
188
|
+
|
166
189
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
167
190
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
168
191
|
|
169
192
|
options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
|
170
193
|
metadata: metadata,
|
171
194
|
retry_policy: @config.rpcs.list_operations.retry_policy
|
172
|
-
|
195
|
+
|
196
|
+
options.apply_defaults timeout: @config.timeout,
|
197
|
+
metadata: @config.metadata,
|
173
198
|
retry_policy: @config.retry_policy
|
174
199
|
|
175
200
|
@operations_stub.call_rpc :list_operations, request, options: options do |response, operation|
|
@@ -213,6 +238,28 @@ module Google
|
|
213
238
|
#
|
214
239
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
215
240
|
#
|
241
|
+
# @example Basic example
|
242
|
+
# require "google/longrunning"
|
243
|
+
#
|
244
|
+
# # Create a client object. The client can be reused for multiple calls.
|
245
|
+
# client = Google::Longrunning::Operations::Client.new
|
246
|
+
#
|
247
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
248
|
+
# request = Google::Longrunning::GetOperationRequest.new
|
249
|
+
#
|
250
|
+
# # Call the get_operation method.
|
251
|
+
# result = client.get_operation request
|
252
|
+
#
|
253
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
254
|
+
# # object to check the status of an operation, cancel it, or wait
|
255
|
+
# # for results. Here is how to block until completion:
|
256
|
+
# result.wait_until_done! timeout: 60
|
257
|
+
# if result.response?
|
258
|
+
# p result.response
|
259
|
+
# else
|
260
|
+
# puts "Error!"
|
261
|
+
# end
|
262
|
+
#
|
216
263
|
def get_operation request, options = nil
|
217
264
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
218
265
|
|
@@ -230,16 +277,20 @@ module Google
|
|
230
277
|
gapic_version: ::Google::Cloud::Redis::V1::VERSION
|
231
278
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
232
279
|
|
233
|
-
header_params = {
|
234
|
-
|
235
|
-
|
280
|
+
header_params = {}
|
281
|
+
if request.name
|
282
|
+
header_params["name"] = request.name
|
283
|
+
end
|
284
|
+
|
236
285
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
237
286
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
238
287
|
|
239
288
|
options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
|
240
289
|
metadata: metadata,
|
241
290
|
retry_policy: @config.rpcs.get_operation.retry_policy
|
242
|
-
|
291
|
+
|
292
|
+
options.apply_defaults timeout: @config.timeout,
|
293
|
+
metadata: @config.metadata,
|
243
294
|
retry_policy: @config.retry_policy
|
244
295
|
|
245
296
|
@operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
|
@@ -283,6 +334,21 @@ module Google
|
|
283
334
|
#
|
284
335
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
285
336
|
#
|
337
|
+
# @example Basic example
|
338
|
+
# require "google/longrunning"
|
339
|
+
#
|
340
|
+
# # Create a client object. The client can be reused for multiple calls.
|
341
|
+
# client = Google::Longrunning::Operations::Client.new
|
342
|
+
#
|
343
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
344
|
+
# request = Google::Longrunning::DeleteOperationRequest.new
|
345
|
+
#
|
346
|
+
# # Call the delete_operation method.
|
347
|
+
# result = client.delete_operation request
|
348
|
+
#
|
349
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
350
|
+
# p result
|
351
|
+
#
|
286
352
|
def delete_operation request, options = nil
|
287
353
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
288
354
|
|
@@ -300,16 +366,20 @@ module Google
|
|
300
366
|
gapic_version: ::Google::Cloud::Redis::V1::VERSION
|
301
367
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
302
368
|
|
303
|
-
header_params = {
|
304
|
-
|
305
|
-
|
369
|
+
header_params = {}
|
370
|
+
if request.name
|
371
|
+
header_params["name"] = request.name
|
372
|
+
end
|
373
|
+
|
306
374
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
307
375
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
308
376
|
|
309
377
|
options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
|
310
378
|
metadata: metadata,
|
311
379
|
retry_policy: @config.rpcs.delete_operation.retry_policy
|
312
|
-
|
380
|
+
|
381
|
+
options.apply_defaults timeout: @config.timeout,
|
382
|
+
metadata: @config.metadata,
|
313
383
|
retry_policy: @config.retry_policy
|
314
384
|
|
315
385
|
@operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
|
@@ -358,6 +428,21 @@ module Google
|
|
358
428
|
#
|
359
429
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
360
430
|
#
|
431
|
+
# @example Basic example
|
432
|
+
# require "google/longrunning"
|
433
|
+
#
|
434
|
+
# # Create a client object. The client can be reused for multiple calls.
|
435
|
+
# client = Google::Longrunning::Operations::Client.new
|
436
|
+
#
|
437
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
438
|
+
# request = Google::Longrunning::CancelOperationRequest.new
|
439
|
+
#
|
440
|
+
# # Call the cancel_operation method.
|
441
|
+
# result = client.cancel_operation request
|
442
|
+
#
|
443
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
444
|
+
# p result
|
445
|
+
#
|
361
446
|
def cancel_operation request, options = nil
|
362
447
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
363
448
|
|
@@ -375,16 +460,20 @@ module Google
|
|
375
460
|
gapic_version: ::Google::Cloud::Redis::V1::VERSION
|
376
461
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
377
462
|
|
378
|
-
header_params = {
|
379
|
-
|
380
|
-
|
463
|
+
header_params = {}
|
464
|
+
if request.name
|
465
|
+
header_params["name"] = request.name
|
466
|
+
end
|
467
|
+
|
381
468
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
382
469
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
383
470
|
|
384
471
|
options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
|
385
472
|
metadata: metadata,
|
386
473
|
retry_policy: @config.rpcs.cancel_operation.retry_policy
|
387
|
-
|
474
|
+
|
475
|
+
options.apply_defaults timeout: @config.timeout,
|
476
|
+
metadata: @config.metadata,
|
388
477
|
retry_policy: @config.retry_policy
|
389
478
|
|
390
479
|
@operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
|
@@ -396,9 +485,9 @@ module Google
|
|
396
485
|
end
|
397
486
|
|
398
487
|
##
|
399
|
-
# Waits
|
400
|
-
#
|
401
|
-
#
|
488
|
+
# Waits until the specified long-running operation is done or reaches at most
|
489
|
+
# a specified timeout, returning the latest state. If the operation is
|
490
|
+
# already done, the latest state is immediately returned. If the timeout
|
402
491
|
# specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
|
403
492
|
# timeout is used. If the server does not support this method, it returns
|
404
493
|
# `google.rpc.Code.UNIMPLEMENTED`.
|
@@ -436,6 +525,28 @@ module Google
|
|
436
525
|
#
|
437
526
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
438
527
|
#
|
528
|
+
# @example Basic example
|
529
|
+
# require "google/longrunning"
|
530
|
+
#
|
531
|
+
# # Create a client object. The client can be reused for multiple calls.
|
532
|
+
# client = Google::Longrunning::Operations::Client.new
|
533
|
+
#
|
534
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
535
|
+
# request = Google::Longrunning::WaitOperationRequest.new
|
536
|
+
#
|
537
|
+
# # Call the wait_operation method.
|
538
|
+
# result = client.wait_operation request
|
539
|
+
#
|
540
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
541
|
+
# # object to check the status of an operation, cancel it, or wait
|
542
|
+
# # for results. Here is how to block until completion:
|
543
|
+
# result.wait_until_done! timeout: 60
|
544
|
+
# if result.response?
|
545
|
+
# p result.response
|
546
|
+
# else
|
547
|
+
# puts "Error!"
|
548
|
+
# end
|
549
|
+
#
|
439
550
|
def wait_operation request, options = nil
|
440
551
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
441
552
|
|
@@ -456,7 +567,9 @@ module Google
|
|
456
567
|
options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
|
457
568
|
metadata: metadata,
|
458
569
|
retry_policy: @config.rpcs.wait_operation.retry_policy
|
459
|
-
|
570
|
+
|
571
|
+
options.apply_defaults timeout: @config.timeout,
|
572
|
+
metadata: @config.metadata,
|
460
573
|
retry_policy: @config.retry_policy
|
461
574
|
|
462
575
|
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
@@ -481,22 +594,21 @@ module Google
|
|
481
594
|
# Configuration can be applied globally to all clients, or to a single client
|
482
595
|
# on construction.
|
483
596
|
#
|
484
|
-
#
|
485
|
-
#
|
486
|
-
#
|
487
|
-
# to 20 seconds,
|
488
|
-
#
|
489
|
-
#
|
490
|
-
#
|
491
|
-
#
|
492
|
-
#
|
493
|
-
#
|
494
|
-
#
|
495
|
-
#
|
496
|
-
#
|
497
|
-
#
|
498
|
-
#
|
499
|
-
# end
|
597
|
+
# @example
|
598
|
+
#
|
599
|
+
# # Modify the global config, setting the timeout for
|
600
|
+
# # list_operations to 20 seconds,
|
601
|
+
# # and all remaining timeouts to 10 seconds.
|
602
|
+
# ::Google::Longrunning::Operations::Client.configure do |config|
|
603
|
+
# config.timeout = 10.0
|
604
|
+
# config.rpcs.list_operations.timeout = 20.0
|
605
|
+
# end
|
606
|
+
#
|
607
|
+
# # Apply the above configuration only to a new client.
|
608
|
+
# client = ::Google::Longrunning::Operations::Client.new do |config|
|
609
|
+
# config.timeout = 10.0
|
610
|
+
# config.rpcs.list_operations.timeout = 20.0
|
611
|
+
# end
|
500
612
|
#
|
501
613
|
# @!attribute [rw] endpoint
|
502
614
|
# The hostname or hostname:port of the service endpoint.
|
@@ -1,8 +1,6 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# source: google/cloud/redis/v1/cloud_redis.proto
|
3
3
|
|
4
|
-
require 'google/protobuf'
|
5
|
-
|
6
4
|
require 'google/api/annotations_pb'
|
7
5
|
require 'google/api/client_pb'
|
8
6
|
require 'google/api/field_behavior_pb'
|
@@ -10,8 +8,14 @@ require 'google/api/resource_pb'
|
|
10
8
|
require 'google/longrunning/operations_pb'
|
11
9
|
require 'google/protobuf/field_mask_pb'
|
12
10
|
require 'google/protobuf/timestamp_pb'
|
11
|
+
require 'google/protobuf'
|
12
|
+
|
13
13
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
14
14
|
add_file("google/cloud/redis/v1/cloud_redis.proto", :syntax => :proto3) do
|
15
|
+
add_message "google.cloud.redis.v1.NodeInfo" do
|
16
|
+
optional :id, :string, 1
|
17
|
+
optional :zone, :string, 2
|
18
|
+
end
|
15
19
|
add_message "google.cloud.redis.v1.Instance" do
|
16
20
|
optional :name, :string, 1
|
17
21
|
optional :display_name, :string, 2
|
@@ -32,6 +36,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
32
36
|
optional :authorized_network, :string, 20
|
33
37
|
optional :persistence_iam_identity, :string, 21
|
34
38
|
optional :connect_mode, :enum, 22, "google.cloud.redis.v1.Instance.ConnectMode"
|
39
|
+
optional :replica_count, :int32, 31
|
40
|
+
repeated :nodes, :message, 32, "google.cloud.redis.v1.NodeInfo"
|
41
|
+
optional :read_endpoint, :string, 33
|
42
|
+
optional :read_endpoint_port, :int32, 34
|
43
|
+
optional :read_replicas_mode, :enum, 35, "google.cloud.redis.v1.Instance.ReadReplicasMode"
|
35
44
|
end
|
36
45
|
add_enum "google.cloud.redis.v1.Instance.State" do
|
37
46
|
value :STATE_UNSPECIFIED, 0
|
@@ -54,6 +63,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
54
63
|
value :DIRECT_PEERING, 1
|
55
64
|
value :PRIVATE_SERVICE_ACCESS, 2
|
56
65
|
end
|
66
|
+
add_enum "google.cloud.redis.v1.Instance.ReadReplicasMode" do
|
67
|
+
value :READ_REPLICAS_MODE_UNSPECIFIED, 0
|
68
|
+
value :READ_REPLICAS_DISABLED, 1
|
69
|
+
value :READ_REPLICAS_ENABLED, 2
|
70
|
+
end
|
57
71
|
add_message "google.cloud.redis.v1.ListInstancesRequest" do
|
58
72
|
optional :parent, :string, 1
|
59
73
|
optional :page_size, :int32, 2
|
@@ -137,10 +151,12 @@ module Google
|
|
137
151
|
module Cloud
|
138
152
|
module Redis
|
139
153
|
module V1
|
154
|
+
NodeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.NodeInfo").msgclass
|
140
155
|
Instance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance").msgclass
|
141
156
|
Instance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance.State").enummodule
|
142
157
|
Instance::Tier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance.Tier").enummodule
|
143
158
|
Instance::ConnectMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance.ConnectMode").enummodule
|
159
|
+
Instance::ReadReplicasMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance.ReadReplicasMode").enummodule
|
144
160
|
ListInstancesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.ListInstancesRequest").msgclass
|
145
161
|
ListInstancesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.ListInstancesResponse").msgclass
|
146
162
|
GetInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.GetInstanceRequest").msgclass
|
@@ -41,7 +41,7 @@ module Google
|
|
41
41
|
# * `projects/redpepper-1290/locations/us-central1/instances/my-redis`
|
42
42
|
class Service
|
43
43
|
|
44
|
-
include GRPC::GenericService
|
44
|
+
include ::GRPC::GenericService
|
45
45
|
|
46
46
|
self.marshal_class_method = :encode
|
47
47
|
self.unmarshal_class_method = :decode
|
@@ -97,7 +97,7 @@ module Google
|
|
97
97
|
# The returned operation is automatically deleted after a few hours, so
|
98
98
|
# there is no need to call DeleteOperation.
|
99
99
|
rpc :ExportInstance, ::Google::Cloud::Redis::V1::ExportInstanceRequest, ::Google::Longrunning::Operation
|
100
|
-
# Initiates a failover of the
|
100
|
+
# Initiates a failover of the primary node to current replica node for a
|
101
101
|
# specific STANDARD tier Cloud Memorystore for Redis instance.
|
102
102
|
rpc :FailoverInstance, ::Google::Cloud::Redis::V1::FailoverInstanceRequest, ::Google::Longrunning::Operation
|
103
103
|
# Deletes a specific Redis instance. Instance stops serving and data is
|
@@ -57,9 +57,15 @@ module Google
|
|
57
57
|
|
58
58
|
# Denotes that a (repeated) field is an unordered list.
|
59
59
|
# This indicates that the service may provide the elements of the list
|
60
|
-
# in any arbitrary
|
60
|
+
# in any arbitrary order, rather than the order the user originally
|
61
61
|
# provided. Additionally, the list's order may or may not be stable.
|
62
62
|
UNORDERED_LIST = 6
|
63
|
+
|
64
|
+
# Denotes that this field returns a non-empty default value if not set.
|
65
|
+
# This indicates that if the user provides the empty value in a request,
|
66
|
+
# a non-empty value will be returned. The user will not be aware of what
|
67
|
+
# non-empty value to expect.
|
68
|
+
NON_EMPTY_DEFAULT = 7
|
63
69
|
end
|
64
70
|
end
|
65
71
|
end
|
@@ -21,6 +21,18 @@ module Google
|
|
21
21
|
module Cloud
|
22
22
|
module Redis
|
23
23
|
module V1
|
24
|
+
# Node specific properties.
|
25
|
+
# @!attribute [r] id
|
26
|
+
# @return [::String]
|
27
|
+
# Output only. Node identifying string. e.g. 'node-0', 'node-1'
|
28
|
+
# @!attribute [r] zone
|
29
|
+
# @return [::String]
|
30
|
+
# Output only. Location of the node.
|
31
|
+
class NodeInfo
|
32
|
+
include ::Google::Protobuf::MessageExts
|
33
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
34
|
+
end
|
35
|
+
|
24
36
|
# A Google Cloud Redis instance.
|
25
37
|
# @!attribute [rw] name
|
26
38
|
# @return [::String]
|
@@ -42,15 +54,17 @@ module Google
|
|
42
54
|
# @!attribute [rw] location_id
|
43
55
|
# @return [::String]
|
44
56
|
# Optional. The zone where the instance will be provisioned. If not provided,
|
45
|
-
# the service will choose a zone for the instance.
|
46
|
-
#
|
47
|
-
# failures. If
|
48
|
-
#
|
57
|
+
# the service will choose a zone from the specified region for the instance.
|
58
|
+
# For standard tier, additional nodes will be added across multiple zones for
|
59
|
+
# protection against zonal failures. If specified, at least one node will be
|
60
|
+
# provisioned in this zone.
|
49
61
|
# @!attribute [rw] alternative_location_id
|
50
62
|
# @return [::String]
|
51
|
-
# Optional.
|
52
|
-
#
|
53
|
-
# must be a different zone from the one
|
63
|
+
# Optional. If specified, at least one node will be provisioned in this zone
|
64
|
+
# in addition to the zone specified in location_id. Only applicable to
|
65
|
+
# standard tier. If provided, it must be a different zone from the one
|
66
|
+
# provided in [location_id]. Additional nodes beyond the first 2 will be
|
67
|
+
# placed in zones selected by the service.
|
54
68
|
# @!attribute [rw] redis_version
|
55
69
|
# @return [::String]
|
56
70
|
# Optional. The version of Redis software.
|
@@ -60,12 +74,17 @@ module Google
|
|
60
74
|
# * `REDIS_3_2` for Redis 3.2 compatibility
|
61
75
|
# * `REDIS_4_0` for Redis 4.0 compatibility (default)
|
62
76
|
# * `REDIS_5_0` for Redis 5.0 compatibility
|
77
|
+
# * `REDIS_6_X` for Redis 6.x compatibility
|
63
78
|
# @!attribute [rw] reserved_ip_range
|
64
79
|
# @return [::String]
|
65
|
-
# Optional.
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
80
|
+
# Optional. For DIRECT_PEERING mode, the CIDR range of internal addresses
|
81
|
+
# that are reserved for this instance. Range must
|
82
|
+
# be unique and non-overlapping with existing subnets in an authorized
|
83
|
+
# network. For PRIVATE_SERVICE_ACCESS mode, the name of one allocated IP
|
84
|
+
# address ranges associated with this private service access connection.
|
85
|
+
# If not provided, the service will choose an unused /29 block, for
|
86
|
+
# example, 10.0.0.0/29 or 192.168.0.0/29. For READ_REPLICAS_ENABLED
|
87
|
+
# the default block size is /28.
|
69
88
|
# @!attribute [r] host
|
70
89
|
# @return [::String]
|
71
90
|
# Output only. Hostname or IP address of the exposed Redis endpoint used by
|
@@ -75,11 +94,9 @@ module Google
|
|
75
94
|
# Output only. The port number of the exposed Redis endpoint.
|
76
95
|
# @!attribute [r] current_location_id
|
77
96
|
# @return [::String]
|
78
|
-
# Output only. The current zone where the Redis
|
79
|
-
#
|
80
|
-
#
|
81
|
-
# this can be either {::Google::Cloud::Redis::V1::Instance#location_id location_id} or {::Google::Cloud::Redis::V1::Instance#alternative_location_id alternative_location_id} and can
|
82
|
-
# change after a failover event.
|
97
|
+
# Output only. The current zone where the Redis primary node is located. In
|
98
|
+
# basic tier, this will always be the same as [location_id]. In
|
99
|
+
# standard tier, this can be the zone of any node in the instance.
|
83
100
|
# @!attribute [r] create_time
|
84
101
|
# @return [::Google::Protobuf::Timestamp]
|
85
102
|
# Output only. The time the instance was created.
|
@@ -135,6 +152,27 @@ module Google
|
|
135
152
|
# @return [::Google::Cloud::Redis::V1::Instance::ConnectMode]
|
136
153
|
# Optional. The network connect mode of the Redis instance.
|
137
154
|
# If not provided, the connect mode defaults to DIRECT_PEERING.
|
155
|
+
# @!attribute [rw] replica_count
|
156
|
+
# @return [::Integer]
|
157
|
+
# Optional. The number of replica nodes. Valid range for standard tier
|
158
|
+
# is [1-5] and defaults to 1. Valid value for basic tier is 0 and defaults
|
159
|
+
# to 0.
|
160
|
+
# @!attribute [r] nodes
|
161
|
+
# @return [::Array<::Google::Cloud::Redis::V1::NodeInfo>]
|
162
|
+
# Output only. Info per node.
|
163
|
+
# @!attribute [r] read_endpoint
|
164
|
+
# @return [::String]
|
165
|
+
# Output only. Hostname or IP address of the exposed readonly Redis
|
166
|
+
# endpoint. Standard tier only. Targets all healthy replica nodes in
|
167
|
+
# instance. Replication is asynchronous and replica nodes will exhibit some
|
168
|
+
# lag behind the primary. Write requests must target 'host'.
|
169
|
+
# @!attribute [r] read_endpoint_port
|
170
|
+
# @return [::Integer]
|
171
|
+
# Output only. The port number of the exposed readonly redis
|
172
|
+
# endpoint. Standard tier only. Write requests should target 'port'.
|
173
|
+
# @!attribute [rw] read_replicas_mode
|
174
|
+
# @return [::Google::Cloud::Redis::V1::Instance::ReadReplicasMode]
|
175
|
+
# Optional. Read replica mode.
|
138
176
|
class Instance
|
139
177
|
include ::Google::Protobuf::MessageExts
|
140
178
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -214,6 +252,21 @@ module Google
|
|
214
252
|
# Google Cloud services, including Memorystore.
|
215
253
|
PRIVATE_SERVICE_ACCESS = 2
|
216
254
|
end
|
255
|
+
|
256
|
+
# Read replicas mode.
|
257
|
+
module ReadReplicasMode
|
258
|
+
# If not set, Memorystore Redis backend will pick the mode based on other fields in
|
259
|
+
# the request.
|
260
|
+
READ_REPLICAS_MODE_UNSPECIFIED = 0
|
261
|
+
|
262
|
+
# If disabled, read endpoint will not be provided and the instance cannot
|
263
|
+
# scale up or down the number of replicas.
|
264
|
+
READ_REPLICAS_DISABLED = 1
|
265
|
+
|
266
|
+
# If enabled, read endpoint will be provided and the instance can scale
|
267
|
+
# up and down the number of replicas.
|
268
|
+
READ_REPLICAS_ENABLED = 2
|
269
|
+
end
|
217
270
|
end
|
218
271
|
|
219
272
|
# Request for {::Google::Cloud::Redis::V1::CloudRedis::Client#list_instances ListInstances}.
|
@@ -248,11 +301,12 @@ module Google
|
|
248
301
|
#
|
249
302
|
# If the `location_id` in the parent field of the request is "-", all regions
|
250
303
|
# available to the project are queried, and the results aggregated.
|
251
|
-
# If in such an aggregated query a location is unavailable, a
|
252
|
-
# entry is included in the response with the `name` field set to a
|
253
|
-
# the form
|
254
|
-
#
|
255
|
-
#
|
304
|
+
# If in such an aggregated query a location is unavailable, a placeholder
|
305
|
+
# Redis entry is included in the response with the `name` field set to a
|
306
|
+
# value of the form
|
307
|
+
# `projects/{project_id}/locations/{location_id}/instances/`- and the
|
308
|
+
# `status` field set to ERROR and `status_message` field set to "location not
|
309
|
+
# available for ListInstances".
|
256
310
|
# @!attribute [rw] next_page_token
|
257
311
|
# @return [::String]
|
258
312
|
# Token to retrieve the next page of results, or empty if there are no more
|
@@ -311,6 +365,7 @@ module Google
|
|
311
365
|
# * `labels`
|
312
366
|
# * `memorySizeGb`
|
313
367
|
# * `redisConfig`
|
368
|
+
# * `replica_count`
|
314
369
|
# @!attribute [rw] instance
|
315
370
|
# @return [::Google::Cloud::Redis::V1::Instance]
|
316
371
|
# Required. Update description.
|
@@ -432,7 +487,7 @@ module Google
|
|
432
487
|
|
433
488
|
# Instance failover will be protected with data loss control. More
|
434
489
|
# specifically, the failover will only be performed if the current
|
435
|
-
# replication offset diff between
|
490
|
+
# replication offset diff between primary and replica is under a certain
|
436
491
|
# threshold.
|
437
492
|
LIMITED_DATA_LOSS = 1
|
438
493
|
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-redis-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.7'
|
20
|
+
- - "<"
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
22
|
+
version: 2.a
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.7'
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
32
|
+
version: 2.a
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: google-cloud-errors
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -203,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
203
209
|
- !ruby/object:Gem::Version
|
204
210
|
version: '0'
|
205
211
|
requirements: []
|
206
|
-
rubygems_version: 3.2.
|
212
|
+
rubygems_version: 3.2.17
|
207
213
|
signing_key:
|
208
214
|
specification_version: 4
|
209
215
|
summary: API Client library for the Google Cloud Memorystore for Redis V1 API
|