google-cloud-redis-v1 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9db09d5d687a7c7e04b954ba99e87b4e7d972952f839e40ad2ae56aff7cec00c
4
- data.tar.gz: fa4386a70ebb090d042d09671272d92ee5301e24059e33b7cbf73ae925d0ed4c
3
+ metadata.gz: ca8eb543d548c116f322adab922ba46b308bc76b7614d5234e8b7df65e144e86
4
+ data.tar.gz: 3d391f59e85102bb34c1a8bed0785eb2a70f77a80384fc5a31872e2fb10039cf
5
5
  SHA512:
6
- metadata.gz: a573d10381e38beb34ab80f56080cd25e2495b58d5f66bf8c7bae49a14f16b21d103b60a7bd31f93c12368133c81c3edf967b3b7823e48c39229a3098c845844
7
- data.tar.gz: 4518434cf6a34832a3ede77af09e35116aa2ad474f3705e977910e0ea79888ddefb1f6d3653812084ae9f7633894850b05c125c2e84384af7ca438ba61c2e531
6
+ metadata.gz: 7d834dd9cb72f7e256a9e358ecfd2a8e7b9aa3df4a024bf7b238ac45c6a7996dc1819b952578454722d8cfa7f2ae08a653456d6836ddadafb42afd06b8afe5d6
7
+ data.tar.gz: d0f432aad2978b86e85524fafcbb2939276c1f29c5c24a7c178b56560df7ff2ef89f75a3f1339381e69d8d094a1a438ad725607e2492b8036b846924be3ab1ce
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
  #
@@ -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
@@ -85,6 +85,8 @@ module Google
85
85
  if credentials.is_a?(String) || credentials.is_a?(Hash)
86
86
  credentials = Credentials.new credentials, scope: @config.scope
87
87
  end
88
+ @quota_project_id = @config.quota_project
89
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
88
90
 
89
91
  @operations_stub = ::Gapic::ServiceStub.new(
90
92
  ::Google::Longrunning::Operations::Stub,
@@ -501,7 +503,7 @@ module Google
501
503
  def rpcs
502
504
  @rpcs ||= begin
503
505
  parent_rpcs = nil
504
- 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)
505
507
  Rpcs.new parent_rpcs
506
508
  end
507
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.0"
24
+ VERSION = "0.3.1"
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.0
4
+ version: 0.3.1
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-20 00:00:00.000000000 Z
11
+ date: 2020-08-06 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
@@ -161,7 +161,6 @@ files:
161
161
  - LICENSE.md
162
162
  - README.md
163
163
  - lib/google-cloud-redis-v1.rb
164
- - lib/google/cloud/common_resources_pb.rb
165
164
  - lib/google/cloud/redis/v1.rb
166
165
  - lib/google/cloud/redis/v1/cloud_redis.rb
167
166
  - lib/google/cloud/redis/v1/cloud_redis/client.rb
@@ -200,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
199
  - !ruby/object:Gem::Version
201
200
  version: '0'
202
201
  requirements: []
203
- rubygems_version: 3.0.6
202
+ rubygems_version: 3.1.3
204
203
  signing_key:
205
204
  specification_version: 4
206
205
  summary: API Client library for the Google Cloud Memorystore for Redis V1 API
@@ -1,15 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/cloud/common_resources.proto
3
-
4
- require 'google/protobuf'
5
-
6
- require 'google/api/resource_pb'
7
- Google::Protobuf::DescriptorPool.generated_pool.build do
8
- add_file("google/cloud/common_resources.proto", :syntax => :proto3) do
9
- end
10
- end
11
-
12
- module Google
13
- module Cloud
14
- end
15
- end