google-cloud-redis-v1beta1 0.4.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 refering to a GCP `region`; for example:
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
@@ -82,6 +82,8 @@ module Google
82
82
 
83
83
  default_config.rpcs.get_instance.timeout = 600.0
84
84
 
85
+ default_config.rpcs.get_instance_auth_string.timeout = 600.0
86
+
85
87
  default_config.rpcs.create_instance.timeout = 600.0
86
88
 
87
89
  default_config.rpcs.update_instance.timeout = 600.0
@@ -167,6 +169,7 @@ module Google
167
169
 
168
170
  @operations_client = Operations.new do |config|
169
171
  config.credentials = credentials
172
+ config.quota_project = @quota_project_id
170
173
  config.endpoint = @config.endpoint
171
174
  end
172
175
 
@@ -238,6 +241,27 @@ module Google
238
241
  #
239
242
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
240
243
  #
244
+ # @example Basic example
245
+ # require "google/cloud/redis/v1beta1"
246
+ #
247
+ # # Create a client object. The client can be reused for multiple calls.
248
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
249
+ #
250
+ # # Create a request. To set request fields, pass in keyword arguments.
251
+ # request = Google::Cloud::Redis::V1beta1::ListInstancesRequest.new
252
+ #
253
+ # # Call the list_instances method.
254
+ # result = client.list_instances request
255
+ #
256
+ # # The returned object is of type Gapic::PagedEnumerable. You can
257
+ # # iterate over all elements by calling #each, and the enumerable
258
+ # # will lazily make API calls to fetch subsequent pages. Other
259
+ # # methods are also available for managing paging directly.
260
+ # result.each do |response|
261
+ # # Each element is of type ::Google::Cloud::Redis::V1beta1::Instance.
262
+ # p response
263
+ # end
264
+ #
241
265
  def list_instances request, options = nil
242
266
  raise ::ArgumentError, "request must be provided" if request.nil?
243
267
 
@@ -255,9 +279,11 @@ module Google
255
279
  gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
256
280
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
257
281
 
258
- header_params = {
259
- "parent" => request.parent
260
- }
282
+ header_params = {}
283
+ if request.parent
284
+ header_params["parent"] = request.parent
285
+ end
286
+
261
287
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
262
288
  metadata[:"x-goog-request-params"] ||= request_params_header
263
289
 
@@ -309,6 +335,21 @@ module Google
309
335
  #
310
336
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
311
337
  #
338
+ # @example Basic example
339
+ # require "google/cloud/redis/v1beta1"
340
+ #
341
+ # # Create a client object. The client can be reused for multiple calls.
342
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
343
+ #
344
+ # # Create a request. To set request fields, pass in keyword arguments.
345
+ # request = Google::Cloud::Redis::V1beta1::GetInstanceRequest.new
346
+ #
347
+ # # Call the get_instance method.
348
+ # result = client.get_instance request
349
+ #
350
+ # # The returned object is of type Google::Cloud::Redis::V1beta1::Instance.
351
+ # p result
352
+ #
312
353
  def get_instance request, options = nil
313
354
  raise ::ArgumentError, "request must be provided" if request.nil?
314
355
 
@@ -326,9 +367,11 @@ module Google
326
367
  gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
327
368
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
328
369
 
329
- header_params = {
330
- "name" => request.name
331
- }
370
+ header_params = {}
371
+ if request.name
372
+ header_params["name"] = request.name
373
+ end
374
+
332
375
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
333
376
  metadata[:"x-goog-request-params"] ||= request_params_header
334
377
 
@@ -348,6 +391,95 @@ module Google
348
391
  raise ::Google::Cloud::Error.from_error(e)
349
392
  end
350
393
 
