google-cloud-redis 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77259a383da44a43dc112d8e849560089fbc35b5c0b539becb033008e4dbd07f
4
- data.tar.gz: 36a3f0c3d32cc3bf9de0acb214a9acc29b186a2b5729077a34d24a9284f3ed84
3
+ metadata.gz: daa5d848262260c423a5e94f8e0fb5435f8a2ee14a07da9f5149284f0f1eac0f
4
+ data.tar.gz: 1bd8d217b08af39038a6549c330e849b75ee811d691bb201a67c92e9016675a9
5
5
  SHA512:
6
- metadata.gz: 189e8912ae7fa344a20ed36b824d71b5fab86f28f969ef59ad94d17b80d119100919852ed934770121e7325d5ee4afc2c85f5fe8596602e8ee9d608ea4571fe1
7
- data.tar.gz: e444e4a28bd9f59f3d9350b719fed22d57c0026c130a2cfadd95d45b90ff90ec288e007704823172756916f88e06664cb27e3ed8bc22bb969d04e67c31a3eb48
6
+ metadata.gz: b3a17b7ce2507c765af55b03b45829352754450eadcd448ebf018c7bd8762f557a801b50ae78bb1eb79f54635935acd017bbd4a0a2df445c43b9d221dcf87558
7
+ data.tar.gz: 920098ec49c9a73df79b8e08f1dfb11092d86b581fb34370ceaf8733081b4430b2f42a84590120f1fdf2408cc3722e509cf3a31870f55dee600b30089ec5a7d5
@@ -29,6 +29,7 @@ require "google/longrunning/operations_client"
29
29
 
30
30
  require "google/cloud/redis/v1/cloud_redis_pb"
31
31
  require "google/cloud/redis/v1/credentials"
32
+ require "google/cloud/redis/version"
32
33
 
33
34
  module Google
34
35
  module Cloud
@@ -195,7 +196,7 @@ module Google
195
196
  updater_proc = credentials.updater_proc
196
197
  end
197
198
 
198
- package_version = Gem.loaded_specs['google-cloud-redis'].version.version
199
+ package_version = Google::Cloud::Redis::VERSION
199
200
 
200
201
  google_api_client = "gl-ruby/#{RUBY_VERSION}"
201
202
  google_api_client << " #{lib_name}/#{lib_version}" if lib_name
@@ -268,9 +269,17 @@ module Google
268
269
  {'instance.name' => request.instance.name}
269
270
  end
270
271
  )
