google-cloud-redis-v1beta1 0.4.2 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/AUTHENTICATION.md +7 -25
- data/lib/google/cloud/redis/v1beta1/cloud_redis/client.rb +298 -76
- data/lib/google/cloud/redis/v1beta1/cloud_redis/operations.rb +145 -33
- data/lib/google/cloud/redis/v1beta1/cloud_redis.rb +1 -1
- data/lib/google/cloud/redis/v1beta1/cloud_redis_pb.rb +18 -2
- data/lib/google/cloud/redis/v1beta1/cloud_redis_services_pb.rb +4 -4
- data/lib/google/cloud/redis/v1beta1/version.rb +1 -1
- data/proto_docs/google/api/resource.rb +10 -71
- data/proto_docs/google/cloud/redis/v1beta1/cloud_redis.rb +104 -39
- metadata +5 -5
@@ -40,7 +40,7 @@ module Google
|
|
40
40
|
# * As such, Redis instances are resources of the form:
|
41
41
|
# `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
|
42
42
|
#
|
43
|
-
# Note that location_id must be
|
43
|
+
# Note that location_id must be referring to a GCP `region`; for example:
|
44
44
|
# * `projects/redpepper-1290/locations/us-central1/instances/my-redis`
|
45
45
|
#
|
46
46
|
class Client
|
@@ -55,13 +55,12 @@ module Google
|
|
55
55
|
# See {::Google::Cloud::Redis::V1beta1::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::V1beta1::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::V1beta1::CloudRedis::Client.new
|
128
|
+
# @example
|
135
129
|
#
|
136
|
-
#
|
137
|
-
#
|
130
|
+
# # Create a client using the default configuration
|
131
|
+
# client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
|
138
132
|
#
|
139
|
-
#
|
140
|
-
#
|
141
|
-
#
|
133
|
+
# # Create a client using a custom configuration
|
134
|
+
# client = ::Google::Cloud::Redis::V1beta1::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,10 +153,9 @@ 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
|
@@ -173,6 +167,7 @@ module Google
|
|
173
167
|
|
174
168
|
@operations_client = Operations.new do |config|
|
175
169
|
config.credentials = credentials
|
170
|
+
config.quota_project = @quota_project_id
|
176
171
|
config.endpoint = @config.endpoint
|
177
172
|
end
|
178
173
|
|
@@ -234,7 +229,8 @@ module Google
|
|
234
229
|
# to determine if there are more instances left to be queried.
|
235
230
|
# @param page_token [::String]
|
236
231
|
# The `next_page_token` value returned from a previous
|
237
|
-
# {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances ListInstances}
|
232
|
+
# {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances ListInstances}
|
233
|
+
# request, if any.
|
238
234
|
#
|
239
235
|
# @yield [response, operation] Access the result along with the RPC operation
|
240
236
|
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::V1beta1::Instance>]
|
@@ -244,6 +240,27 @@ module Google
|
|
244
240
|
#
|
245
241
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
246
242
|
#
|
243
|
+
# @example Basic example
|
244
|
+
# require "google/cloud/redis/v1beta1"
|
245
|
+
#
|
246
|
+
# # Create a client object. The client can be reused for multiple calls.
|
247
|
+
# client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
|
248
|
+
#
|
249
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
250
|
+
# request = Google::Cloud::Redis::V1beta1::ListInstancesRequest.new
|
251
|
+
#
|
252
|
+
# # Call the list_instances method.
|
253
|
+
# result = client.list_instances request
|
254
|
+
#
|
255
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
256
|
+
# # iterate over all elements by calling #each, and the enumerable
|
257
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
258
|
+
# # methods are also available for managing paging directly.
|
259
|
+
# result.each do |response|
|
260
|
+
# # Each element is of type ::Google::Cloud::Redis::V1beta1::Instance.
|
261
|
+
# p response
|
262
|
+
# end
|
263
|
+
#
|
247
264
|
def list_instances request, options = nil
|
248
265
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
249
266
|
|
@@ -261,16 +278,20 @@ module Google
|
|
261
278
|
gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
|
262
279
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
263
280
|
|
264
|
-
header_params = {
|
265
|
-
|
266
|
-
|
281
|
+
header_params = {}
|
282
|
+
if request.parent
|
283
|
+
header_params["parent"] = request.parent
|
284
|
+
end
|
285
|
+
|
267
286
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
268
287
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
269
288
|
|
270
289
|
options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
|
271
290
|
metadata: metadata,
|
272
291
|
retry_policy: @config.rpcs.list_instances.retry_policy
|
273
|
-
|
292
|
+
|
293
|
+
options.apply_defaults timeout: @config.timeout,
|
294
|
+
metadata: @config.metadata,
|
274
295
|
retry_policy: @config.retry_policy
|
275
296
|
|
276
297
|
@cloud_redis_stub.call_rpc :list_instances, request, options: options do |response, operation|
|
@@ -313,6 +334,21 @@ module Google
|
|
313
334
|
#
|
314
335
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
315
336
|
#
|
337
|
+
# @example Basic example
|
338
|
+
# require "google/cloud/redis/v1beta1"
|
339
|
+
#
|
340
|
+
# # Create a client object. The client can be reused for multiple calls.
|
341
|
+
# client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
|
342
|
+
#
|
343
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
344
|
+
# request = Google::Cloud::Redis::V1beta1::GetInstanceRequest.new
|
345
|
+
#
|
346
|
+
# # Call the get_instance method.
|
347
|
+
# result = client.get_instance request
|
348
|
+
#
|
349
|
+
# # The returned object is of type Google::Cloud::Redis::V1beta1::Instance.
|
350
|
+
# p result
|
351
|
+
#
|
316
352
|
def get_instance request, options = nil
|
317
353
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
318
354
|
|
@@ -330,16 +366,20 @@ module Google
|
|
330
366
|
gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
|
331
367
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
332
368
|
|
333
|
-
header_params = {
|
334
|
-
|
335
|
-
|
369
|
+
header_params = {}
|
370
|
+
if request.name
|
371
|
+
header_params["name"] = request.name
|
372
|
+
end
|
373
|
+
|
336
374
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
337
375
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
338
376
|
|
339
377
|
options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
|
340
378
|
metadata: metadata,
|
341
379
|
retry_policy: @config.rpcs.get_instance.retry_policy
|
342
|
-
|
380
|
+
|
381
|
+
options.apply_defaults timeout: @config.timeout,
|
382
|
+
metadata: @config.metadata,
|
343
383
|
retry_policy: @config.retry_policy
|
344
384
|
|
345
385
|
@cloud_redis_stub.call_rpc :get_instance, request, options: options do |response, operation|
|
@@ -358,7 +398,7 @@ module Google
|
|
358
398
|
#
|
359
399
|
# The creation is executed asynchronously and callers may check the returned
|
360
400
|
# operation to track its progress. Once the operation is completed the Redis
|
361
|
-
# instance will be fully functional.
|
401
|
+
# instance will be fully functional. The completed longrunning.Operation will
|
362
402
|
# contain the new instance object in the response field.
|
363
403
|
#
|
364
404
|
# The returned operation is automatically deleted after a few hours, so there
|
@@ -403,6 +443,28 @@ module Google
|
|
403
443
|
#
|
404
444
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
405
445
|
#
|
446
|
+
# @example Basic example
|
447
|
+
# require "google/cloud/redis/v1beta1"
|
448
|
+
#
|
449
|
+
# # Create a client object. The client can be reused for multiple calls.
|
450
|
+
# client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
|
451
|
+
#
|
452
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
453
|
+
# request = Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new
|
454
|
+
#
|
455
|
+
# # Call the create_instance method.
|
456
|
+
# result = client.create_instance request
|
457
|
+
#
|
458
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
459
|
+
# # object to check the status of an operation, cancel it, or wait
|
460
|
+
# # for results. Here is how to block until completion:
|
461
|
+
# result.wait_until_done! timeout: 60
|
462
|
+
# if result.response?
|
463
|
+
# p result.response
|
464
|
+
# else
|
465
|
+
# puts "Error!"
|
466
|
+
# end
|
467
|
+
#
|
406
468
|
def create_instance request, options = nil
|
407
469
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
408
470
|
|
@@ -420,16 +482,20 @@ module Google
|
|
420
482
|
gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
|
421
483
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
422
484
|
|
423
|
-
header_params = {
|
424
|
-
|
425
|
-
|
485
|
+
header_params = {}
|
486
|
+
if request.parent
|
487
|
+
header_params["parent"] = request.parent
|
488
|
+
end
|
489
|
+
|
426
490
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
427
491
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
428
492
|
|
429
493
|
options.apply_defaults timeout: @config.rpcs.create_instance.timeout,
|
430
494
|
metadata: metadata,
|
431
495
|
retry_policy: @config.rpcs.create_instance.retry_policy
|
432
|
-
|
496
|
+
|
497
|
+
options.apply_defaults timeout: @config.timeout,
|
498
|
+
metadata: @config.metadata,
|
433
499
|
retry_policy: @config.retry_policy
|
434
500
|
|
435
501
|
@cloud_redis_stub.call_rpc :create_instance, request, options: options do |response, operation|
|
@@ -472,6 +538,7 @@ module Google
|
|
472
538
|
# * `labels`
|
473
539
|
# * `memorySizeGb`
|
474
540
|
# * `redisConfig`
|
541
|
+
# * `replica_count`
|
475
542
|
# @param instance [::Google::Cloud::Redis::V1beta1::Instance, ::Hash]
|
476
543
|
# Required. Update description.
|
477
544
|
# Only fields specified in update_mask are updated.
|
@@ -484,6 +551,28 @@ module Google
|
|
484
551
|
#
|
485
552
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
486
553
|
#
|
554
|
+
# @example Basic example
|
555
|
+
# require "google/cloud/redis/v1beta1"
|
556
|
+
#
|
557
|
+
# # Create a client object. The client can be reused for multiple calls.
|
558
|
+
# client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
|
559
|
+
#
|
560
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
561
|
+
# request = Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new
|
562
|
+
#
|
563
|
+
# # Call the update_instance method.
|
564
|
+
# result = client.update_instance request
|
565
|
+
#
|
566
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
567
|
+
# # object to check the status of an operation, cancel it, or wait
|
568
|
+
# # for results. Here is how to block until completion:
|
569
|
+
# result.wait_until_done! timeout: 60
|
570
|
+
# if result.response?
|
571
|
+
# p result.response
|
572
|
+
# else
|
573
|
+
# puts "Error!"
|
574
|
+
# end
|
575
|
+
#
|
487
576
|
def update_instance request, options = nil
|
488
577
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
489
578
|
|
@@ -501,16 +590,20 @@ module Google
|
|
501
590
|
gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
|
502
591
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
503
592
|
|
504
|
-
header_params = {
|
505
|
-
|
506
|
-
|
593
|
+
header_params = {}
|
594
|
+
if request.instance&.name
|
595
|
+
header_params["instance.name"] = request.instance.name
|
596
|
+
end
|
597
|
+
|
507
598
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
508
599
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
509
600
|
|
510
601
|
options.apply_defaults timeout: @config.rpcs.update_instance.timeout,
|
511
602
|
metadata: metadata,
|
512
603
|
retry_policy: @config.rpcs.update_instance.retry_policy
|
513
|
-
|
604
|
+
|
605
|
+
options.apply_defaults timeout: @config.timeout,
|
606
|
+
metadata: @config.metadata,
|
514
607
|
retry_policy: @config.retry_policy
|
515
608
|
|
516
609
|
@cloud_redis_stub.call_rpc :update_instance, request, options: options do |response, operation|
|
@@ -556,6 +649,28 @@ module Google
|
|
556
649
|
#
|
557
650
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
558
651
|
#
|
652
|
+
# @example Basic example
|
653
|
+
# require "google/cloud/redis/v1beta1"
|
654
|
+
#
|
655
|
+
# # Create a client object. The client can be reused for multiple calls.
|
656
|
+
# client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
|
657
|
+
#
|
658
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
659
|
+
# request = Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new
|
660
|
+
#
|
661
|
+
# # Call the upgrade_instance method.
|
662
|
+
# result = client.upgrade_instance request
|
663
|
+
#
|
664
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
665
|
+
# # object to check the status of an operation, cancel it, or wait
|
666
|
+
# # for results. Here is how to block until completion:
|
667
|
+
# result.wait_until_done! timeout: 60
|
668
|
+
# if result.response?
|
669
|
+
# p result.response
|
670
|
+
# else
|
671
|
+
# puts "Error!"
|
672
|
+
# end
|
673
|
+
#
|
559
674
|
def upgrade_instance request, options = nil
|
560
675
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
561
676
|
|
@@ -573,16 +688,20 @@ module Google
|
|
573
688
|
gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
|
574
689
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
575
690
|
|
576
|
-
header_params = {
|
577
|
-
|
578
|
-
|
691
|
+
header_params = {}
|
692
|
+
if request.name
|
693
|
+
header_params["name"] = request.name
|
694
|
+
end
|
695
|
+
|
579
696
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
580
697
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
581
698
|
|
582
699
|
options.apply_defaults timeout: @config.rpcs.upgrade_instance.timeout,
|
583
700
|
metadata: metadata,
|
584
701
|
retry_policy: @config.rpcs.upgrade_instance.retry_policy
|
585
|
-
|
702
|
+
|
703
|
+
options.apply_defaults timeout: @config.timeout,
|
704
|
+
metadata: @config.metadata,
|
586
705
|
retry_policy: @config.retry_policy
|
587
706
|
|
588
707
|
@cloud_redis_stub.call_rpc :upgrade_instance, request, options: options do |response, operation|
|
@@ -634,6 +753,28 @@ module Google
|
|
634
753
|
#
|
635
754
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
636
755
|
#
|
756
|
+
# @example Basic example
|
757
|
+
# require "google/cloud/redis/v1beta1"
|
758
|
+
#
|
759
|
+
# # Create a client object. The client can be reused for multiple calls.
|
760
|
+
# client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
|
761
|
+
#
|
762
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
763
|
+
# request = Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new
|
764
|
+
#
|
765
|
+
# # Call the import_instance method.
|
766
|
+
# result = client.import_instance request
|
767
|
+
#
|
768
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
769
|
+
# # object to check the status of an operation, cancel it, or wait
|
770
|
+
# # for results. Here is how to block until completion:
|
771
|
+
# result.wait_until_done! timeout: 60
|
772
|
+
# if result.response?
|
773
|
+
# p result.response
|
774
|
+
# else
|
775
|
+
# puts "Error!"
|
776
|
+
# end
|
777
|
+
#
|
637
778
|
def import_instance request, options = nil
|
638
779
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
639
780
|
|
@@ -651,16 +792,20 @@ module Google
|
|
651
792
|
gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
|
652
793
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
653
794
|
|
654
|
-
header_params = {
|
655
|
-
|
656
|
-
|
795
|
+
header_params = {}
|
796
|
+
if request.name
|
797
|
+
header_params["name"] = request.name
|
798
|
+
end
|
799
|
+
|
657
800
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
658
801
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
659
802
|
|
660
803
|
options.apply_defaults timeout: @config.rpcs.import_instance.timeout,
|
661
804
|
metadata: metadata,
|
662
805
|
retry_policy: @config.rpcs.import_instance.retry_policy
|
663
|
-
|
806
|
+
|
807
|
+
options.apply_defaults timeout: @config.timeout,
|
808
|
+
metadata: @config.metadata,
|
664
809
|
retry_policy: @config.retry_policy
|
665
810
|
|
666
811
|
@cloud_redis_stub.call_rpc :import_instance, request, options: options do |response, operation|
|
@@ -710,6 +855,28 @@ module Google
|
|
710
855
|
#
|
711
856
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
712
857
|
#
|
858
|
+
# @example Basic example
|
859
|
+
# require "google/cloud/redis/v1beta1"
|
860
|
+
#
|
861
|
+
# # Create a client object. The client can be reused for multiple calls.
|
862
|
+
# client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
|
863
|
+
#
|
864
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
865
|
+
# request = Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new
|
866
|
+
#
|
867
|
+
# # Call the export_instance method.
|
868
|
+
# result = client.export_instance request
|
869
|
+
#
|
870
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
871
|
+
# # object to check the status of an operation, cancel it, or wait
|
872
|
+
# # for results. Here is how to block until completion:
|
873
|
+
# result.wait_until_done! timeout: 60
|
874
|
+
# if result.response?
|
875
|
+
# p result.response
|
876
|
+
# else
|
877
|
+
# puts "Error!"
|
878
|
+
# end
|
879
|
+
#
|
713
880
|
def export_instance request, options = nil
|
714
881
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
715
882
|
|
@@ -727,16 +894,20 @@ module Google
|
|
727
894
|
gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
|
728
895
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
729
896
|
|
730
|
-
header_params = {
|
731
|
-
|
732
|
-
|
897
|
+
header_params = {}
|
898
|
+
if request.name
|
899
|
+
header_params["name"] = request.name
|
900
|
+
end
|
901
|
+
|
733
902
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
734
903
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
735
904
|
|
736
905
|
options.apply_defaults timeout: @config.rpcs.export_instance.timeout,
|
737
906
|
metadata: metadata,
|
738
907
|
retry_policy: @config.rpcs.export_instance.retry_policy
|
739
|
-
|
908
|
+
|
909
|
+
options.apply_defaults timeout: @config.timeout,
|
910
|
+
metadata: @config.metadata,
|
740
911
|
retry_policy: @config.retry_policy
|
741
912
|
|
742
913
|
@cloud_redis_stub.call_rpc :export_instance, request, options: options do |response, operation|
|
@@ -749,7 +920,7 @@ module Google
|
|
749
920
|
end
|
750
921
|
|
751
922
|
##
|
752
|
-
# Initiates a failover of the
|
923
|
+
# Initiates a failover of the primary node to current replica node for a
|
753
924
|
# specific STANDARD tier Cloud Memorystore for Redis instance.
|
754
925
|
#
|
755
926
|
# @overload failover_instance(request, options = nil)
|
@@ -783,6 +954,28 @@ module Google
|
|
783
954
|
#
|
784
955
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
785
956
|
#
|
957
|
+
# @example Basic example
|
958
|
+
# require "google/cloud/redis/v1beta1"
|
959
|
+
#
|
960
|
+
# # Create a client object. The client can be reused for multiple calls.
|
961
|
+
# client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
|
962
|
+
#
|
963
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
964
|
+
# request = Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new
|
965
|
+
#
|
966
|
+
# # Call the failover_instance method.
|
967
|
+
# result = client.failover_instance request
|
968
|
+
#
|
969
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
970
|
+
# # object to check the status of an operation, cancel it, or wait
|
971
|
+
# # for results. Here is how to block until completion:
|
972
|
+
# result.wait_until_done! timeout: 60
|
973
|
+
# if result.response?
|
974
|
+
# p result.response
|
975
|
+
# else
|
976
|
+
# puts "Error!"
|
977
|
+
# end
|
978
|
+
#
|
786
979
|
def failover_instance request, options = nil
|
787
980
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
788
981
|
|
@@ -800,16 +993,20 @@ module Google
|
|
800
993
|
gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
|
801
994
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
802
995
|
|
803
|
-
header_params = {
|
804
|
-
|
805
|
-
|
996
|
+
header_params = {}
|
997
|
+
if request.name
|
998
|
+
header_params["name"] = request.name
|
999
|
+
end
|
1000
|
+
|
806
1001
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
807
1002
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
808
1003
|
|
809
1004
|
options.apply_defaults timeout: @config.rpcs.failover_instance.timeout,
|
810
1005
|
metadata: metadata,
|
811
1006
|
retry_policy: @config.rpcs.failover_instance.retry_policy
|
812
|
-
|
1007
|
+
|
1008
|
+
options.apply_defaults timeout: @config.timeout,
|
1009
|
+
metadata: @config.metadata,
|
813
1010
|
retry_policy: @config.retry_policy
|
814
1011
|
|
815
1012
|
@cloud_redis_stub.call_rpc :failover_instance, request, options: options do |response, operation|
|
@@ -853,6 +1050,28 @@ module Google
|
|
853
1050
|
#
|
854
1051
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
855
1052
|
#
|
1053
|
+
# @example Basic example
|
1054
|
+
# require "google/cloud/redis/v1beta1"
|
1055
|
+
#
|
1056
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1057
|
+
# client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
|
1058
|
+
#
|
1059
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1060
|
+
# request = Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.new
|
1061
|
+
#
|
1062
|
+
# # Call the delete_instance method.
|
1063
|
+
# result = client.delete_instance request
|
1064
|
+
#
|
1065
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
1066
|
+
# # object to check the status of an operation, cancel it, or wait
|
1067
|
+
# # for results. Here is how to block until completion:
|
1068
|
+
# result.wait_until_done! timeout: 60
|
1069
|
+
# if result.response?
|
1070
|
+
# p result.response
|
1071
|
+
# else
|
1072
|
+
# puts "Error!"
|
1073
|
+
# end
|
1074
|
+
#
|
856
1075
|
def delete_instance request, options = nil
|
857
1076
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
858
1077
|
|
@@ -870,16 +1089,20 @@ module Google
|
|
870
1089
|
gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
|
871
1090
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
872
1091
|
|
873
|
-
header_params = {
|
874
|
-
|
875
|
-
|
1092
|
+
header_params = {}
|
1093
|
+
if request.name
|
1094
|
+
header_params["name"] = request.name
|
1095
|
+
end
|
1096
|
+
|
876
1097
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
877
1098
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
878
1099
|
|
879
1100
|
options.apply_defaults timeout: @config.rpcs.delete_instance.timeout,
|
880
1101
|
metadata: metadata,
|
881
1102
|
retry_policy: @config.rpcs.delete_instance.retry_policy
|
882
|
-
|
1103
|
+
|
1104
|
+
options.apply_defaults timeout: @config.timeout,
|
1105
|
+
metadata: @config.metadata,
|
883
1106
|
retry_policy: @config.retry_policy
|
884
1107
|
|
885
1108
|
@cloud_redis_stub.call_rpc :delete_instance, request, options: options do |response, operation|
|
@@ -904,22 +1127,21 @@ module Google
|
|
904
1127
|
# Configuration can be applied globally to all clients, or to a single client
|
905
1128
|
# on construction.
|
906
1129
|
#
|
907
|
-
#
|
908
|
-
#
|
909
|
-
#
|
910
|
-
# to 20 seconds,
|
911
|
-
#
|
912
|
-
#
|
913
|
-
#
|
914
|
-
#
|
915
|
-
#
|
916
|
-
#
|
917
|
-
#
|
918
|
-
#
|
919
|
-
#
|
920
|
-
#
|
921
|
-
#
|
922
|
-
# end
|
1130
|
+
# @example
|
1131
|
+
#
|
1132
|
+
# # Modify the global config, setting the timeout for
|
1133
|
+
# # list_instances to 20 seconds,
|
1134
|
+
# # and all remaining timeouts to 10 seconds.
|
1135
|
+
# ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.configure do |config|
|
1136
|
+
# config.timeout = 10.0
|
1137
|
+
# config.rpcs.list_instances.timeout = 20.0
|
1138
|
+
# end
|
1139
|
+
#
|
1140
|
+
# # Apply the above configuration only to a new client.
|
1141
|
+
# client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config|
|
1142
|
+
# config.timeout = 10.0
|
1143
|
+
# config.rpcs.list_instances.timeout = 20.0
|
1144
|
+
# end
|
923
1145
|
#
|
924
1146
|
# @!attribute [rw] endpoint
|
925
1147
|
# The hostname or hostname:port of the service endpoint.
|