394
+ ##
395
+ # Gets the AUTH string for a Redis instance. If AUTH is not enabled for the
396
+ # instance the response will be empty. This information is not included in
397
+ # the details returned to GetInstance.
398
+ #
399
+ # @overload get_instance_auth_string(request, options = nil)
400
+ # Pass arguments to `get_instance_auth_string` via a request object, either of type
401
+ # {::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest} or an equivalent Hash.
402
+ #
403
+ # @param request [::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest, ::Hash]
404
+ # A request object representing the call parameters. Required. To specify no
405
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
406
+ # @param options [::Gapic::CallOptions, ::Hash]
407
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
408
+ #
409
+ # @overload get_instance_auth_string(name: nil)
410
+ # Pass arguments to `get_instance_auth_string` via keyword arguments. Note that at
411
+ # least one keyword argument is required. To specify no parameters, or to keep all
412
+ # the default parameter values, pass an empty Hash as a request object (see above).
413
+ #
414
+ # @param name [::String]
415
+ # Required. Redis instance resource name using the form:
416
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
417
+ # where `location_id` refers to a GCP region.
418
+ #
419
+ # @yield [response, operation] Access the result along with the RPC operation
420
+ # @yieldparam response [::Google::Cloud::Redis::V1beta1::InstanceAuthString]
421
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
422
+ #
423
+ # @return [::Google::Cloud::Redis::V1beta1::InstanceAuthString]
424
+ #
425
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
426
+ #
427
+ # @example Basic example
428
+ # require "google/cloud/redis/v1beta1"
429
+ #
430
+ # # Create a client object. The client can be reused for multiple calls.
431
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
432
+ #
433
+ # # Create a request. To set request fields, pass in keyword arguments.
434
+ # request = Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest.new
435
+ #
436
+ # # Call the get_instance_auth_string method.
437
+ # result = client.get_instance_auth_string request
438
+ #
439
+ # # The returned object is of type Google::Cloud::Redis::V1beta1::InstanceAuthString.
440
+ # p result
441
+ #
442
+ def get_instance_auth_string request, options = nil
443
+ raise ::ArgumentError, "request must be provided" if request.nil?
444
+
445
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest
446
+
447
+ # Converts hash and nil to an options object
448
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
449
+
450
+ # Customize the options with defaults
451
+ metadata = @config.rpcs.get_instance_auth_string.metadata.to_h
452
+
453
+ # Set x-goog-api-client and x-goog-user-project headers
454
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
455
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
456
+ gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
457
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
458
+
459
+ header_params = {}
460
+ if request.name
461
+ header_params["name"] = request.name
462
+ end
463
+
464
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
465
+ metadata[:"x-goog-request-params"] ||= request_params_header
466
+
467
+ options.apply_defaults timeout: @config.rpcs.get_instance_auth_string.timeout,
468
+ metadata: metadata,
469
+ retry_policy: @config.rpcs.get_instance_auth_string.retry_policy
470
+
471
+ options.apply_defaults timeout: @config.timeout,
472
+ metadata: @config.metadata,
473
+ retry_policy: @config.retry_policy
474
+
475
+ @cloud_redis_stub.call_rpc :get_instance_auth_string, request, options: options do |response, operation|
476
+ yield response, operation if block_given?
477
+ return response
478
+ end
479
+ rescue ::GRPC::BadStatus => e
480
+ raise ::Google::Cloud::Error.from_error(e)
481
+ end
482
+
351
483
  ##
352
484
  # Creates a Redis instance based on the specified tier and memory size.
353
485
  #
@@ -356,7 +488,7 @@ module Google
356
488
  #
357
489
  # The creation is executed asynchronously and callers may check the returned
358
490
  # operation to track its progress. Once the operation is completed the Redis
359
- # instance will be fully functional. Completed longrunning.Operation will
491
+ # instance will be fully functional. The completed longrunning.Operation will
360
492
  # contain the new instance object in the response field.
361
493
  #
362
494
  # The returned operation is automatically deleted after a few hours, so there
@@ -401,6 +533,28 @@ module Google
401
533
  #
402
534
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
403
535
  #
536
+ # @example Basic example
537
+ # require "google/cloud/redis/v1beta1"
538
+ #
539
+ # # Create a client object. The client can be reused for multiple calls.
540
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
541
+ #
542
+ # # Create a request. To set request fields, pass in keyword arguments.
543
+ # request = Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new
544
+ #
545
+ # # Call the create_instance method.
546
+ # result = client.create_instance request
547
+ #
548
+ # # The returned object is of type Gapic::Operation. You can use this
549
+ # # object to check the status of an operation, cancel it, or wait
550
+ # # for results. Here is how to block until completion:
551
+ # result.wait_until_done! timeout: 60
552
+ # if result.response?
553
+ # p result.response
554
+ # else
555
+ # puts "Error!"
556
+ # end
557
+ #
404
558
  def create_instance request, options = nil