271
- @delete_instance = Google::Gax.create_api_call(
272
- @cloud_redis_stub.method(:delete_instance),
273
- defaults["delete_instance"],
272
+ @import_instance = Google::Gax.create_api_call(
273
+ @cloud_redis_stub.method(:import_instance),
274
+ defaults["import_instance"],
275
+ exception_transformer: exception_transformer,
276
+ params_extractor: proc do |request|
277
+ {'name' => request.name}
278
+ end
279
+ )
280
+ @export_instance = Google::Gax.create_api_call(
281
+ @cloud_redis_stub.method(:export_instance),
282
+ defaults["export_instance"],
274
283
  exception_transformer: exception_transformer,
275
284
  params_extractor: proc do |request|
276
285
  {'name' => request.name}
@@ -284,6 +293,14 @@ module Google
284
293
  {'name' => request.name}
285
294
  end
286
295
  )
296
+ @delete_instance = Google::Gax.create_api_call(
297
+ @cloud_redis_stub.method(:delete_instance),
298
+ defaults["delete_instance"],
299
+ exception_transformer: exception_transformer,
300
+ params_extractor: proc do |request|
301
+ {'name' => request.name}
302
+ end
303
+ )
287
304
  end
288
305
 
289
306
  # Service calls
@@ -300,7 +317,7 @@ module Google
300
317
  # @param parent [String]
301
318
  # Required. The resource name of the instance location using the form:
302
319
  # `projects/{project_id}/locations/{location_id}`
303
- # where `location_id` refers to a GCP region
320
+ # where `location_id` refers to a GCP region.
304
321
  # @param page_size [Integer]
305
322
  # The maximum number of resources contained in the underlying API
306
323
  # response. If page streaming is performed per-resource, this
@@ -356,7 +373,7 @@ module Google
356
373
  # @param name [String]
357
374
  # Required. Redis instance resource name using the form:
358
375
  # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
359
- # where `location_id` refers to a GCP region
376
+ # where `location_id` refers to a GCP region.
360
377
  # @param options [Google::Gax::CallOptions]
361
378
  # Overrides the default settings for this call, e.g, timeout,
362
379
  # retries, etc.
@@ -399,7 +416,7 @@ module Google
399
416
  # @param parent [String]
400
417
  # Required. The resource name of the instance location using the form:
401
418
  # `projects/{project_id}/locations/{location_id}`
402
- # where `location_id` refers to a GCP region
419
+ # where `location_id` refers to a GCP region.
403
420
  # @param instance_id [String]
404
421
  # Required. The logical name of the Redis instance in the customer project
405
422
  # with the following restrictions:
@@ -512,9 +529,8 @@ module Google
512
529
  # paths_element_2 = "memory_size_gb"
513
530
  # paths = [paths_element, paths_element_2]
514
531
  # update_mask = { paths: paths }
515
- # display_name = "UpdatedDisplayName"
516
- # memory_size_gb = 4
517
- # instance = { display_name: display_name, memory_size_gb: memory_size_gb }
532
+ # display_name = " instance.memory_size_gb=4"
533
+ # instance = { display_name: display_name }
518
534
  #
519
535
  # # Register a callback during the method call.
520
536
  # operation = cloud_redis_client.update_instance(update_mask, instance) do |op|
@@ -563,13 +579,23 @@ module Google
563
579
  operation
564
580
  end
565
581
 
566
- # Deletes a specific Redis instance. Instance stops serving and data is
567
- # deleted.
582
+ # Import a Redis RDB snapshot file from Cloud Storage into a Redis instance.
583
+ #
584
+ # Redis may stop serving during this operation. Instance state will be
585
+ # IMPORTING for entire operation. When complete, the instance will contain
586
+ # only data from the imported file.
587
+ #
588
+ # The returned operation is automatically deleted after a few hours, so
589
+ # there is no need to call DeleteOperation.
568
590
  #
569
591
  # @param name [String]
570
592
  # Required. Redis instance resource name using the form:
571
593
  # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
572
- # where `location_id` refers to a GCP region
594
+ # where `location_id` refers to a GCP region.
595
+ # @param input_config [Google::Cloud::Redis::V1::InputConfig | Hash]
596
+ # Required. Specify data to be imported.
597
+ # A hash of the same form as `Google::Cloud::Redis::V1::InputConfig`
598
+ # can also be provided.
573
599
  # @param options [Google::Gax::CallOptions]
574
600
  # Overrides the default settings for this call, e.g, timeout,
575
601
  # retries, etc.
@@ -581,8 +607,11 @@ module Google
581
607
  # cloud_redis_client = Google::Cloud::Redis.new(version: :v1)
582
608
  # formatted_name = Google::Cloud::Redis::V1::CloudRedisClient.instance_path("[PROJECT]", "[LOCATION]", "[INSTANCE]")
583
609
  #
610
+ # # TODO: Initialize `input_config`:
611
+ # input_config = {}
612
+ #
584
613
  # # Register a callback during the method call.
585
- # operation = cloud_redis_client.delete_instance(formatted_name) do |op|
614
+ # operation = cloud_redis_client.import_instance(formatted_name, input_config) do |op|
586
615
  # raise op.results.message if op.error?
587
616
  # op_results = op.results
588
617
  # # Process the results.
@@ -608,17 +637,95 @@ module Google
608
637
  # # completion.
609
638
  # operation.wait_until_done!
610
639
 
611
- def delete_instance \
640
+ def import_instance \
612
641
  name,
642
+ input_config,
613
643
  options: nil
614
644
  req = {
615
- name: name
645
+ name: name,
646
+ input_config: input_config
616
647
  }.delete_if { |_, v| v.nil? }
617
- req = Google::Gax::to_proto(req, Google::Cloud::Redis::V1::DeleteInstanceRequest)
648
+ req = Google::Gax::to_proto(req, Google::Cloud::Redis::V1::ImportInstanceRequest)
618
649
  operation = Google::Gax::Operation.new(
619
- @delete_instance.call(req, options),
650
+ @import_instance.call(req, options),
620
651
  @operations_client,
621
- Google::Protobuf::Empty,
652
+ Google::Cloud::Redis::V1::Instance,
653
+ Google::Cloud::Redis::V1::OperationMetadata,
654
+ call_options: options
655
+ )
656
+ operation.on_done { |operation| yield(operation) } if block_given?
657
+ operation
658
+ end
659
+
660
+ # Export Redis instance data into a Redis RDB format file in Cloud Storage.
661
+ #
662
+ # Redis will continue serving during this operation.
663
+ #
664
+ # The returned operation is automatically deleted after a few hours, so
665
+ # there is no need to call DeleteOperation.
666
+ #
667
+ # @param name [String]
668
+ # Required. Redis instance resource name using the form:
669
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
670
+ # where `location_id` refers to a GCP region.
671
+ # @param output_config [Google::Cloud::Redis::V1::OutputConfig | Hash]
672
+ # Required. Specify data to be exported.
673
+ # A hash of the same form as `Google::Cloud::Redis::V1::OutputConfig`
674
+ # can also be provided.
675
+ # @param options [Google::Gax::CallOptions]
676
+ # Overrides the default settings for this call, e.g, timeout,
677
+ # retries, etc.
678
+ # @return [Google::Gax::Operation]
679
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
680
+ # @example
681
+ # require "google/cloud/redis"
682
+ #
683
+ # cloud_redis_client = Google::Cloud::Redis.new(version: :v1)
684
+ # formatted_name = Google::Cloud::Redis::V1::CloudRedisClient.instance_path("[PROJECT]", "[LOCATION]", "[INSTANCE]")
685
+ #
686
+ # # TODO: Initialize `output_config`:
687
+ # output_config = {}
688
+ #
689
+ # # Register a callback during the method call.
690
+ # operation = cloud_redis_client.export_instance(formatted_name, output_config) do |op|
691
+ # raise op.results.message if op.error?
692
+ # op_results = op.results
693
+ # # Process the results.
694
+ #
695
+ # metadata = op.metadata
696
+ # # Process the metadata.
697
+ # end
698
+ #
699
+ # # Or use the return value to register a callback.
700
+ # operation.on_done do |op|
701
+ # raise op.results.message if op.error?
702
+ # op_results = op.results
703
+ # # Process the results.
704
+ #
705
+ # metadata = op.metadata
706
+ # # Process the metadata.
707
+ # end
708
+ #
709
+ # # Manually reload the operation.
710
+ # operation.reload!
711
+ #
712
+ # # Or block until the operation completes, triggering callbacks on
713
+ # # completion.
714
+ # operation.wait_until_done!
715
+
716
+ def export_instance \
717
+ name,
718
+ output_config,
719
+ options: nil
720
+ req = {
721
+ name: name,
722
+ output_config: output_config
723
+ }.delete_if { |_, v| v.nil? }
724
+ req = Google::Gax::to_proto(req, Google::Cloud::Redis::V1::ExportInstanceRequest)
725
+ operation = Google::Gax::Operation.new(
726
+ @export_instance.call(req, options),
727
+ @operations_client,
728
+ Google::Cloud::Redis::V1::Instance,
622
729
  Google::Cloud::Redis::V1::OperationMetadata,
623
730
  call_options: options
624
731
  )
@@ -626,13 +733,13 @@ module Google
626
733
  operation
627
734
  end
628
735
 
629
- # Failover the master role to current replica node against a specific
630
- # STANDARD tier redis instance.
736
+ # Initiates a failover of the master node to current replica node for a
737
+ # specific STANDARD tier Cloud Memorystore for Redis instance.
631
738
  #
632
739
  # @param name [String]
633
740
  # Required. Redis instance resource name using the form:
634
741
  # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
635
- # where `location_id` refers to a GCP region
742
+ # where `location_id` refers to a GCP region.
636
743
  # @param data_protection_mode [Google::Cloud::Redis::V1::FailoverInstanceRequest::DataProtectionMode]
637
744
  # Optional. Available data protection modes that the user can choose. If it's
638
745
  # unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
@@ -696,6 +803,69 @@ module Google
696
803
  operation.on_done { |operation| yield(operation) } if block_given?
697
804
  operation
698
805
  end
806
+
807
+ # Deletes a specific Redis instance. Instance stops serving and data is
808
+ # deleted.
809
+ #
810
+ # @param name [String]
811
+ # Required. Redis instance resource name using the form:
812
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
813
+ # where `location_id` refers to a GCP region.
814
+ # @param options [Google::Gax::CallOptions]
815
+ # Overrides the default settings for this call, e.g, timeout,
816
+ # retries, etc.
817
+ # @return [Google::Gax::Operation]
818
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
819
+ # @example
820
+ # require "google/cloud/redis"
821
+ #
822
+ # cloud_redis_client = Google::Cloud::Redis.new(version: :v1)
823
+ # formatted_name = Google::Cloud::Redis::V1::CloudRedisClient.instance_path("[PROJECT]", "[LOCATION]", "[INSTANCE]")
824
+ #
825
+ # # Register a callback during the method call.
826
+ # operation = cloud_redis_client.delete_instance(formatted_name) do |op|
827
+ # raise op.results.message if op.error?
828
+ # op_results = op.results
829
+ # # Process the results.
830
+ #
831
+ # metadata = op.metadata
832
+ # # Process the metadata.
833
+ # end
834
+ #
835
+ # # Or use the return value to register a callback.
836
+ # operation.on_done do |op|
837
+ # raise op.results.message if op.error?
838
+ # op_results = op.results
839
+ # # Process the results.
840
+ #
841
+ # metadata = op.metadata
842
+ # # Process the metadata.
843
+ # end
844
+ #
845
+ # # Manually reload the operation.
846
+ # operation.reload!
847
+ #
848
+ # # Or block until the operation completes, triggering callbacks on
849
+ # # completion.
850
+ # operation.wait_until_done!
851
+
852
+ def delete_instance \
853
+ name,
854
+ options: nil
855
+ req = {
856
+ name: name
857
+ }.delete_if { |_, v| v.nil? }
858
+ req = Google::Gax::to_proto(req, Google::Cloud::Redis::V1::DeleteInstanceRequest)
859
+ operation = Google::Gax::Operation.new(
860
+ @delete_instance.call(req, options),
861
+ @operations_client,
862
+ Google::Protobuf::Empty,
863
+ Google::Cloud::Redis::V1::OperationMetadata,
864
+ call_options: options
865
+ )
866
+ operation.on_done { |operation| yield(operation) } if block_given?
867
+ operation
868
+ end
699
869
  end
700
870
  end
701
871
  end
@@ -40,7 +40,12 @@
40
40
  "retry_codes_name": "non_idempotent",
41
41
  "retry_params_name": "default"
42
42
  },
