google-cloud-redis-v1 0.2.1 → 0.3.2

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: bd9b66f0cb0b8f423cc17cb0aa57954fc039fb782e3efd81ece46a6394de51fb
4
- data.tar.gz: 6c56667fb4e756692c0f3dc1193fe48975fd32a231fbdef74c30dc3f75fba984
3
+ metadata.gz: 281193e2e6cea0cc06c389ba25652697681188bd37203f2628a1b9c44d4d84fc
4
+ data.tar.gz: b2226f402c0824851c445df4ea3073ac80d446a9e10de323415212ff66c78675
5
5
  SHA512:
6
- metadata.gz: f081bb0f063dd56162ddad4e56668a393a40278367ccc87a2237abfe28a5ff6903a7d055c3de07e9cfbe50604edb1fcc94d3ed97f75d8cdae0f7ca0a8173ddff
7
- data.tar.gz: 741d2c131d50148b081f452cdd8a5cb48d241be910c44ec992c515509e023671a4222e8a66b21d08f7bda3e2f489bc35930fb6d1ac59c3a0bdd763f05ddcb625
6
+ metadata.gz: 5ffd5e6d547c22a3e5e96d6e42f7cb04431b3ca6a68ccc54e9f59b111ed2642dc8eaaa0e726d6087b38695f31b20c4cf9be50a03566c9adfa9a1febe803a443d
7
+ data.tar.gz: ebd9d1838b66b5c3b4947fe99a6e102e979defc298f5efb2a9fbb6c98e59ad67ca7606d1f119b034b49c7f75d4532f8f9adfc02453cc627373108ebbb984ce43
data/README.md CHANGED
@@ -18,6 +18,7 @@ In order to use this library, you first need to go through the following steps:
18
18
 
19
19
  1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
20
20
  1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
21
+ 1. [Enable the API.](https://console.cloud.google.com/apis/library/redis.googleapis.com)
21
22
  1. {file:AUTHENTICATION.md Set up authentication.}
22
23
 
23
24
  ## Quick Start
@@ -33,6 +34,9 @@ response = client.list_instances request
33
34
  View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-redis-v1/latest)
34
35
  for class and method documentation.
35
36
 