405
559
  raise ::ArgumentError, "request must be provided" if request.nil?
406
560
 
@@ -418,9 +572,11 @@ module Google
418
572
  gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
419
573
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
420
574
 
421
- header_params = {
422
- "parent" => request.parent
423
- }
575
+ header_params = {}
576
+ if request.parent
577
+ header_params["parent"] = request.parent
578
+ end
579
+
424
580
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
425
581
  metadata[:"x-goog-request-params"] ||= request_params_header
426
582
 
@@ -472,6 +628,7 @@ module Google
472
628
  # * `labels`
473
629
  # * `memorySizeGb`
474
630
  # * `redisConfig`
631
+ # * `replica_count`
475
632
  # @param instance [::Google::Cloud::Redis::V1beta1::Instance, ::Hash]
476
633
  # Required. Update description.
477
634
  # Only fields specified in update_mask are updated.
@@ -484,6 +641,28 @@ module Google
484
641
  #
485
642
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
486
643
  #
644
+ # @example Basic example
645
+ # require "google/cloud/redis/v1beta1"
646
+ #
647
+ # # Create a client object. The client can be reused for multiple calls.
648
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
649
+ #
650
+ # # Create a request. To set request fields, pass in keyword arguments.
651
+ # request = Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new
652
+ #
653
+ # # Call the update_instance method.
654
+ # result = client.update_instance request
655
+ #
656
+ # # The returned object is of type Gapic::Operation. You can use this
657
+ # # object to check the status of an operation, cancel it, or wait
658
+ # # for results. Here is how to block until completion:
659
+ # result.wait_until_done! timeout: 60
660
+ # if result.response?
661
+ # p result.response
662
+ # else
663
+ # puts "Error!"
664
+ # end
665
+ #
487
666
  def update_instance request, options = nil
488
667
  raise ::ArgumentError, "request must be provided" if request.nil?
489
668
 
@@ -501,9 +680,11 @@ module Google
501
680
  gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
502
681
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
503
682
 
504
- header_params = {
505
- "instance.name" => request.instance.name
506
- }
683
+ header_params = {}
684
+ if request.instance&.name
685
+ header_params["instance.name"] = request.instance.name
686
+ end
687
+
507
688
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
508
689
  metadata[:"x-goog-request-params"] ||= request_params_header
509
690
 
@@ -558,6 +739,28 @@ module Google
558
739
  #
559
740
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
560
741
  #
742
+ # @example Basic example
743
+ # require "google/cloud/redis/v1beta1"
744
+ #
745
+ # # Create a client object. The client can be reused for multiple calls.
746
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
747
+ #
748
+ # # Create a request. To set request fields, pass in keyword arguments.
749
+ # request = Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new
750
+ #
751
+ # # Call the upgrade_instance method.
752
+ # result = client.upgrade_instance request
753
+ #
754
+ # # The returned object is of type Gapic::Operation. You can use this
755
+ # # object to check the status of an operation, cancel it, or wait
756
+ # # for results. Here is how to block until completion:
757
+ # result.wait_until_done! timeout: 60
758
+ # if result.response?
759
+ # p result.response
760
+ # else
761
+ # puts "Error!"
762
+ # end
763
+ #
561
764
  def upgrade_instance request, options = nil
562
765
  raise ::ArgumentError, "request must be provided" if request.nil?
563
766
 
@@ -575,9 +778,11 @@ module Google
575
778
  gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
576
779
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
577
780
 
578
- header_params = {
579
- "name" => request.name
580
- }
781
+ header_params = {}
782
+ if request.name
783
+ header_params["name"] = request.name
784
+ end
785
+
581
786
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
582
787
  metadata[:"x-goog-request-params"] ||= request_params_header
583
788
 
@@ -638,6 +843,28 @@ module Google
638
843
  #