43
- "DeleteInstance": {
43
+ "ImportInstance": {
44
+ "timeout_millis": 60000,
45
+ "retry_codes_name": "non_idempotent",
46
+ "retry_params_name": "default"
47
+ },
48
+ "ExportInstance": {
44
49
  "timeout_millis": 60000,
45
50
  "retry_codes_name": "non_idempotent",
46
51
  "retry_params_name": "default"
@@ -49,6 +54,11 @@
49
54
  "timeout_millis": 60000,
50
55
  "retry_codes_name": "non_idempotent",
51
56
  "retry_params_name": "default"
57
+ },
58
+ "DeleteInstance": {
59
+ "timeout_millis": 60000,
60
+ "retry_codes_name": "non_idempotent",
61
+ "retry_params_name": "default"
52
62
  }
53
63
  }
54
64
  }
@@ -5,10 +5,10 @@
5
5
  require 'google/protobuf'
6
6
 
7
7
  require 'google/api/annotations_pb'
8
- require 'google/api/resource_pb'
9
8
  require 'google/longrunning/operations_pb'
10
9
  require 'google/protobuf/field_mask_pb'
11
10
  require 'google/protobuf/timestamp_pb'
11
+ require 'google/api/client_pb'
12
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
13
13
  add_message "google.cloud.redis.v1.Instance" do
14
14
  optional :name, :string, 1
@@ -28,6 +28,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
28
28
  optional :tier, :enum, 17, "google.cloud.redis.v1.Instance.Tier"
29
29
  optional :memory_size_gb, :int32, 18
30
30
  optional :authorized_network, :string, 20
31
+ optional :persistence_iam_identity, :string, 21
31
32
  end
32
33
  add_enum "google.cloud.redis.v1.Instance.State" do
33
34
  value :STATE_UNSPECIFIED, 0
@@ -37,6 +38,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
37
38
  value :DELETING, 4
38
39
  value :REPAIRING, 5
39
40
  value :MAINTENANCE, 6
41
+ value :IMPORTING, 8
40
42
  value :FAILING_OVER, 9
41
43
  end
42
44
  add_enum "google.cloud.redis.v1.Instance.Tier" do
@@ -69,6 +71,30 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
69
71
  add_message "google.cloud.redis.v1.DeleteInstanceRequest" do
70
72
  optional :name, :string, 1
71
73
  end
74
+ add_message "google.cloud.redis.v1.GcsSource" do
75
+ optional :uri, :string, 1
76
+ end
77
+ add_message "google.cloud.redis.v1.InputConfig" do
78
+ oneof :source do
79
+ optional :gcs_source, :message, 1, "google.cloud.redis.v1.GcsSource"
80
+ end
81
+ end
82
+ add_message "google.cloud.redis.v1.ImportInstanceRequest" do
83
+ optional :name, :string, 1
84
+ optional :input_config, :message, 3, "google.cloud.redis.v1.InputConfig"
85
+ end
86
+ add_message "google.cloud.redis.v1.GcsDestination" do
87
+ optional :uri, :string, 1
88
+ end
89
+ add_message "google.cloud.redis.v1.OutputConfig" do
90
+ oneof :destination do
91
+ optional :gcs_destination, :message, 1, "google.cloud.redis.v1.GcsDestination"
92
+ end
93
+ end
94
+ add_message "google.cloud.redis.v1.ExportInstanceRequest" do
95
+ optional :name, :string, 1
96
+ optional :output_config, :message, 3, "google.cloud.redis.v1.OutputConfig"
97
+ end
72
98
  add_message "google.cloud.redis.v1.FailoverInstanceRequest" do
73
99
  optional :name, :string, 1
74
100
  optional :data_protection_mode, :enum, 2, "google.cloud.redis.v1.FailoverInstanceRequest.DataProtectionMode"
@@ -107,6 +133,12 @@ module Google
107
133
  CreateInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.CreateInstanceRequest").msgclass
108
134
  UpdateInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.UpdateInstanceRequest").msgclass
109
135
  DeleteInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.DeleteInstanceRequest").msgclass
136
+ GcsSource = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.GcsSource").msgclass
137
+ InputConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.InputConfig").msgclass
138
+ ImportInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.ImportInstanceRequest").msgclass
139
+ GcsDestination = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.GcsDestination").msgclass
140
+ OutputConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.OutputConfig").msgclass
141
+ ExportInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.ExportInstanceRequest").msgclass
110
142
  FailoverInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.FailoverInstanceRequest").msgclass
111
143
  FailoverInstanceRequest::DataProtectionMode = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.FailoverInstanceRequest.DataProtectionMode").enummodule
112
144
  OperationMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.OperationMetadata").msgclass
@@ -79,8 +79,24 @@ module Google
79
79
  # in the response field. The returned operation is automatically deleted
80
80
  # after a few hours, so there is no need to call DeleteOperation.
81
81
  rpc :UpdateInstance, UpdateInstanceRequest, Google::Longrunning::Operation
82
- # Failover the master role to current replica node against a specific
83
- # STANDARD tier redis instance.
82
+ # Import a Redis RDB snapshot file from Cloud Storage into a Redis instance.
83
+ #
84
+ # Redis may stop serving during this operation. Instance state will be
85
+ # IMPORTING for entire operation. When complete, the instance will contain
86
+ # only data from the imported file.
87
+ #
88
+ # The returned operation is automatically deleted after a few hours, so
89
+ # there is no need to call DeleteOperation.
90
+ rpc :ImportInstance, ImportInstanceRequest, Google::Longrunning::Operation
91
+ # Export Redis instance data into a Redis RDB format file in Cloud Storage.
92
+ #
93
+ # Redis will continue serving during this operation.
94
+ #
95
+ # The returned operation is automatically deleted after a few hours, so
96
+ # there is no need to call DeleteOperation.
97
+ rpc :ExportInstance, ExportInstanceRequest, Google::Longrunning::Operation
98
+ # Initiates a failover of the master node to current replica node for a
99
+ # specific STANDARD tier Cloud Memorystore for Redis instance.
84
100
  rpc :FailoverInstance, FailoverInstanceRequest, Google::Longrunning::Operation
