google-cloud-redis 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,51 @@
1
+ {
2
+ "interfaces": {
3
+ "google.cloud.redis.v1beta1.CloudRedis": {
4
+ "retry_codes": {
5
+ "idempotent": [
6
+ "DEADLINE_EXCEEDED",
7
+ "UNAVAILABLE"
8
+ ],
9
+ "non_idempotent": []
10
+ },
11
+ "retry_params": {
12
+ "default": {
13
+ "initial_retry_delay_millis": 100,
14
+ "retry_delay_multiplier": 1.3,
15
+ "max_retry_delay_millis": 60000,
16
+ "initial_rpc_timeout_millis": 20000,
17
+ "rpc_timeout_multiplier": 1.0,
18
+ "max_rpc_timeout_millis": 20000,
19
+ "total_timeout_millis": 600000
20
+ }
21
+ },
22
+ "methods": {
23
+ "ListInstances": {
24
+ "timeout_millis": 60000,
25
+ "retry_codes_name": "non_idempotent",
26
+ "retry_params_name": "default"
27
+ },
28
+ "GetInstance": {
29
+ "timeout_millis": 60000,
30
+ "retry_codes_name": "non_idempotent",
31
+ "retry_params_name": "default"
32
+ },
33
+ "CreateInstance": {
34
+ "timeout_millis": 60000,
35
+ "retry_codes_name": "non_idempotent",
36
+ "retry_params_name": "default"
37
+ },
38
+ "UpdateInstance": {
39
+ "timeout_millis": 60000,
40
+ "retry_codes_name": "non_idempotent",
41
+ "retry_params_name": "default"
42
+ },
43
+ "DeleteInstance": {
44
+ "timeout_millis": 60000,
45
+ "retry_codes_name": "non_idempotent",
46
+ "retry_params_name": "default"
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
@@ -0,0 +1,93 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/redis/v1beta1/cloud_redis.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/annotations_pb'
7
+ require 'google/longrunning/operations_pb'
8
+ require 'google/protobuf/field_mask_pb'
9
+ require 'google/protobuf/timestamp_pb'
10
+ Google::Protobuf::DescriptorPool.generated_pool.build do
11
+ add_message "google.cloud.redis.v1beta1.Instance" do
12
+ optional :name, :string, 1
13
+ optional :display_name, :string, 2
14
+ map :labels, :string, :string, 3
15
+ optional :location_id, :string, 4
16
+ optional :alternative_location_id, :string, 5
17
+ optional :redis_version, :string, 7
18
+ optional :reserved_ip_range, :string, 9
19
+ optional :host, :string, 10
20
+ optional :port, :int32, 11
21
+ optional :current_location_id, :string, 12
22
+ optional :create_time, :message, 13, "google.protobuf.Timestamp"
23
+ optional :state, :enum, 14, "google.cloud.redis.v1beta1.Instance.State"
24
+ optional :status_message, :string, 15
25
+ map :redis_configs, :string, :string, 16
26
+ optional :tier, :enum, 17, "google.cloud.redis.v1beta1.Instance.Tier"
27
+ optional :memory_size_gb, :int32, 18
28
+ optional :authorized_network, :string, 20
29
+ end
30
+ add_enum "google.cloud.redis.v1beta1.Instance.State" do
31
+ value :STATE_UNSPECIFIED, 0
32
+ value :CREATING, 1
33
+ value :READY, 2
34
+ value :UPDATING, 3
35
+ value :DELETING, 4
36
+ value :REPAIRING, 5
37
+ value :MAINTENANCE, 6
38
+ end
39
+ add_enum "google.cloud.redis.v1beta1.Instance.Tier" do
40
+ value :TIER_UNSPECIFIED, 0
41
+ value :BASIC, 1
42
+ value :STANDARD_HA, 3
43
+ end
44
+ add_message "google.cloud.redis.v1beta1.ListInstancesRequest" do
45
+ optional :parent, :string, 1
46
+ optional :page_size, :int32, 2
47
+ optional :page_token, :string, 3
48
+ end
49
+ add_message "google.cloud.redis.v1beta1.ListInstancesResponse" do
50
+ repeated :instances, :message, 1, "google.cloud.redis.v1beta1.Instance"
51
+ optional :next_page_token, :string, 2
52
+ end
53
+ add_message "google.cloud.redis.v1beta1.GetInstanceRequest" do
54
+ optional :name, :string, 1
55
+ end
56
+ add_message "google.cloud.redis.v1beta1.CreateInstanceRequest" do
57
+ optional :parent, :string, 1
58
+ optional :instance_id, :string, 2
59
+ optional :instance, :message, 3, "google.cloud.redis.v1beta1.Instance"
60
+ end
61
+ add_message "google.cloud.redis.v1beta1.UpdateInstanceRequest" do
62
+ optional :update_mask, :message, 1, "google.protobuf.FieldMask"
63
+ optional :instance, :message, 2, "google.cloud.redis.v1beta1.Instance"
64
+ end
65
+ add_message "google.cloud.redis.v1beta1.DeleteInstanceRequest" do
66
+ optional :name, :string, 1
67
+ end
68
+ add_message "google.cloud.redis.v1beta1.LocationMetadata" do
69
+ map :available_zones, :string, :message, 1, "google.cloud.redis.v1beta1.ZoneMetadata"
70
+ end
71
+ add_message "google.cloud.redis.v1beta1.ZoneMetadata" do
72
+ end
73
+ end
74
+
75
+ module Google
76
+ module Cloud
77
+ module Redis
78
+ module V1beta1
79
+ Instance = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.Instance").msgclass
80
+ Instance::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.Instance.State").enummodule
81
+ Instance::Tier = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.Instance.Tier").enummodule
82
+ ListInstancesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.ListInstancesRequest").msgclass
83
+ ListInstancesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.ListInstancesResponse").msgclass
84
+ GetInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.GetInstanceRequest").msgclass
85
+ CreateInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.CreateInstanceRequest").msgclass
86
+ UpdateInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.UpdateInstanceRequest").msgclass
87
+ DeleteInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.DeleteInstanceRequest").msgclass
88
+ LocationMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.LocationMetadata").msgclass
89
+ ZoneMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.ZoneMetadata").msgclass
90
+ end
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,90 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/redis/v1beta1/cloud_redis.proto for package 'google.cloud.redis.v1beta1'
3
+ # Original file comments:
4
+ # Copyright 2018 Google Inc.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'grpc'
20
+ require 'google/cloud/redis/v1beta1/cloud_redis_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module Redis
25
+ module V1beta1
26
+ module CloudRedis
27
+ # Configures and manages Cloud Memorystore for Redis instances
28
+ #
29
+ # Google Cloud Memorystore for Redis v1beta1
30
+ #
31
+ # The `redis.googleapis.com` service implements the Google Cloud Memorystore
32
+ # for Redis API and defines the following resource model for managing Redis
33
+ # instances:
34
+ # * The service works with a collection of cloud projects, named: `/projects/*`
35
+ # * Each project has a collection of available locations, named: `/locations/*`
36
+ # * Each location has a collection of Redis instances, named: `/instances/*`
37
+ # * As such, Redis instances are resources of the form:
38
+ # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
39
+ #
40
+ # Note that location_id must be refering to a GCP `region`; for example:
41
+ # * `projects/redpepper-1290/locations/us-central1/instances/my-redis`
42
+ class Service
43
+
44
+ include GRPC::GenericService
45
+
46
+ self.marshal_class_method = :encode
47
+ self.unmarshal_class_method = :decode
48
+ self.service_name = 'google.cloud.redis.v1beta1.CloudRedis'
49
+
50
+ # Lists all Redis instances owned by a project in either the specified
51
+ # location (region) or all locations.
52
+ #
53
+ # The location should have the following format:
54
+ # * `projects/{project_id}/locations/{location_id}`
55
+ #
56
+ # If `location_id` is specified as `-` (wildcard), then all regions
57
+ # available to the project are queried, and the results are aggregated.
58
+ rpc :ListInstances, ListInstancesRequest, ListInstancesResponse
59
+ # Gets the details of a specific Redis instance.
60
+ rpc :GetInstance, GetInstanceRequest, Instance
61
+ # Creates a Redis instance based on the specified tier and memory size.
62
+ #
63
+ # By default, the instance is peered to the project's
64
+ # [default network](/compute/docs/networks-and-firewalls#networks).
65
+ #
66
+ # The creation is executed asynchronously and callers may check the returned
67
+ # operation to track its progress. Once the operation is completed the Redis
68
+ # instance will be fully functional. Completed longrunning.Operation will
69
+ # contain the new instance object in the response field.
70
+ #
71
+ # The returned operation is automatically deleted after a few hours, so there
72
+ # is no need to call DeleteOperation.
73
+ rpc :CreateInstance, CreateInstanceRequest, Google::Longrunning::Operation
74
+ # Updates the metadata and configuration of a specific Redis instance.
75
+ #
76
+ # Completed longrunning.Operation will contain the new instance object
77
+ # in the response field. The returned operation is automatically deleted
78
+ # after a few hours, so there is no need to call DeleteOperation.
79
+ rpc :UpdateInstance, UpdateInstanceRequest, Google::Longrunning::Operation
80
+ # Deletes a specific Redis instance. Instance stops serving and data is
81
+ # deleted.
82
+ rpc :DeleteInstance, DeleteInstanceRequest, Google::Longrunning::Operation
83
+ end
84
+
85
+ Stub = Service.rpc_stub_class
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,265 @@
1
+ # Copyright 2018 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
+ module Google
16
+ module Cloud
17
+ module Redis
18
+ ##
19
+ # # Google Cloud Memorystore for Redis API Contents
20
+ #
21
+ # | Class | Description |
22
+ # | ----- | ----------- |
23
+ # | [CloudRedisClient][] | Configures and manages Cloud Memorystore for Redis instances |
24
+ # | [Data Types][] | Data types for Google::Cloud::Redis::V1beta1 |
25
+ #
26
+ # [CloudRedisClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-redis/latest/google/cloud/redis/v1beta1/cloudredisclient
27
+ # [Data Types]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-redis/latest/google/cloud/redis/v1beta1/datatypes
28
+ #
29
+ module V1beta1
30
+ # A Google Cloud Redis instance.
31
+ # @!attribute [rw] name
32
+ # @return [String]
33
+ # Required. Unique name of the resource in this scope including project and
34
+ # location using the form:
35
+ # +projects/{project_id}/locations/{location_id}/instances/{instance_id}+
36
+ #
37
+ # Note: Redis instances are managed and addressed at regional level so
38
+ # location_id here refers to a GCP region; however, users get to choose which
39
+ # specific zone (or collection of zones for cross-zone instances) an instance
40
+ # should be provisioned in. Refer to [location_id] and
41
+ # [alternative_location_id] fields for more details.
42
+ # @!attribute [rw] display_name
43
+ # @return [String]
44
+ # An arbitrary and optional user-provided name for the instance.
45
+ # @!attribute [rw] labels
46
+ # @return [Hash{String => String}]
47
+ # Resource labels to represent user provided metadata
48
+ # @!attribute [rw] location_id
49
+ # @return [String]
50
+ # Optional. The zone where the instance will be provisioned. If not provided,
51
+ # the service will choose a zone for the instance. For STANDARD_HA tier,
52
+ # instances will be created across two zones for protection against zonal
53
+ # failures. if [alternative_location_id] is also provided, it must be
54
+ # different from [location_id].
55
+ # @!attribute [rw] alternative_location_id
56
+ # @return [String]
57
+ # Optional. Only applicable to STANDARD_HA tier which protects the instance
58
+ # against zonal failures by provisioning it across two zones. If provided, it
59
+ # must be a different zone from the one provided in [location_id].
60
+ # @!attribute [rw] redis_version
61
+ # @return [String]
62
+ # Optional. The version of Redis software.
63
+ # If not provided, latest supported version will be used.
64
+ # @!attribute [rw] reserved_ip_range
65
+ # @return [String]
66
+ # Optional. The CIDR range of internal addresses that are reserved for this
67
+ # instance. If not provided, the service will choose an unused /29 block,
68
+ # for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique
69
+ # and non-overlapping with existing subnets in a network.
70
+ # @!attribute [rw] host
71
+ # @return [String]
72
+ # Output only. Hostname or IP address of the exposed redis endpoint used by
73
+ # clients to connect to the service.
74
+ # @!attribute [rw] port
75
+ # @return [Integer]
76
+ # Output only. The port number of the exposed redis endpoint.
77
+ # @!attribute [rw] current_location_id
78
+ # @return [String]
79
+ # Output only. The current zone where the Redis endpoint is placed. In
80
+ # single zone deployments, this will always be the same as [location_id]
81
+ # provided by the user at creation time. In cross-zone instances (only
82
+ # applicable in STANDARD_HA tier), this can be either [location_id] or
83
+ # [alternative_location_id] and can change on a failover event.
84
+ # @!attribute [rw] create_time
85
+ # @return [Google::Protobuf::Timestamp]
86
+ # Output only. The time the instance was created.
87
+ # @!attribute [rw] state
88
+ # @return [Google::Cloud::Redis::V1beta1::Instance::State]
89
+ # Output only. The current state of this instance.
90
+ # @!attribute [rw] status_message
91
+ # @return [String]
92
+ # Output only. Additional information about the current status of this
93
+ # instance, if available.
94
+ # @!attribute [rw] redis_configs
95
+ # @return [Hash{String => String}]
96
+ # Optional. Redis configuration parameters, according to
97
+ # http://redis.io/topics/config. Currently, the only supported parameters
98
+ # are:
99
+ # * maxmemory-policy
100
+ # * notify-keyspace-events
101
+ # @!attribute [rw] tier
102
+ # @return [Google::Cloud::Redis::V1beta1::Instance::Tier]
103
+ # Required. The service tier of the instance.
104
+ # @!attribute [rw] memory_size_gb
105
+ # @return [Integer]
106
+ # Required. Redis memory size in GB.
107
+ # @!attribute [rw] authorized_network
108
+ # @return [String]
109
+ # Optional. The full name of the Google Compute Engine
110
+ # [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to which the
111
+ # instance is connected. If left unspecified, the +default+ network
112
+ # will be used.
113
+ class Instance
114
+ # Represents the different states of a Redis instance.
115
+ module State
116
+ # Not set.
117
+ STATE_UNSPECIFIED = 0
118
+
119
+ # Redis instance is being created.
120
+ CREATING = 1
121
+
122
+ # Redis instance has been created and is fully usable.
123
+ READY = 2
124
+
125
+ # Redis instance configuration is being updated. Certain kinds of updates
126
+ # may cause the instance to become unusable while the update is in
127
+ # progress.
128
+ UPDATING = 3
129
+
130
+ # Redis instance is being deleted.
131
+ DELETING = 4
132
+
133
+ # Redis instance is being repaired and may be unusable. Details can be
134
+ # found in the +status_message+ field.
135
+ REPAIRING = 5
136
+
137
+ # Maintenance is being performed on this Redis instance.
138
+ MAINTENANCE = 6
139
+ end
140
+
141
+ # Available service tiers to choose from
142
+ module Tier
143
+ # Not set.
144
+ TIER_UNSPECIFIED = 0
145
+
146
+ # BASIC tier: standalone instance
147
+ BASIC = 1
148
+
149
+ # STANDARD_HA tier: highly available primary/replica instances
150
+ STANDARD_HA = 3
151
+ end
152
+ end
153
+
154
+ # Request for {Google::Cloud::Redis::V1beta1::CloudRedis::ListInstances ListInstances}.
155
+ # @!attribute [rw] parent
156
+ # @return [String]
157
+ # Required. The resource name of the instance location using the form:
158
+ # +projects/{project_id}/locations/{location_id}+
159
+ # where +location_id+ refers to a GCP region
160
+ # @!attribute [rw] page_size
161
+ # @return [Integer]
162
+ # The maximum number of items to return.
163
+ #
164
+ # If not specified, a default value of 1000 will be used by the service.
165
+ # Regardless of the page_size value, the response may include a partial list
166
+ # and a caller should only rely on response's
167
+ # {CloudRedis::ListInstancesResponse#next_page_token next_page_token}
168
+ # to determine if there are more instances left to be queried.
169
+ # @!attribute [rw] page_token
170
+ # @return [String]
171
+ # The next_page_token value returned from a previous List request,
172
+ # if any.
173
+ class ListInstancesRequest; end
174
+
175
+ # Response for {Google::Cloud::Redis::V1beta1::CloudRedis::ListInstances ListInstances}.
176
+ # @!attribute [rw] instances
177
+ # @return [Array<Google::Cloud::Redis::V1beta1::Instance>]
178
+ # A list of Redis instances in the project in the specified location,
179
+ # or across all locations.
180
+ #
181
+ # If the +location_id+ in the parent field of the request is "-", all regions
182
+ # available to the project are queried, and the results aggregated.
183
+ # If in such an aggregated query a location is unavailable, a dummy Redis
184
+ # entry is included in the response with the "name" field set to a value of
185
+ # the form projects/{project_id}/locations/{location_id}/instances/- and the
186
+ # "status" field set to ERROR and "status_message" field set to "location not
187
+ # available for ListInstances".
188
+ # @!attribute [rw] next_page_token
189
+ # @return [String]
190
+ # Token to retrieve the next page of results, or empty if there are no more
191
+ # results in the list.
192
+ class ListInstancesResponse; end
193
+
194
+ # Request for {Google::Cloud::Redis::V1beta1::CloudRedis::GetInstance GetInstance}.
195
+ # @!attribute [rw] name
196
+ # @return [String]
197
+ # Required. Redis instance resource name using the form:
198
+ # +projects/{project_id}/locations/{location_id}/instances/{instance_id}+
199
+ # where +location_id+ refers to a GCP region
200
+ class GetInstanceRequest; end
201
+
202
+ # Request for {Google::Cloud::Redis::V1beta1::CloudRedis::CreateInstance CreateInstance}.
203
+ # @!attribute [rw] parent
204
+ # @return [String]
205
+ # Required. The resource name of the instance location using the form:
206
+ # +projects/{project_id}/locations/{location_id}+
207
+ # where +location_id+ refers to a GCP region
208
+ # @!attribute [rw] instance_id
209
+ # @return [String]
210
+ # Required. The logical name of the Redis instance in the customer project
211
+ # with the following restrictions:
212
+ #
213
+ # * Must contain only lowercase letters, numbers, and hyphens.
214
+ # * Must start with a letter.
215
+ # * Must be between 1-40 characters.
216
+ # * Must end with a number or a letter.
217
+ # * Must be unique within the customer project / location
218
+ # @!attribute [rw] instance
219
+ # @return [Google::Cloud::Redis::V1beta1::Instance]
220
+ # Required. A Redis [Instance] resource
221
+ class CreateInstanceRequest; end
222
+
223
+ # Request for {Google::Cloud::Redis::V1beta1::CloudRedis::UpdateInstance UpdateInstance}.
224
+ # @!attribute [rw] update_mask
225
+ # @return [Google::Protobuf::FieldMask]
226
+ # Required. Mask of fields to update. At least one path must be supplied in
227
+ # this field. The elements of the repeated paths field may only include these
228
+ # fields from {CloudRedis::Instance Instance}:
229
+ # * +display_name+
230
+ # * +labels+
231
+ # * +memory_size_gb+
232
+ # * +redis_config+
233
+ # @!attribute [rw] instance
234
+ # @return [Google::Cloud::Redis::V1beta1::Instance]
235
+ # Required. Update description.
236
+ # Only fields specified in update_mask are updated.
237
+ class UpdateInstanceRequest; end
238
+
239
+ # Request for {Google::Cloud::Redis::V1beta1::CloudRedis::DeleteInstance DeleteInstance}.
240
+ # @!attribute [rw] name
241
+ # @return [String]
242
+ # Required. Redis instance resource name using the form:
243
+ # +projects/{project_id}/locations/{location_id}/instances/{instance_id}+
244
+ # where +location_id+ refers to a GCP region
245
+ class DeleteInstanceRequest; end
246
+
247
+ # This location metadata represents additional configuration options for a
248
+ # given location where a Redis instance may be created. All fields are output
249
+ # only. It is returned as content of the
250
+ # +google.cloud.location.Location.metadata+ field.
251
+ # @!attribute [rw] available_zones
252
+ # @return [Hash{String => Google::Cloud::Redis::V1beta1::ZoneMetadata}]
253
+ # Output only. The set of available zones in the location. The map is keyed
254
+ # by the lowercase ID of each zone, as defined by GCE. These keys can be
255
+ # specified in +location_id+ or +alternative_location_id+ fields when
256
+ # creating a Redis instance.
257
+ class LocationMetadata; end
258
+
259
+ # Defines specific information for a particular zone. Currently empty and
260
+ # reserved for future use only.
261
+ class ZoneMetadata; end
262
+ end
263
+ end
264
+ end
265
+ end