639
844
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
640
845
  #
846
+ # @example Basic example
847
+ # require "google/cloud/redis/v1beta1"
848
+ #
849
+ # # Create a client object. The client can be reused for multiple calls.
850
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
851
+ #
852
+ # # Create a request. To set request fields, pass in keyword arguments.
853
+ # request = Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new
854
+ #
855
+ # # Call the import_instance method.
856
+ # result = client.import_instance request
857
+ #
858
+ # # The returned object is of type Gapic::Operation. You can use this
859
+ # # object to check the status of an operation, cancel it, or wait
860
+ # # for results. Here is how to block until completion:
861
+ # result.wait_until_done! timeout: 60
862
+ # if result.response?
863
+ # p result.response
864
+ # else
865
+ # puts "Error!"
866
+ # end
867
+ #
641
868
  def import_instance request, options = nil
642
869
  raise ::ArgumentError, "request must be provided" if request.nil?
643
870
 
@@ -655,9 +882,11 @@ module Google
655
882
  gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
656
883
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
657
884
 
658
- header_params = {
659
- "name" => request.name
660
- }
885
+ header_params = {}
886
+ if request.name
887
+ header_params["name"] = request.name
888
+ end
889
+
661
890
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
662
891
  metadata[:"x-goog-request-params"] ||= request_params_header
663
892
 
@@ -716,6 +945,28 @@ module Google
716
945
  #
717
946
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
718
947
  #
948
+ # @example Basic example
949
+ # require "google/cloud/redis/v1beta1"
950
+ #
951
+ # # Create a client object. The client can be reused for multiple calls.
952
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
953
+ #
954
+ # # Create a request. To set request fields, pass in keyword arguments.
955
+ # request = Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new
956
+ #
957
+ # # Call the export_instance method.
958
+ # result = client.export_instance request
959
+ #
960
+ # # The returned object is of type Gapic::Operation. You can use this
961
+ # # object to check the status of an operation, cancel it, or wait
962
+ # # for results. Here is how to block until completion:
963
+ # result.wait_until_done! timeout: 60
964
+ # if result.response?
965
+ # p result.response
966
+ # else
967
+ # puts "Error!"
968
+ # end
969
+ #
719
970
  def export_instance request, options = nil
720
971
  raise ::ArgumentError, "request must be provided" if request.nil?
721
972
 
@@ -733,9 +984,11 @@ module Google
733
984
  gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
734
985
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
735
986
 
736
- header_params = {
737
- "name" => request.name
738
- }
987
+ header_params = {}
988
+ if request.name
989
+ header_params["name"] = request.name
990
+ end
991
+
739
992
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
740
993
  metadata[:"x-goog-request-params"] ||= request_params_header
741
994
 
@@ -757,7 +1010,7 @@ module Google
757
1010
  end
758
1011
 
759
1012
  ##
760
- # Initiates a failover of the master node to current replica node for a
1013
+ # Initiates a failover of the primary node to current replica node for a
761
1014
  # specific STANDARD tier Cloud Memorystore for Redis instance.
762
1015
  #
763
1016
  # @overload failover_instance(request, options = nil)
@@ -791,6 +1044,28 @@ module Google
791
1044
  #
792
1045
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
793
1046
  #
1047
+ # @example Basic example
1048
+ # require "google/cloud/redis/v1beta1"
1049
+ #
1050
+ # # Create a client object. The client can be reused for multiple calls.
1051
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
1052
+ #
1053
+ # # Create a request. To set request fields, pass in keyword arguments.
1054
+ # request = Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new
1055
+ #
1056
+ # # Call the failover_instance method.
1057
+ # result = client.failover_instance request
1058
+ #
1059
+ # # The returned object is of type Gapic::Operation. You can use this
1060
+ # # object to check the status of an operation, cancel it, or wait
1061
+ # # for results. Here is how to block until completion:
1062
+ # result.wait_until_done! timeout: 60
1063
+ # if result.response?
1064
+ # p result.response
1065
+ # else
1066
+ # puts "Error!"
1067
+ # end
1068
+ #
794
1069
  def failover_instance request, options = nil