85
101
  # Deletes a specific Redis instance. Instance stops serving and data is
86
102
  # deleted.
@@ -52,7 +52,10 @@ module Google
52
52
  # Optional. The version of Redis software.
53
53
  # If not provided, latest supported version will be used. Updating the
54
54
  # version will perform an upgrade/downgrade to the new version. Currently,
55
- # the supported values are `REDIS_3_2` for Redis 3.2.
55
+ # the supported values are:
56
+ #
57
+ # * `REDIS_4_0` for Redis 4.0 compatibility (default)
58
+ # * `REDIS_3_2` for Redis 3.2 compatibility
56
59
  # @!attribute [rw] reserved_ip_range
57
60
  # @return [String]
58
61
  # Optional. The CIDR range of internal addresses that are reserved for this
@@ -89,8 +92,16 @@ module Google
89
92
  # http://redis.io/topics/config. Currently, the only supported parameters
90
93
  # are:
91
94
  #
95
+ # Redis 3.2 and above:
96
+ #
92
97
  # * maxmemory-policy
93
98
  # * notify-keyspace-events
99
+ #
100
+ # Redis 4.0 and above:
101
+ #
102
+ # * activedefrag
103
+ # * lfu-log-factor
104
+ # * lfu-decay-time
94
105
  # @!attribute [rw] tier
95
106
  # @return [Google::Cloud::Redis::V1::Instance::Tier]
96
107
  # Required. The service tier of the instance.
@@ -103,6 +114,13 @@ module Google
103
114
  # [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to which the
104
115
  # instance is connected. If left unspecified, the `default` network
105
116
  # will be used.
117
+ # @!attribute [rw] persistence_iam_identity
118
+ # @return [String]
119
+ # Output only. Cloud IAM identity used by import / export operations to
120
+ # transfer data to/from Cloud Storage. Format is
121
+ # "serviceAccount:<service_account_email>". The value may change over time
122
+ # for a given instance so should be checked before each import/export
123
+ # operation.
106
124
  class Instance
107
125
  # Represents the different states of a Redis instance.
108
126
  module State
@@ -129,6 +147,9 @@ module Google
129
147
  # Maintenance is being performed on this Redis instance.
130
148
  MAINTENANCE = 6
131
149
 
150
+ # Redis instance is importing data (availability may be affected).
151
+ IMPORTING = 8
152
+
132
153
  # Redis instance is failing over (availability may be affected).
133
154
  FAILING_OVER = 9
134
155
  end
@@ -151,7 +172,7 @@ module Google
151
172
  # @return [String]
152
173
  # Required. The resource name of the instance location using the form:
153
174
  # `projects/{project_id}/locations/{location_id}`
154
- # where `location_id` refers to a GCP region
175
+ # where `location_id` refers to a GCP region.
155
176
  # @!attribute [rw] page_size
156
177
  # @return [Integer]
157
178
  # The maximum number of items to return.
@@ -194,7 +215,7 @@ module Google
194
215
  # @return [String]
195
216
  # Required. Redis instance resource name using the form:
196
217
  # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
197
- # where `location_id` refers to a GCP region
218
+ # where `location_id` refers to a GCP region.
198
219
  class GetInstanceRequest; end
199
220
 
200
221
  # Request for {Google::Cloud::Redis::V1::CloudRedis::CreateInstance CreateInstance}.
@@ -202,7 +223,7 @@ module Google
202
223
  # @return [String]
203
224
  # Required. The resource name of the instance location using the form:
204
225
  # `projects/{project_id}/locations/{location_id}`
205
- # where `location_id` refers to a GCP region
226
+ # where `location_id` refers to a GCP region.
206
227
  # @!attribute [rw] instance_id
207
228
  # @return [String]
208
229
  # Required. The logical name of the Redis instance in the customer project
@@ -240,21 +261,70 @@ module Google
240
261
  # @return [String]
241
262
  # Required. Redis instance resource name using the form:
242
263
  # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
243
- # where `location_id` refers to a GCP region
264
+ # where `location_id` refers to a GCP region.
244
265
  class DeleteInstanceRequest; end
245
266
 
267
+ # The Cloud Storage location for the input content
268
+ # @!attribute [rw] uri
269
+ # @return [String]
270
+ # Required. Source data URI. (e.g. 'gs://my_bucket/my_object').
271
+ class GcsSource; end
272
+
273
+ # The input content
274
+ # @!attribute [rw] gcs_source
275
+ # @return [Google::Cloud::Redis::V1::GcsSource]
276
+ # Google Cloud Storage location where input content is located.
277
+ class InputConfig; end
278
+
279
+ # Request for {Google::Cloud::Redis::V1::CloudRedis::ImportInstance Import}.
280
+ # @!attribute [rw] name
281
+ # @return [String]
282
+ # Required. Redis instance resource name using the form:
283
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
284
+ # where `location_id` refers to a GCP region.
285
+ # @!attribute [rw] input_config
286
+ # @return [Google::Cloud::Redis::V1::InputConfig]
287
+ # Required. Specify data to be imported.
288
+ class ImportInstanceRequest; end
289
+
290
+ # The Cloud Storage location for the output content
291
+ # @!attribute [rw] uri
292
+ # @return [String]
293
+ # Required. Data destination URI (e.g.
294
+ # 'gs://my_bucket/my_object'). Existing files will be overwritten.
295
+ class GcsDestination; end
296
+
297
+ # The output content
298
+ # @!attribute [rw] gcs_destination
299
+ # @return [Google::Cloud::Redis::V1::GcsDestination]
300
+ # Google Cloud Storage destination for output content.
301
+ class OutputConfig; end
302
+
303
+ # Request for {Google::Cloud::Redis::V1::CloudRedis::ExportInstance Export}.
304
+ # @!attribute [rw] name
305
+ # @return [String]
306
+ # Required. Redis instance resource name using the form:
307
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
308
+ # where `location_id` refers to a GCP region.
309
+ # @!attribute [rw] output_config
310
+ # @return [Google::Cloud::Redis::V1::OutputConfig]
311
+ # Required. Specify data to be exported.
312
+ class ExportInstanceRequest; end
313
+
246
314
  # Request for {Google::Cloud::Redis::V1::CloudRedis::FailoverInstance Failover}.
247
315
  # @!attribute [rw] name
248
316
  # @return [String]
249
317
  # Required. Redis instance resource name using the form:
250
318
  # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
251
- # where `location_id` refers to a GCP region
319
+ # where `location_id` refers to a GCP region.
252
320
  # @!attribute [rw] data_protection_mode
253
321
  # @return [Google::Cloud::Redis::V1::FailoverInstanceRequest::DataProtectionMode]
254
322
  # Optional. Available data protection modes that the user can choose. If it's
255
323
  # unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
256
324
  class FailoverInstanceRequest
257
325
  module DataProtectionMode