37
+ See also the [Product Documentation](https://cloud.google.com/memorystore/docs/redis)
38
+ for general usage information.
39
+
36
40
  ## Enabling Logging
37
41
 
38
42
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
@@ -87,6 +87,8 @@ module Google
87
87
 
88
88
  default_config.rpcs.update_instance.timeout = 600.0
89
89
 
90
+ default_config.rpcs.upgrade_instance.timeout = 600.0
91
+
90
92
  default_config.rpcs.import_instance.timeout = 600.0
91
93
 
92
94
  default_config.rpcs.export_instance.timeout = 600.0
@@ -346,7 +348,7 @@ module Google
346
348
  # Creates a Redis instance based on the specified tier and memory size.
347
349
  #
348
350
  # By default, the instance is accessible from the project's
349
- # [default network](/compute/docs/networks-and-firewalls#networks).
351
+ # [default network](https://cloud.google.com/vpc/docs/vpc).
350
352
  #
351
353
  # The creation is executed asynchronously and callers may check the returned
352
354
  # operation to track its progress. Once the operation is completed the Redis
@@ -514,6 +516,78 @@ module Google
514
516
  raise ::Google::Cloud::Error.from_error(e)
515
517
  end
516
518
 
519
+ ##
520
+ # Upgrades Redis instance to the newer Redis version specified in the
521
+ # request.
522
+ #
523
+ # @overload upgrade_instance(request, options = nil)
524
+ # Pass arguments to `upgrade_instance` via a request object, either of type
525
+ # {::Google::Cloud::Redis::V1::UpgradeInstanceRequest} or an equivalent Hash.
526
+ #
527
+ # @param request [::Google::Cloud::Redis::V1::UpgradeInstanceRequest, ::Hash]
528
+ # A request object representing the call parameters. Required. To specify no
529
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
530
+ # @param options [::Gapic::CallOptions, ::Hash]
531
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
532
+ #
533
+ # @overload upgrade_instance(name: nil, redis_version: nil)
534
+ # Pass arguments to `upgrade_instance` via keyword arguments. Note that at
535
+ # least one keyword argument is required. To specify no parameters, or to keep all
536
+ # the default parameter values, pass an empty Hash as a request object (see above).
537
+ #
538
+ # @param name [::String]
539
+ # Required. Redis instance resource name using the form:
540
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
541
+ # where `location_id` refers to a GCP region.
542
+ # @param redis_version [::String]
543
+ # Required. Specifies the target version of Redis software to upgrade to.
544
+ #
545
+ # @yield [response, operation] Access the result along with the RPC operation
546
+ # @yieldparam response [::Gapic::Operation]
547
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
548
+ #
549
+ # @return [::Gapic::Operation]
550
+ #
551
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
552
+ #
553
+ def upgrade_instance request, options = nil
554
+ raise ::ArgumentError, "request must be provided" if request.nil?
555
+
556
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::UpgradeInstanceRequest
557
+
558
+ # Converts hash and nil to an options object
559
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
560
+
561
+ # Customize the options with defaults
562
+ metadata = @config.rpcs.upgrade_instance.metadata.to_h
563
+
564
+ # Set x-goog-api-client and x-goog-user-project headers
565
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
566
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
567
+ gapic_version: ::Google::Cloud::Redis::V1::VERSION
568
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
569
+
570
+ header_params = {
571
+ "name" => request.name
572
+ }
573
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
574
+ metadata[:"x-goog-request-params"] ||= request_params_header
575
+
576
+ options.apply_defaults timeout: @config.rpcs.upgrade_instance.timeout,
577
+ metadata: metadata,
578
+ retry_policy: @config.rpcs.upgrade_instance.retry_policy
579
+ options.apply_defaults metadata: @config.metadata,
580
+ retry_policy: @config.retry_policy
581
+
582
+ @cloud_redis_stub.call_rpc :upgrade_instance, request, options: options do |response, operation|
583
+ response = ::Gapic::Operation.new response, @operations_client, options: options
584
+ yield response, operation if block_given?
585
+ return response
586
+ end
587
+ rescue ::GRPC::BadStatus => e
588
+ raise ::Google::Cloud::Error.from_error(e)
589
+ end
590
+
517
591
  ##
518
592
  # Import a Redis RDB snapshot file from Cloud Storage into a Redis instance.
519
593
  #
@@ -896,7 +970,7 @@ module Google
896
970
 
897
971
  config_attr :endpoint, "redis.googleapis.com", ::String
898
972
  config_attr :credentials, nil do |value|
899
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
973
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
900
974
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
901
975
  allowed.any? { |klass| klass === value }
902
976
  end
@@ -924,7 +998,7 @@ module Google
924
998
  def rpcs
925
999
  @rpcs ||= begin
926
1000
  parent_rpcs = nil
927
- parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
1001
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
928
1002
  Rpcs.new parent_rpcs
929
1003
  end
930
1004
  end
@@ -968,6 +1042,11 @@ module Google
968
1042
  #
969
1043
  attr_reader :update_instance
970
1044
  ##
1045
+ # RPC-specific configuration for `upgrade_instance`
1046
+ # @return [::Gapic::Config::Method]
1047
+ #
1048
+ attr_reader :upgrade_instance
1049
+ ##
971
1050
  # RPC-specific configuration for `import_instance`
972
1051
  # @return [::Gapic::Config::Method]
973
1052
  #
@@ -998,6 +1077,8 @@ module Google
998
1077
  @create_instance = ::Gapic::Config::Method.new create_instance_config
999
1078
  update_instance_config = parent_rpcs&.update_instance if parent_rpcs&.respond_to? :update_instance
1000
1079
  @update_instance = ::Gapic::Config::Method.new update_instance_config
1080
+ upgrade_instance_config = parent_rpcs&.upgrade_instance if parent_rpcs&.respond_to? :upgrade_instance
1081
+ @upgrade_instance = ::Gapic::Config::Method.new upgrade_instance_config
1001
1082
  import_instance_config = parent_rpcs&.import_instance if parent_rpcs&.respond_to? :import_instance
1002
1083
  @import_instance = ::Gapic::Config::Method.new import_instance_config
1003
1084
  export_instance_config = parent_rpcs&.export_instance if parent_rpcs&.respond_to? :export_instance
@@ -475,7 +475,7 @@ module Google
475
475
 
476
476
  config_attr :endpoint, "redis.googleapis.com", ::String
477
477
  config_attr :credentials, nil do |value|
478
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
478
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
479
479
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
480
480
  allowed.any? { |klass| klass === value }
481
481
  end
@@ -503,7 +503,7 @@ module Google
503
503
  def rpcs
504
504
  @rpcs ||= begin
505
505
  parent_rpcs = nil
506
- parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
506
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
507
507
  Rpcs.new parent_rpcs
508
508
  end
509
509
  end
@@ -76,6 +76,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
76
76
  optional :update_mask, :message, 1, "google.protobuf.FieldMask"
77
77
  optional :instance, :message, 2, "google.cloud.redis.v1.Instance"
78
78
  end
79
+ add_message "google.cloud.redis.v1.UpgradeInstanceRequest" do
80
+ optional :name, :string, 1
81
+ optional :redis_version, :string, 2
82
+ end
79
83
  add_message "google.cloud.redis.v1.DeleteInstanceRequest" do
80
84
  optional :name, :string, 1
81
85
  end
@@ -142,6 +146,7 @@ module Google
142
146
  GetInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.GetInstanceRequest").msgclass
143
147
  CreateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.CreateInstanceRequest").msgclass
144
148
  UpdateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.UpdateInstanceRequest").msgclass
149
+ UpgradeInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.UpgradeInstanceRequest").msgclass
145
150
  DeleteInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.DeleteInstanceRequest").msgclass
146
151
  GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.GcsSource").msgclass
147
152
  InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.InputConfig").msgclass
@@ -56,13 +56,13 @@ module Google
56
56
  #
57
57
  # If `location_id` is specified as `-` (wildcard), then all regions
58
58
  # available to the project are queried, and the results are aggregated.
59
- rpc :ListInstances, ListInstancesRequest, ListInstancesResponse
59
+ rpc :ListInstances, Google::Cloud::Redis::V1::ListInstancesRequest, Google::Cloud::Redis::V1::ListInstancesResponse
60
60
  # Gets the details of a specific Redis instance.
61
- rpc :GetInstance, GetInstanceRequest, Instance
61
+ rpc :GetInstance, Google::Cloud::Redis::V1::GetInstanceRequest, Google::Cloud::Redis::V1::Instance
62
62
  # Creates a Redis instance based on the specified tier and memory size.
63
63
  #
64
64
  # By default, the instance is accessible from the project's
65
- # [default network](/compute/docs/networks-and-firewalls#networks).
65
+ # [default network](https://cloud.google.com/vpc/docs/vpc).
66
66
  #
67
67
  # The creation is executed asynchronously and callers may check the returned
68
68
  # operation to track its progress. Once the operation is completed the Redis
@@ -71,13 +71,16 @@ module Google
71
71
  #
72
72
  # The returned operation is automatically deleted after a few hours, so there
73
73
  # is no need to call DeleteOperation.
74
- rpc :CreateInstance, CreateInstanceRequest, Google::Longrunning::Operation
74
+ rpc :CreateInstance, Google::Cloud::Redis::V1::CreateInstanceRequest, Google::Longrunning::Operation
75
75
  # Updates the metadata and configuration of a specific Redis instance.
76
76
  #
77
77
  # Completed longrunning.Operation will contain the new instance object
78
78
  # in the response field. The returned operation is automatically deleted
79
79
  # after a few hours, so there is no need to call DeleteOperation.
80
- rpc :UpdateInstance, UpdateInstanceRequest, Google::Longrunning::Operation
80
+ rpc :UpdateInstance, Google::Cloud::Redis::V1::UpdateInstanceRequest, Google::Longrunning::Operation
81
+ # Upgrades Redis instance to the newer Redis version specified in the
82
+ # request.
83
+ rpc :UpgradeInstance, Google::Cloud::Redis::V1::UpgradeInstanceRequest, Google::Longrunning::Operation
81
84
  # Import a Redis RDB snapshot file from Cloud Storage into a Redis instance.
82
85
  #
83
86
  # Redis may stop serving during this operation. Instance state will be
@@ -86,20 +89,20 @@ module Google
86
89
  #
87
90
  # The returned operation is automatically deleted after a few hours, so
88
91
  # there is no need to call DeleteOperation.
89
- rpc :ImportInstance, ImportInstanceRequest, Google::Longrunning::Operation
92
+ rpc :ImportInstance, Google::Cloud::Redis::V1::ImportInstanceRequest, Google::Longrunning::Operation
90
93
  # Export Redis instance data into a Redis RDB format file in Cloud Storage.
91
94
  #
92
95
  # Redis will continue serving during this operation.
93
96
  #
94
97
  # The returned operation is automatically deleted after a few hours, so
95
98
  # there is no need to call DeleteOperation.
96
- rpc :ExportInstance, ExportInstanceRequest, Google::Longrunning::Operation
99
+ rpc :ExportInstance, Google::Cloud::Redis::V1::ExportInstanceRequest, Google::Longrunning::Operation
97
100
  # Initiates a failover of the master node to current replica node for a
98
101
  # specific STANDARD tier Cloud Memorystore for Redis instance.
99
- rpc :FailoverInstance, FailoverInstanceRequest, Google::Longrunning::Operation
102
+ rpc :FailoverInstance, Google::Cloud::Redis::V1::FailoverInstanceRequest, Google::Longrunning::Operation
100
103
  # Deletes a specific Redis instance. Instance stops serving and data is
101
104
  # deleted.
102
- rpc :DeleteInstance, DeleteInstanceRequest, Google::Longrunning::Operation
105
+ rpc :DeleteInstance, Google::Cloud::Redis::V1::DeleteInstanceRequest, Google::Longrunning::Operation
103
106
  end
104
107
 
105
108
  Stub = Service.rpc_stub_class
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Redis
23
23
  module V1
24
- VERSION = "0.2.1"
24
+ VERSION = "0.3.2"
25
25
  end
26
26
  end
27
27
  end
@@ -121,7 +121,7 @@ module Google
121
121
  # @!attribute [rw] authorized_network
122
122
  # @return [::String]
123
123
  # Optional. The full name of the Google Compute Engine
124
- # [network](/compute/docs/networks-and-firewalls#networks) to which the
124
+ # [network](https://cloud.google.com/vpc/docs/vpc) to which the
125
125
  # instance is connected. If left unspecified, the `default` network
126
126
  # will be used.
127
127
  # @!attribute [r] persistence_iam_identity
@@ -133,9 +133,8 @@ module Google
133
133
  # operation.
134
134
  # @!attribute [rw] connect_mode
135
135
  # @return [::Google::Cloud::Redis::V1::Instance::ConnectMode]
136
- # Optional. The connect mode of Redis instance.
137
- # If not provided, default one will be used.
138
- # Current default: DIRECT_PEERING.
136
+ # Optional. The network connect mode of the Redis instance.
137
+ # If not provided, the connect mode defaults to DIRECT_PEERING.
139
138
  class Instance
140
139
  include ::Google::Protobuf::MessageExts
141
140
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -207,11 +206,12 @@ module Google
207
206
  # Not set.
208
207
  CONNECT_MODE_UNSPECIFIED = 0
209
208
 
210
- # Connect via directly peering with memorystore redis hosted service.
209
+ # Connect via direct peering to the Memorystore for Redis hosted service.
211
210
  DIRECT_PEERING = 1
212
211
 
213
- # Connect with google via private service access and share connection
214
- # across google managed services.
212
+ # Connect your Memorystore for Redis instance using Private Service
213
+ # Access. Private services access provides an IP address range for multiple
214
+ # Google Cloud services, including Memorystore.
215
215
  PRIVATE_SERVICE_ACCESS = 2
216
216
  end
217
217
  end
@@ -320,6 +320,20 @@ module Google
320
320
  extend ::Google::Protobuf::MessageExts::ClassMethods
321
321
  end
322
322
 
323
+ # Request for {::Google::Cloud::Redis::V1::CloudRedis::Client#upgrade_instance UpgradeInstance}.
324
+ # @!attribute [rw] name
325
+ # @return [::String]
326
+ # Required. Redis instance resource name using the form:
327
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
328
+ # where `location_id` refers to a GCP region.
329
+ # @!attribute [rw] redis_version
330
+ # @return [::String]
331
+ # Required. Specifies the target version of Redis software to upgrade to.
332
+ class UpgradeInstanceRequest
333
+ include ::Google::Protobuf::MessageExts
334
+ extend ::Google::Protobuf::MessageExts::ClassMethods
335
+ end
336
+
323
337
  # Request for {::Google::Cloud::Redis::V1::CloudRedis::Client#delete_instance DeleteInstance}.
324
338
  # @!attribute [rw] name
325
339
  # @return [::String]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-redis-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-26 00:00:00.000000000 Z
11
+ date: 2020-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.2'
19
+ version: '0.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.2'
26
+ version: '0.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: google-cloud-errors
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
199
  - !ruby/object:Gem::Version
200
200
  version: '0'
201
201
  requirements: []
202
- rubygems_version: 3.0.6
202
+ rubygems_version: 3.1.3
203
203
  signing_key:
204
204
  specification_version: 4
205
205
  summary: API Client library for the Google Cloud Memorystore for Redis V1 API