795
1070
  raise ::ArgumentError, "request must be provided" if request.nil?
796
1071
 
@@ -808,9 +1083,11 @@ module Google
808
1083
  gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
809
1084
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
810
1085
 
811
- header_params = {
812
- "name" => request.name
813
- }
1086
+ header_params = {}
1087
+ if request.name
1088
+ header_params["name"] = request.name
1089
+ end
1090
+
814
1091
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
815
1092
  metadata[:"x-goog-request-params"] ||= request_params_header
816
1093
 
@@ -863,6 +1140,28 @@ module Google
863
1140
  #
864
1141
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
865
1142
  #
1143
+ # @example Basic example
1144
+ # require "google/cloud/redis/v1beta1"
1145
+ #
1146
+ # # Create a client object. The client can be reused for multiple calls.
1147
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
1148
+ #
1149
+ # # Create a request. To set request fields, pass in keyword arguments.
1150
+ # request = Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.new
1151
+ #
1152
+ # # Call the delete_instance method.
1153
+ # result = client.delete_instance request
1154
+ #
1155
+ # # The returned object is of type Gapic::Operation. You can use this
1156
+ # # object to check the status of an operation, cancel it, or wait
1157
+ # # for results. Here is how to block until completion:
1158
+ # result.wait_until_done! timeout: 60
1159
+ # if result.response?
1160
+ # p result.response
1161
+ # else
1162
+ # puts "Error!"
1163
+ # end
1164
+ #
866
1165
  def delete_instance request, options = nil
867
1166
  raise ::ArgumentError, "request must be provided" if request.nil?
868
1167
 
@@ -880,9 +1179,11 @@ module Google
880
1179
  gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
881
1180
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
882
1181
 
883
- header_params = {
884
- "name" => request.name
885
- }
1182
+ header_params = {}
1183
+ if request.name
1184
+ header_params["name"] = request.name
1185
+ end
1186
+
886
1187
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
887
1188
  metadata[:"x-goog-request-params"] ||= request_params_header
888
1189
 
@@ -903,6 +1204,108 @@ module Google
903
1204
  raise ::Google::Cloud::Error.from_error(e)
904
1205
  end
905
1206
 