326
+ # Defaults to LIMITED_DATA_LOSS if a data protection mode is not
327
+ # specified.
258
328
  DATA_PROTECTION_MODE_UNSPECIFIED = 0
259
329
 
260
330
  # Instance failover will be protected with data loss control. More
@@ -29,6 +29,7 @@ require "google/longrunning/operations_client"
29
29
 
30
30
  require "google/cloud/redis/v1beta1/cloud_redis_pb"
31
31
  require "google/cloud/redis/v1beta1/credentials"
32
+ require "google/cloud/redis/version"
32
33
 
33
34
  module Google
34
35
  module Cloud
@@ -195,7 +196,7 @@ module Google
195
196
  updater_proc = credentials.updater_proc
196
197
  end
197
198
 
198
- package_version = Gem.loaded_specs['google-cloud-redis'].version.version
199
+ package_version = Google::Cloud::Redis::VERSION
199
200
 
200
201
  google_api_client = "gl-ruby/#{RUBY_VERSION}"
201
202
  google_api_client << " #{lib_name}/#{lib_version}" if lib_name
@@ -268,9 +269,17 @@ module Google
268
269
  {'instance.name' => request.instance.name}
269
270
  end
270
271
  )
271
- @delete_instance = Google::Gax.create_api_call(
272
- @cloud_redis_stub.method(:delete_instance),
273
- defaults["delete_instance"],
272
+ @import_instance = Google::Gax.create_api_call(
273
+ @cloud_redis_stub.method(:import_instance),
274
+ defaults["import_instance"],
275
+ exception_transformer: exception_transformer,
276
+ params_extractor: proc do |request|
277
+ {'name' => request.name}
278
+ end
279
+ )
280
+ @export_instance = Google::Gax.create_api_call(
281
+ @cloud_redis_stub.method(:export_instance),
282
+ defaults["export_instance"],
274
283
  exception_transformer: exception_transformer,
275
284
  params_extractor: proc do |request|
276
285
  {'name' => request.name}
@@ -284,6 +293,14 @@ module Google
284
293
  {'name' => request.name}
285
294
  end
286
295
  )
296
+ @delete_instance = Google::Gax.create_api_call(
297
+ @cloud_redis_stub.method(:delete_instance),
298
+ defaults["delete_instance"],
299
+ exception_transformer: exception_transformer,
300
+ params_extractor: proc do |request|
301
+ {'name' => request.name}
302
+ end
303
+ )
287
304
  end
288
305
 
289
306
  # Service calls
@@ -300,7 +317,7 @@ module Google
300
317
  # @param parent [String]
301
318
  # Required. The resource name of the instance location using the form:
302
319
  # `projects/{project_id}/locations/{location_id}`
303
- # where `location_id` refers to a GCP region
320
+ # where `location_id` refers to a GCP region.
304
321
  # @param page_size [Integer]
305
322
  # The maximum number of resources contained in the underlying API
306
323
  # response. If page streaming is performed per-resource, this
@@ -356,7 +373,7 @@ module Google
356
373
  # @param name [String]
357
374
  # Required. Redis instance resource name using the form:
358
375
  # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
359
- # where `location_id` refers to a GCP region
376
+ # where `location_id` refers to a GCP region.
360
377
  # @param options [Google::Gax::CallOptions]
361
378
  # Overrides the default settings for this call, e.g, timeout,
362
379
  # retries, etc.
@@ -399,7 +416,7 @@ module Google
399
416
  # @param parent [String]
400
417
  # Required. The resource name of the instance location using the form:
401
418
  # `projects/{project_id}/locations/{location_id}`
402
- # where `location_id` refers to a GCP region
419
+ # where `location_id` refers to a GCP region.
403
420
  # @param instance_id [String]
404
421
  # Required. The logical name of the Redis instance in the customer project
405
422
  # with the following restrictions:
@@ -563,13 +580,23 @@ module Google
563
580
  operation
564
581
  end
565
582
 
566
- # Deletes a specific Redis instance. Instance stops serving and data is
567
- # deleted.
583
+ # Import a Redis RDB snapshot file from Cloud Storage into a Redis instance.
584
+ #
585
+ # Redis may stop serving during this operation. Instance state will be
586
+ # IMPORTING for entire operation. When complete, the instance will contain
587
+ # only data from the imported file.
588
+ #
589
+ # The returned operation is automatically deleted after a few hours, so
590
+ # there is no need to call DeleteOperation.
568
591
  #
569
592
  # @param name [String]
570
593
  # Required. Redis instance resource name using the form:
571
594
  # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
572
- # where `location_id` refers to a GCP region
595
+ # where `location_id` refers to a GCP region.
596
+ # @param input_config [Google::Cloud::Redis::V1beta1::InputConfig | Hash]
597
+ # Required. Specify data to be imported.
598
+ # A hash of the same form as `Google::Cloud::Redis::V1beta1::InputConfig`
599
+ # can also be provided.
573
600
  # @param options [Google::Gax::CallOptions]
574
601
  # Overrides the default settings for this call, e.g, timeout,
575
602
  # retries, etc.
@@ -581,8 +608,11 @@ module Google
581
608
  # cloud_redis_client = Google::Cloud::Redis.new(version: :v1beta1)
582
609
  # formatted_name = Google::Cloud::Redis::V1beta1::CloudRedisClient.instance_path("[PROJECT]", "[LOCATION]", "[INSTANCE]")
583
610
  #
611
+ # # TODO: Initialize `input_config`:
612
+ # input_config = {}
613
+ #
584
614
  # # Register a callback during the method call.
585
- # operation = cloud_redis_client.delete_instance(formatted_name) do |op|
615
+ # operation = cloud_redis_client.import_instance(formatted_name, input_config) do |op|
586
616
  # raise op.results.message if op.error?
587
617
  # op_results = op.results
588
618
  # # Process the results.
@@ -608,17 +638,95 @@ module Google
608
638
  # # completion.
609
639
  # operation.wait_until_done!
610
640
 
611
- def delete_instance \
641
+ def import_instance \
612
642
  name,
643
+ input_config,
613
644
  options: nil
614
645
  req = {
615
- name: name
646
+ name: name,
647
+ input_config: input_config
616
648
  }.delete_if { |_, v| v.nil? }
617
- req = Google::Gax::to_proto(req, Google::Cloud::Redis::V1beta1::DeleteInstanceRequest)
649
+ req = Google::Gax::to_proto(req, Google::Cloud::Redis::V1beta1::ImportInstanceRequest)
618
650
  operation = Google::Gax::Operation.new(
619
- @delete_instance.call(req, options),
651
+ @import_instance.call(req, options),
620
652
  @operations_client,
621
- Google::Protobuf::Empty,
653
+ Google::Cloud::Redis::V1beta1::Instance,
654
+ Google::Protobuf::Any,
655
+ call_options: options
656
+ )
657
+ operation.on_done { |operation| yield(operation) } if block_given?
658
+ operation
659
+ end
660
+
661
+ # Export Redis instance data into a Redis RDB format file in Cloud Storage.
662
+ #
663
+ # Redis will continue serving during this operation.
664
+ #
665
+ # The returned operation is automatically deleted after a few hours, so
666
+ # there is no need to call DeleteOperation.
667
+ #
668
+ # @param name [String]
669
+ # Required. Redis instance resource name using the form:
670
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
671
+ # where `location_id` refers to a GCP region.
672
+ # @param output_config [Google::Cloud::Redis::V1beta1::OutputConfig | Hash]
673
+ # Required. Specify data to be exported.
674
+ # A hash of the same form as `Google::Cloud::Redis::V1beta1::OutputConfig`
675
+ # can also be provided.
676
+ # @param options [Google::Gax::CallOptions]
677
+ # Overrides the default settings for this call, e.g, timeout,
678
+ # retries, etc.
679
+ # @return [Google::Gax::Operation]
680
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
681
+ # @example
682
+ # require "google/cloud/redis"
683
+ #
684
+ # cloud_redis_client = Google::Cloud::Redis.new(version: :v1beta1)
685
+ # formatted_name = Google::Cloud::Redis::V1beta1::CloudRedisClient.instance_path("[PROJECT]", "[LOCATION]", "[INSTANCE]")
686
+ #
687
+ # # TODO: Initialize `output_config`:
688
+ # output_config = {}
689
+ #
690
+ # # Register a callback during the method call.
691
+ # operation = cloud_redis_client.export_instance(formatted_name, output_config) do |op|
692
+ # raise op.results.message if op.error?
693
+ # op_results = op.results
694
+ # # Process the results.
695
+ #
696
+ # metadata = op.metadata
697
+ # # Process the metadata.
698
+ # end
699
+ #
700
+ # # Or use the return value to register a callback.
701
+ # operation.on_done do |op|
702
+ # raise op.results.message if op.error?
703
+ # op_results = op.results
704
+ # # Process the results.
705
+ #
706
+ # metadata = op.metadata
707
+ # # Process the metadata.
708
+ # end
709
+ #
710
+ # # Manually reload the operation.
711
+ # operation.reload!
712
+ #
713
+ # # Or block until the operation completes, triggering callbacks on
714
+ # # completion.
715
+ # operation.wait_until_done!
716
+
717
+ def export_instance \
718
+ name,
719
+ output_config,
720
+ options: nil
721
+ req = {
722
+ name: name,
723
+ output_config: output_config
724
+ }.delete_if { |_, v| v.nil? }
725
+ req = Google::Gax::to_proto(req, Google::Cloud::Redis::V1beta1::ExportInstanceRequest)
726
+ operation = Google::Gax::Operation.new(
727
+ @export_instance.call(req, options),
728
+ @operations_client,
729
+ Google::Cloud::Redis::V1beta1::Instance,
622
730
  Google::Protobuf::Any,
623
731
  call_options: options
624
732
  )
@@ -626,13 +734,13 @@ module Google
626
734
  operation
627
735
  end
628
736
 
629
- # Failover the master role to current replica node against a specific
630
- # STANDARD tier redis instance.
737
+ # Initiates a failover of the master node to current replica node for a
738
+ # specific STANDARD tier Cloud Memorystore for Redis instance.
631
739
  #
632
740
  # @param name [String]
633
741
  # Required. Redis instance resource name using the form:
634
742
  # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
635
- # where `location_id` refers to a GCP region
743
+ # where `location_id` refers to a GCP region.
636
744
  # @param data_protection_mode [Google::Cloud::Redis::V1beta1::FailoverInstanceRequest::DataProtectionMode]
637
745
  # Optional. Available data protection modes that the user can choose. If it's
638
746
  # unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
@@ -696,6 +804,69 @@ module Google
696
804
  operation.on_done { |operation| yield(operation) } if block_given?
697
805
  operation
698
806
  end
807
+
808
+ # Deletes a specific Redis instance. Instance stops serving and data is
809
+ # deleted.
810
+ #
811
+ # @param name [String]
812
+ # Required. Redis instance resource name using the form:
813
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
814
+ # where `location_id` refers to a GCP region.
815
+ # @param options [Google::Gax::CallOptions]
816
+ # Overrides the default settings for this call, e.g, timeout,
817
+ # retries, etc.
818
+ # @return [Google::Gax::Operation]
819
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
820
+ # @example
821
+ # require "google/cloud/redis"
822
+ #
823
+ # cloud_redis_client = Google::Cloud::Redis.new(version: :v1beta1)
824
+ # formatted_name = Google::Cloud::Redis::V1beta1::CloudRedisClient.instance_path("[PROJECT]", "[LOCATION]", "[INSTANCE]")
825
+ #
826
+ # # Register a callback during the method call.
827
+ # operation = cloud_redis_client.delete_instance(formatted_name) do |op|
828
+ # raise op.results.message if op.error?
829
+ # op_results = op.results
830
+ # # Process the results.
831
+ #
832
+ # metadata = op.metadata
833
+ # # Process the metadata.
834
+ # end
835
+ #
836
+ # # Or use the return value to register a callback.
837
+ # operation.on_done do |op|
838
+ # raise op.results.message if op.error?
839
+ # op_results = op.results
840
+ # # Process the results.
841
+ #
842
+ # metadata = op.metadata
843
+ # # Process the metadata.
844
+ # end
845
+ #
846
+ # # Manually reload the operation.
847
+ # operation.reload!
848
+ #
849
+ # # Or block until the operation completes, triggering callbacks on
850
+ # # completion.
851
+ # operation.wait_until_done!
852
+
853
+ def delete_instance \
854
+ name,
855
+ options: nil
856
+ req = {
857
+ name: name
858
+ }.delete_if { |_, v| v.nil? }
859
+ req = Google::Gax::to_proto(req, Google::Cloud::Redis::V1beta1::DeleteInstanceRequest)
860
+ operation = Google::Gax::Operation.new(
861
+ @delete_instance.call(req, options),
862
+ @operations_client,
863
+ Google::Protobuf::Empty,
864
+ Google::Protobuf::Any,
865
+ call_options: options
866
+ )
867
+ operation.on_done { |operation| yield(operation) } if block_given?
868
+ operation
869
+ end
699
870
  end
700
871
  end
701
872
  end
@@ -40,7 +40,12 @@
40
40
  "retry_codes_name": "non_idempotent",
41
41
  "retry_params_name": "default"
42
42
  },
43
- "DeleteInstance": {
43
+ "ImportInstance": {
44
+ "timeout_millis": 60000,
45
+ "retry_codes_name": "non_idempotent",
46
+ "retry_params_name": "default"
47
+ },
48
+ "ExportInstance": {
44
49
  "timeout_millis": 60000,
45
50
  "retry_codes_name": "non_idempotent",
46
51
  "retry_params_name": "default"
@@ -49,6 +54,11 @@
49
54
  "timeout_millis": 60000,
50
55
  "retry_codes_name": "non_idempotent",
51
56
  "retry_params_name": "default"
57
+ },
58
+ "DeleteInstance": {
59
+ "timeout_millis": 60000,
60
+ "retry_codes_name": "non_idempotent",
61
+ "retry_params_name": "default"
52
62
  }
53
63
  }
54
64
  }
@@ -5,10 +5,10 @@
5
5
  require 'google/protobuf'
6
6
 
7
7
  require 'google/api/annotations_pb'
8
- require 'google/api/resource_pb'
9
8
  require 'google/longrunning/operations_pb'
10
9
  require 'google/protobuf/field_mask_pb'
11
10
  require 'google/protobuf/timestamp_pb'
11
+ require 'google/api/client_pb'
12
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
13
13
  add_message "google.cloud.redis.v1beta1.Instance" do