1207
+ ##
1208
+ # Reschedule maintenance for a given instance in a given project and
1209
+ # location.
1210
+ #
1211
+ # @overload reschedule_maintenance(request, options = nil)
1212
+ # Pass arguments to `reschedule_maintenance` via a request object, either of type
1213
+ # {::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest} or an equivalent Hash.
1214
+ #
1215
+ # @param request [::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest, ::Hash]
1216
+ # A request object representing the call parameters. Required. To specify no
1217
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1218
+ # @param options [::Gapic::CallOptions, ::Hash]
1219
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1220
+ #
1221
+ # @overload reschedule_maintenance(name: nil, reschedule_type: nil, schedule_time: nil)
1222
+ # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at
1223
+ # least one keyword argument is required. To specify no parameters, or to keep all
1224
+ # the default parameter values, pass an empty Hash as a request object (see above).
1225
+ #
1226
+ # @param name [::String]
1227
+ # Required. Redis instance resource name using the form:
1228
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
1229
+ # where `location_id` refers to a GCP region.
1230
+ # @param reschedule_type [::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest::RescheduleType]
1231
+ # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well.
1232
+ # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash]
1233
+ # Optional. Timestamp when the maintenance shall be rescheduled to if
1234
+ # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for
1235
+ # example `2012-11-15T16:19:00.094Z`.
1236
+ #
1237
+ # @yield [response, operation] Access the result along with the RPC operation
1238
+ # @yieldparam response [::Gapic::Operation]
1239
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1240
+ #
1241
+ # @return [::Gapic::Operation]
1242
+ #
1243
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1244
+ #
1245
+ # @example Basic example
1246
+ # require "google/cloud/redis/v1beta1"
1247
+ #
1248
+ # # Create a client object. The client can be reused for multiple calls.
1249
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
1250
+ #
1251
+ # # Create a request. To set request fields, pass in keyword arguments.
1252
+ # request = Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest.new
1253
+ #
1254
+ # # Call the reschedule_maintenance method.
1255
+ # result = client.reschedule_maintenance request
1256
+ #
1257
+ # # The returned object is of type Gapic::Operation. You can use this
1258
+ # # object to check the status of an operation, cancel it, or wait
1259
+ # # for results. Here is how to block until completion:
1260
+ # result.wait_until_done! timeout: 60
1261
+ # if result.response?
1262
+ # p result.response
1263
+ # else
1264
+ # puts "Error!"
1265
+ # end
1266
+ #
1267
+ def reschedule_maintenance request, options = nil
1268
+ raise ::ArgumentError, "request must be provided" if request.nil?
1269
+
1270
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest
1271
+
1272
+ # Converts hash and nil to an options object
1273
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1274
+
1275
+ # Customize the options with defaults
1276
+ metadata = @config.rpcs.reschedule_maintenance.metadata.to_h
1277
+
1278
+ # Set x-goog-api-client and x-goog-user-project headers
1279
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1280
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1281
+ gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
1282
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1283
+
1284
+ header_params = {}
1285
+ if request.name
1286
+ header_params["name"] = request.name
1287
+ end
1288
+
1289
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1290
+ metadata[:"x-goog-request-params"] ||= request_params_header
1291
+
1292
+ options.apply_defaults timeout: @config.rpcs.reschedule_maintenance.timeout,
1293
+ metadata: metadata,
1294
+ retry_policy: @config.rpcs.reschedule_maintenance.retry_policy
1295
+
1296
+ options.apply_defaults timeout: @config.timeout,
1297
+ metadata: @config.metadata,
1298
+ retry_policy: @config.retry_policy
1299
+
1300
+ @cloud_redis_stub.call_rpc :reschedule_maintenance, request, options: options do |response, operation|
1301
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1302
+ yield response, operation if block_given?
1303
+ return response
1304
+ end
1305
+ rescue ::GRPC::BadStatus => e
1306
+ raise ::Google::Cloud::Error.from_error(e)
1307
+ end
1308
+
906
1309
  ##
907
1310
  # Configuration class for the CloudRedis API.
908
1311
  #
@@ -1049,6 +1452,11 @@ module Google
1049
1452
  #
1050
1453
  attr_reader :get_instance
1051
1454
  ##
1455
+ # RPC-specific configuration for `get_instance_auth_string`
1456
+ # @return [::Gapic::Config::Method]
1457
+ #
1458
+ attr_reader :get_instance_auth_string
1459
+ ##
1052
1460
  # RPC-specific configuration for `create_instance`
1053
1461
  # @return [::Gapic::Config::Method]
1054
1462
  #
@@ -1083,6 +1491,11 @@ module Google
1083
1491
  # @return [::Gapic::Config::Method]
1084
1492
  #
1085
1493
  attr_reader :delete_instance
1494
+ ##
1495
+ # RPC-specific configuration for `reschedule_maintenance`
1496
+ # @return [::Gapic::Config::Method]
1497
+ #
1498
+ attr_reader :reschedule_maintenance
1086
1499
 
1087
1500
  # @private
1088
1501
  def initialize parent_rpcs = nil
@@ -1090,6 +1503,8 @@ module Google
1090
1503
  @list_instances = ::Gapic::Config::Method.new list_instances_config
1091
1504
  get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
1092
1505
  @get_instance = ::Gapic::Config::Method.new get_instance_config
1506
+ get_instance_auth_string_config = parent_rpcs.get_instance_auth_string if parent_rpcs.respond_to? :get_instance_auth_string
1507
+ @get_instance_auth_string = ::Gapic::Config::Method.new get_instance_auth_string_config
1093
1508
  create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
1094
1509
  @create_instance = ::Gapic::Config::Method.new create_instance_config
1095
1510
  update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance
@@ -1104,6 +1519,8 @@ module Google
1104
1519
  @failover_instance = ::Gapic::Config::Method.new failover_instance_config
1105
1520
  delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
1106
1521
  @delete_instance = ::Gapic::Config::Method.new delete_instance_config
1522
+ reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance
1523
+ @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config
1107
1524
 
1108
1525
  yield self if block_given?
1109
1526
  end