14
14
  optional :name, :string, 1
@@ -28,6 +28,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
28
28
  optional :tier, :enum, 17, "google.cloud.redis.v1beta1.Instance.Tier"
29
29
  optional :memory_size_gb, :int32, 18
30
30
  optional :authorized_network, :string, 20
31
+ optional :persistence_iam_identity, :string, 21
31
32
  end
32
33
  add_enum "google.cloud.redis.v1beta1.Instance.State" do
33
34
  value :STATE_UNSPECIFIED, 0
@@ -70,6 +71,30 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
70
71
  add_message "google.cloud.redis.v1beta1.DeleteInstanceRequest" do
71
72
  optional :name, :string, 1
72
73
  end
74
+ add_message "google.cloud.redis.v1beta1.GcsSource" do
75
+ optional :uri, :string, 1
76
+ end
77
+ add_message "google.cloud.redis.v1beta1.InputConfig" do
78
+ oneof :source do
79
+ optional :gcs_source, :message, 1, "google.cloud.redis.v1beta1.GcsSource"
80
+ end
81
+ end
82
+ add_message "google.cloud.redis.v1beta1.ImportInstanceRequest" do
83
+ optional :name, :string, 1
84
+ optional :input_config, :message, 3, "google.cloud.redis.v1beta1.InputConfig"
85
+ end
86
+ add_message "google.cloud.redis.v1beta1.GcsDestination" do
87
+ optional :uri, :string, 1
88
+ end
89
+ add_message "google.cloud.redis.v1beta1.OutputConfig" do
90
+ oneof :destination do
91
+ optional :gcs_destination, :message, 1, "google.cloud.redis.v1beta1.GcsDestination"
92
+ end
93
+ end
94
+ add_message "google.cloud.redis.v1beta1.ExportInstanceRequest" do
95
+ optional :name, :string, 1
96
+ optional :output_config, :message, 3, "google.cloud.redis.v1beta1.OutputConfig"
97
+ end
73
98
  add_message "google.cloud.redis.v1beta1.FailoverInstanceRequest" do
74
99
  optional :name, :string, 1
75
100
  optional :data_protection_mode, :enum, 2, "google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode"
@@ -99,6 +124,12 @@ module Google
99
124
  CreateInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.CreateInstanceRequest").msgclass
100
125
  UpdateInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.UpdateInstanceRequest").msgclass
101
126
  DeleteInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.DeleteInstanceRequest").msgclass
127
+ GcsSource = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.GcsSource").msgclass
128
+ InputConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.InputConfig").msgclass
129
+ ImportInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.ImportInstanceRequest").msgclass
130
+ GcsDestination = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.GcsDestination").msgclass
131
+ OutputConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.OutputConfig").msgclass
132
+ ExportInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.ExportInstanceRequest").msgclass
102
133
  FailoverInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.FailoverInstanceRequest").msgclass
103
134
  FailoverInstanceRequest::DataProtectionMode = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode").enummodule
104
135
  LocationMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.LocationMetadata").msgclass
@@ -79,8 +79,24 @@ module Google
79
79
  # in the response field. The returned operation is automatically deleted
80
80
  # after a few hours, so there is no need to call DeleteOperation.
81
81
  rpc :UpdateInstance, UpdateInstanceRequest, Google::Longrunning::Operation
82
- # Failover the master role to current replica node against a specific
83
- # STANDARD tier redis instance.
82
+ # Import a Redis RDB snapshot file from Cloud Storage into a Redis instance.
83
+ #
84
+ # Redis may stop serving during this operation. Instance state will be
85
+ # IMPORTING for entire operation. When complete, the instance will contain
86
+ # only data from the imported file.
87
+ #
88
+ # The returned operation is automatically deleted after a few hours, so
89
+ # there is no need to call DeleteOperation.
90
+ rpc :ImportInstance, ImportInstanceRequest, Google::Longrunning::Operation
91
+ # Export Redis instance data into a Redis RDB format file in Cloud Storage.
92
+ #
93
+ # Redis will continue serving during this operation.
94
+ #
95
+ # The returned operation is automatically deleted after a few hours, so
96
+ # there is no need to call DeleteOperation.
97
+ rpc :ExportInstance, ExportInstanceRequest, Google::Longrunning::Operation
98
+ # Initiates a failover of the master node to current replica node for a
99
+ # specific STANDARD tier Cloud Memorystore for Redis instance.
84
100
  rpc :FailoverInstance, FailoverInstanceRequest, Google::Longrunning::Operation
85
101
  # Deletes a specific Redis instance. Instance stops serving and data is
86
102
  # deleted.
@@ -54,8 +54,8 @@ module Google
54
54
  # version will perform an upgrade/downgrade to the new version. Currently,
55
55
  # the supported values are:
56
56
  #
57
- # * `REDIS_4_0` for Redis 4.0 compatibility
58
- # * `REDIS_3_2` for Redis 3.2 compatibility (default)
57
+ # * `REDIS_4_0` for Redis 4.0 compatibility (default)
58
+ # * `REDIS_3_2` for Redis 3.2 compatibility
59
59
  # @!attribute [rw] reserved_ip_range
60
60
  # @return [String]
61
61
  # Optional. The CIDR range of internal addresses that are reserved for this
@@ -114,6 +114,13 @@ module Google
114
114
  # [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to which the
115
115
  # instance is connected. If left unspecified, the `default` network
116
116
  # will be used.
117
+ # @!attribute [rw] persistence_iam_identity
118
+ # @return [String]
119
+ # Output only. Cloud IAM identity used by import / export operations to
120
+ # transfer data to/from Cloud Storage. Format is
121
+ # "serviceAccount:<service_account_email>". The value may change over time
122
+ # for a given instance so should be checked before each import/export
123
+ # operation.
117
124
  class Instance
118
125
  # Represents the different states of a Redis instance.
119
126
  module State
@@ -160,13 +167,12 @@ module Google
160
167
  end
161
168
  end
162
169
 
163
- # Request for
164
- # {Google::Cloud::Redis::V1beta1::CloudRedis::ListInstances ListInstances}.
170
+ # Request for {Google::Cloud::Redis::V1beta1::CloudRedis::ListInstances ListInstances}.
165
171
  # @!attribute [rw] parent
166
172
  # @return [String]
167
173
  # Required. The resource name of the instance location using the form:
168
174
  # `projects/{project_id}/locations/{location_id}`
169
- # where `location_id` refers to a GCP region
175
+ # where `location_id` refers to a GCP region.
170
176
  # @!attribute [rw] page_size
171
177
  # @return [Integer]
172
178
  # The maximum number of items to return.
@@ -182,8 +188,7 @@ module Google
182
188
  # if any.
183
189
  class ListInstancesRequest; end
184
190
 
185
- # Response for
186
- # {Google::Cloud::Redis::V1beta1::CloudRedis::ListInstances ListInstances}.
191
+ # Response for {Google::Cloud::Redis::V1beta1::CloudRedis::ListInstances ListInstances}.
187
192
  # @!attribute [rw] instances
188
193
  # @return [Array<Google::Cloud::Redis::V1beta1::Instance>]
189
194
  # A list of Redis instances in the project in the specified location,
@@ -210,16 +215,15 @@ module Google
210
215
  # @return [String]
211
216
  # Required. Redis instance resource name using the form:
212
217
  # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
213
- # where `location_id` refers to a GCP region
218
+ # where `location_id` refers to a GCP region.
214
219
  class GetInstanceRequest; end
215
220
 
216
- # Request for
217
- # {Google::Cloud::Redis::V1beta1::CloudRedis::CreateInstance CreateInstance}.
221
+ # Request for {Google::Cloud::Redis::V1beta1::CloudRedis::CreateInstance CreateInstance}.
218
222
  # @!attribute [rw] parent
219
223
  # @return [String]
220
224
  # Required. The resource name of the instance location using the form:
221
225
  # `projects/{project_id}/locations/{location_id}`
222
- # where `location_id` refers to a GCP region
226
+ # where `location_id` refers to a GCP region.
223
227
  # @!attribute [rw] instance_id
224
228
  # @return [String]
225
229
  # Required. The logical name of the Redis instance in the customer project
@@ -235,8 +239,7 @@ module Google
235
239
  # Required. A Redis [Instance] resource
236
240
  class CreateInstanceRequest; end
237
241
 
238
- # Request for
239
- # {Google::Cloud::Redis::V1beta1::CloudRedis::UpdateInstance UpdateInstance}.
242
+ # Request for {Google::Cloud::Redis::V1beta1::CloudRedis::UpdateInstance UpdateInstance}.
240
243
  # @!attribute [rw] update_mask
241
244
  # @return [Google::Protobuf::FieldMask]
242
245
  # Required. Mask of fields to update. At least one path must be supplied in
@@ -253,28 +256,75 @@ module Google
253
256
  # Only fields specified in update_mask are updated.
254
257
  class UpdateInstanceRequest; end
255
258
 
256
- # Request for
257
- # {Google::Cloud::Redis::V1beta1::CloudRedis::DeleteInstance DeleteInstance}.
259
+ # Request for {Google::Cloud::Redis::V1beta1::CloudRedis::DeleteInstance DeleteInstance}.
258
260
  # @!attribute [rw] name
259
261
  # @return [String]
260
262
  # Required. Redis instance resource name using the form:
261
263
  # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
262
- # where `location_id` refers to a GCP region
264
+ # where `location_id` refers to a GCP region.
263
265
  class DeleteInstanceRequest; end
264
266
 
265
- # Request for
266
- # {Google::Cloud::Redis::V1beta1::CloudRedis::FailoverInstance Failover}.
267
+ # The Cloud Storage location for the input content
268
+ # @!attribute [rw] uri
269
+ # @return [String]
270
+ # Required. Source data URI. (e.g. 'gs://my_bucket/my_object').
271
+ class GcsSource; end
272
+
273
+ # The input content
274
+ # @!attribute [rw] gcs_source
275
+ # @return [Google::Cloud::Redis::V1beta1::GcsSource]
276
+ # Google Cloud Storage location where input content is located.
277
+ class InputConfig; end
278
+
279
+ # Request for {Google::Cloud::Redis::V1beta1::CloudRedis::ImportInstance Import}.
280
+ # @!attribute [rw] name
281
+ # @return [String]
282
+ # Required. Redis instance resource name using the form:
283
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
284
+ # where `location_id` refers to a GCP region.
285
+ # @!attribute [rw] input_config
286
+ # @return [Google::Cloud::Redis::V1beta1::InputConfig]
287
+ # Required. Specify data to be imported.
288
+ class ImportInstanceRequest; end
289
+
290
+ # The Cloud Storage location for the output content
291
+ # @!attribute [rw] uri
292
+ # @return [String]
293
+ # Required. Data destination URI (e.g.
294
+ # 'gs://my_bucket/my_object'). Existing files will be overwritten.
295
+ class GcsDestination; end
296
+
297
+ # The output content
298
+ # @!attribute [rw] gcs_destination
299
+ # @return [Google::Cloud::Redis::V1beta1::GcsDestination]
300
+ # Google Cloud Storage destination for output content.
301
+ class OutputConfig; end
302
+
303
+ # Request for {Google::Cloud::Redis::V1beta1::CloudRedis::ExportInstance Export}.
304
+ # @!attribute [rw] name
305
+ # @return [String]
306
+ # Required. Redis instance resource name using the form:
307
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
308
+ # where `location_id` refers to a GCP region.
309
+ # @!attribute [rw] output_config
310
+ # @return [Google::Cloud::Redis::V1beta1::OutputConfig]
311
+ # Required. Specify data to be exported.
312
+ class ExportInstanceRequest; end
313
+
314
+ # Request for {Google::Cloud::Redis::V1beta1::CloudRedis::FailoverInstance Failover}.
267
315
  # @!attribute [rw] name
268
316
  # @return [String]
269
317
  # Required. Redis instance resource name using the form:
270
318
  # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
271
- # where `location_id` refers to a GCP region
319
+ # where `location_id` refers to a GCP region.
272
320
  # @!attribute [rw] data_protection_mode
273
321
  # @return [Google::Cloud::Redis::V1beta1::FailoverInstanceRequest::DataProtectionMode]
274
322
  # Optional. Available data protection modes that the user can choose. If it's
275
323
  # unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
276
324
  class FailoverInstanceRequest
277
325
  module DataProtectionMode
326
+ # Defaults to LIMITED_DATA_LOSS if a data protection mode is not
327
+ # specified.
278
328
  DATA_PROTECTION_MODE_UNSPECIFIED = 0
279
329
 
280
330
  # Instance failover will be protected with data loss control. More
@@ -0,0 +1,22 @@
1
+ # Copyright 2019 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
16
+ module Google
17
+ module Cloud
18
+ module Redis
19
+ VERSION = "0.4.0".freeze
20
+ end
21
+ end
22
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.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: 2019-04-30 00:00:00.000000000 Z
11
+ date: 2019-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-gax
@@ -150,6 +150,7 @@ files:
150
150
  - lib/google/cloud/redis/v1beta1/doc/google/protobuf/field_mask.rb
151
151
  - lib/google/cloud/redis/v1beta1/doc/google/protobuf/timestamp.rb
152
152
  - lib/google/cloud/redis/v1beta1/doc/google/rpc/status.rb
153
+ - lib/google/cloud/redis/version.rb
153
154
  homepage: https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-redis
154
155
  licenses:
155
156
  - Apache-2.0