google-cloud-redis-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,490 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Redis
23
+ module V1
24
+ # A Google Cloud Redis instance.
25
+ # @!attribute [rw] name
26
+ # @return [String]
27
+ # Required. Unique name of the resource in this scope including project and
28
+ # location using the form:
29
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
30
+ #
31
+ # Note: Redis instances are managed and addressed at regional level so
32
+ # location_id here refers to a GCP region; however, users may choose which
33
+ # specific zone (or collection of zones for cross-zone instances) an instance
34
+ # should be provisioned in. Refer to {Google::Cloud::Redis::V1::Instance#location_id location_id} and
35
+ # {Google::Cloud::Redis::V1::Instance#alternative_location_id alternative_location_id} fields for more details.
36
+ # @!attribute [rw] display_name
37
+ # @return [String]
38
+ # An arbitrary and optional user-provided name for the instance.
39
+ # @!attribute [rw] labels
40
+ # @return [Google::Protobuf::Map{String => String}]
41
+ # Resource labels to represent user provided metadata
42
+ # @!attribute [rw] location_id
43
+ # @return [String]
44
+ # Optional. The zone where the instance will be provisioned. If not provided,
45
+ # the service will choose a zone for the instance. For STANDARD_HA tier,
46
+ # instances will be created across two zones for protection against zonal
47
+ # failures. If {Google::Cloud::Redis::V1::Instance#alternative_location_id alternative_location_id} is also provided, it must be
48
+ # different from {Google::Cloud::Redis::V1::Instance#location_id location_id}.
49
+ # @!attribute [rw] alternative_location_id
50
+ # @return [String]
51
+ # Optional. Only applicable to STANDARD_HA tier which protects the instance
52
+ # against zonal failures by provisioning it across two zones. If provided, it
53
+ # must be a different zone from the one provided in {Google::Cloud::Redis::V1::Instance#location_id location_id}.
54
+ # @!attribute [rw] redis_version
55
+ # @return [String]
56
+ # Optional. The version of Redis software.
57
+ # If not provided, latest supported version will be used. Currently, the
58
+ # supported values are:
59
+ #
60
+ # * `REDIS_3_2` for Redis 3.2 compatibility
61
+ # * `REDIS_4_0` for Redis 4.0 compatibility (default)
62
+ # * `REDIS_5_0` for Redis 5.0 compatibility
63
+ # @!attribute [rw] reserved_ip_range
64
+ # @return [String]
65
+ # Optional. The CIDR range of internal addresses that are reserved for this
66
+ # instance. If not provided, the service will choose an unused /29 block,
67
+ # for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique
68
+ # and non-overlapping with existing subnets in an authorized network.
69
+ # @!attribute [r] host
70
+ # @return [String]
71
+ # Output only. Hostname or IP address of the exposed Redis endpoint used by
72
+ # clients to connect to the service.
73
+ # @!attribute [r] port
74
+ # @return [Integer]
75
+ # Output only. The port number of the exposed Redis endpoint.
76
+ # @!attribute [r] current_location_id
77
+ # @return [String]
78
+ # Output only. The current zone where the Redis endpoint is placed. For Basic
79
+ # Tier instances, this will always be the same as the {Google::Cloud::Redis::V1::Instance#location_id location_id}
80
+ # provided by the user at creation time. For Standard Tier instances,
81
+ # this can be either {Google::Cloud::Redis::V1::Instance#location_id location_id} or {Google::Cloud::Redis::V1::Instance#alternative_location_id alternative_location_id} and can
82
+ # change after a failover event.
83
+ # @!attribute [r] create_time
84
+ # @return [Google::Protobuf::Timestamp]
85
+ # Output only. The time the instance was created.
86
+ # @!attribute [r] state
87
+ # @return [Google::Cloud::Redis::V1::Instance::State]
88
+ # Output only. The current state of this instance.
89
+ # @!attribute [r] status_message
90
+ # @return [String]
91
+ # Output only. Additional information about the current status of this
92
+ # instance, if available.
93
+ # @!attribute [rw] redis_configs
94
+ # @return [Google::Protobuf::Map{String => String}]
95
+ # Optional. Redis configuration parameters, according to
96
+ # http://redis.io/topics/config. Currently, the only supported parameters
97
+ # are:
98
+ #
99
+ # Redis version 3.2 and newer:
100
+ #
101
+ # * maxmemory-policy
102
+ # * notify-keyspace-events
103
+ #
104
+ # Redis version 4.0 and newer:
105
+ #
106
+ # * activedefrag
107
+ # * lfu-decay-time
108
+ # * lfu-log-factor
109
+ # * maxmemory-gb
110
+ #
111
+ # Redis version 5.0 and newer:
112
+ #
113
+ # * stream-node-max-bytes
114
+ # * stream-node-max-entries
115
+ # @!attribute [rw] tier
116
+ # @return [Google::Cloud::Redis::V1::Instance::Tier]
117
+ # Required. The service tier of the instance.
118
+ # @!attribute [rw] memory_size_gb
119
+ # @return [Integer]
120
+ # Required. Redis memory size in GiB.
121
+ # @!attribute [rw] authorized_network
122
+ # @return [String]
123
+ # Optional. The full name of the Google Compute Engine
124
+ # [network](/compute/docs/networks-and-firewalls#networks) to which the
125
+ # instance is connected. If left unspecified, the `default` network
126
+ # will be used.
127
+ # @!attribute [r] persistence_iam_identity
128
+ # @return [String]
129
+ # Output only. Cloud IAM identity used by import / export operations to
130
+ # transfer data to/from Cloud Storage. Format is
131
+ # "serviceAccount:<service_account_email>". The value may change over time
132
+ # for a given instance so should be checked before each import/export
133
+ # operation.
134
+ # @!attribute [rw] connect_mode
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.
139
+ class Instance
140
+ include Google::Protobuf::MessageExts
141
+ extend Google::Protobuf::MessageExts::ClassMethods
142
+
143
+ # @!attribute [rw] key
144
+ # @return [String]
145
+ # @!attribute [rw] value
146
+ # @return [String]
147
+ class LabelsEntry
148
+ include Google::Protobuf::MessageExts
149
+ extend Google::Protobuf::MessageExts::ClassMethods
150
+ end
151
+
152
+ # @!attribute [rw] key
153
+ # @return [String]
154
+ # @!attribute [rw] value
155
+ # @return [String]
156
+ class RedisConfigsEntry
157
+ include Google::Protobuf::MessageExts
158
+ extend Google::Protobuf::MessageExts::ClassMethods
159
+ end
160
+
161
+ # Represents the different states of a Redis instance.
162
+ module State
163
+ # Not set.
164
+ STATE_UNSPECIFIED = 0
165
+
166
+ # Redis instance is being created.
167
+ CREATING = 1
168
+
169
+ # Redis instance has been created and is fully usable.
170
+ READY = 2
171
+
172
+ # Redis instance configuration is being updated. Certain kinds of updates
173
+ # may cause the instance to become unusable while the update is in
174
+ # progress.
175
+ UPDATING = 3
176
+
177
+ # Redis instance is being deleted.
178
+ DELETING = 4
179
+
180
+ # Redis instance is being repaired and may be unusable.
181
+ REPAIRING = 5
182
+
183
+ # Maintenance is being performed on this Redis instance.
184
+ MAINTENANCE = 6
185
+
186
+ # Redis instance is importing data (availability may be affected).
187
+ IMPORTING = 8
188
+
189
+ # Redis instance is failing over (availability may be affected).
190
+ FAILING_OVER = 9
191
+ end
192
+
193
+ # Available service tiers to choose from
194
+ module Tier
195
+ # Not set.
196
+ TIER_UNSPECIFIED = 0
197
+
198
+ # BASIC tier: standalone instance
199
+ BASIC = 1
200
+
201
+ # STANDARD_HA tier: highly available primary/replica instances
202
+ STANDARD_HA = 3
203
+ end
204
+
205
+ # Available connection modes.
206
+ module ConnectMode
207
+ # Not set.
208
+ CONNECT_MODE_UNSPECIFIED = 0
209
+
210
+ # Connect via directly peering with memorystore redis hosted service.
211
+ DIRECT_PEERING = 1
212
+
213
+ # Connect with google via private service access and share connection
214
+ # across google managed services.
215
+ PRIVATE_SERVICE_ACCESS = 2
216
+ end
217
+ end
218
+
219
+ # Request for {Google::Cloud::Redis::V1::CloudRedis::Client#list_instances ListInstances}.
220
+ # @!attribute [rw] parent
221
+ # @return [String]
222
+ # Required. The resource name of the instance location using the form:
223
+ # `projects/{project_id}/locations/{location_id}`
224
+ # where `location_id` refers to a GCP region.
225
+ # @!attribute [rw] page_size
226
+ # @return [Integer]
227
+ # The maximum number of items to return.
228
+ #
229
+ # If not specified, a default value of 1000 will be used by the service.
230
+ # Regardless of the page_size value, the response may include a partial list
231
+ # and a caller should only rely on response's
232
+ # {Google::Cloud::Redis::V1::ListInstancesResponse#next_page_token `next_page_token`}
233
+ # to determine if there are more instances left to be queried.
234
+ # @!attribute [rw] page_token
235
+ # @return [String]
236
+ # The `next_page_token` value returned from a previous
237
+ # {Google::Cloud::Redis::V1::CloudRedis::Client#list_instances ListInstances} request, if any.
238
+ class ListInstancesRequest
239
+ include Google::Protobuf::MessageExts
240
+ extend Google::Protobuf::MessageExts::ClassMethods
241
+ end
242
+
243
+ # Response for {Google::Cloud::Redis::V1::CloudRedis::Client#list_instances ListInstances}.
244
+ # @!attribute [rw] instances
245
+ # @return [Array<Google::Cloud::Redis::V1::Instance>]
246
+ # A list of Redis instances in the project in the specified location,
247
+ # or across all locations.
248
+ #
249
+ # If the `location_id` in the parent field of the request is "-", all regions
250
+ # available to the project are queried, and the results aggregated.
251
+ # If in such an aggregated query a location is unavailable, a dummy Redis
252
+ # entry is included in the response with the `name` field set to a value of
253
+ # the form `projects/{project_id}/locations/{location_id}/instances/`- and
254
+ # the `status` field set to ERROR and `status_message` field set to "location
255
+ # not available for ListInstances".
256
+ # @!attribute [rw] next_page_token
257
+ # @return [String]
258
+ # Token to retrieve the next page of results, or empty if there are no more
259
+ # results in the list.
260
+ # @!attribute [rw] unreachable
261
+ # @return [Array<String>]
262
+ # Locations that could not be reached.
263
+ class ListInstancesResponse
264
+ include Google::Protobuf::MessageExts
265
+ extend Google::Protobuf::MessageExts::ClassMethods
266
+ end
267
+
268
+ # Request for {Google::Cloud::Redis::V1::CloudRedis::Client#get_instance GetInstance}.
269
+ # @!attribute [rw] name
270
+ # @return [String]
271
+ # Required. Redis instance resource name using the form:
272
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
273
+ # where `location_id` refers to a GCP region.
274
+ class GetInstanceRequest
275
+ include Google::Protobuf::MessageExts
276
+ extend Google::Protobuf::MessageExts::ClassMethods
277
+ end
278
+
279
+ # Request for {Google::Cloud::Redis::V1::CloudRedis::Client#create_instance CreateInstance}.
280
+ # @!attribute [rw] parent
281
+ # @return [String]
282
+ # Required. The resource name of the instance location using the form:
283
+ # `projects/{project_id}/locations/{location_id}`
284
+ # where `location_id` refers to a GCP region.
285
+ # @!attribute [rw] instance_id
286
+ # @return [String]
287
+ # Required. The logical name of the Redis instance in the customer project
288
+ # with the following restrictions:
289
+ #
290
+ # * Must contain only lowercase letters, numbers, and hyphens.
291
+ # * Must start with a letter.
292
+ # * Must be between 1-40 characters.
293
+ # * Must end with a number or a letter.
294
+ # * Must be unique within the customer project / location
295
+ # @!attribute [rw] instance
296
+ # @return [Google::Cloud::Redis::V1::Instance]
297
+ # Required. A Redis [Instance] resource
298
+ class CreateInstanceRequest
299
+ include Google::Protobuf::MessageExts
300
+ extend Google::Protobuf::MessageExts::ClassMethods
301
+ end
302
+
303
+ # Request for {Google::Cloud::Redis::V1::CloudRedis::Client#update_instance UpdateInstance}.
304
+ # @!attribute [rw] update_mask
305
+ # @return [Google::Protobuf::FieldMask]
306
+ # Required. Mask of fields to update. At least one path must be supplied in
307
+ # this field. The elements of the repeated paths field may only include these
308
+ # fields from {Google::Cloud::Redis::V1::Instance Instance}:
309
+ #
310
+ # * `displayName`
311
+ # * `labels`
312
+ # * `memorySizeGb`
313
+ # * `redisConfig`
314
+ # @!attribute [rw] instance
315
+ # @return [Google::Cloud::Redis::V1::Instance]
316
+ # Required. Update description.
317
+ # Only fields specified in update_mask are updated.
318
+ class UpdateInstanceRequest
319
+ include Google::Protobuf::MessageExts
320
+ extend Google::Protobuf::MessageExts::ClassMethods
321
+ end
322
+
323
+ # Request for {Google::Cloud::Redis::V1::CloudRedis::Client#delete_instance DeleteInstance}.
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
+ class DeleteInstanceRequest
330
+ include Google::Protobuf::MessageExts
331
+ extend Google::Protobuf::MessageExts::ClassMethods
332
+ end
333
+
334
+ # The Cloud Storage location for the input content
335
+ # @!attribute [rw] uri
336
+ # @return [String]
337
+ # Required. Source data URI. (e.g. 'gs://my_bucket/my_object').
338
+ class GcsSource
339
+ include Google::Protobuf::MessageExts
340
+ extend Google::Protobuf::MessageExts::ClassMethods
341
+ end
342
+
343
+ # The input content
344
+ # @!attribute [rw] gcs_source
345
+ # @return [Google::Cloud::Redis::V1::GcsSource]
346
+ # Google Cloud Storage location where input content is located.
347
+ class InputConfig
348
+ include Google::Protobuf::MessageExts
349
+ extend Google::Protobuf::MessageExts::ClassMethods
350
+ end
351
+
352
+ # Request for {Google::Cloud::Redis::V1::CloudRedis::Client#import_instance Import}.
353
+ # @!attribute [rw] name
354
+ # @return [String]
355
+ # Required. Redis instance resource name using the form:
356
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
357
+ # where `location_id` refers to a GCP region.
358
+ # @!attribute [rw] input_config
359
+ # @return [Google::Cloud::Redis::V1::InputConfig]
360
+ # Required. Specify data to be imported.
361
+ class ImportInstanceRequest
362
+ include Google::Protobuf::MessageExts
363
+ extend Google::Protobuf::MessageExts::ClassMethods
364
+ end
365
+
366
+ # The Cloud Storage location for the output content
367
+ # @!attribute [rw] uri
368
+ # @return [String]
369
+ # Required. Data destination URI (e.g.
370
+ # 'gs://my_bucket/my_object'). Existing files will be overwritten.
371
+ class GcsDestination
372
+ include Google::Protobuf::MessageExts
373
+ extend Google::Protobuf::MessageExts::ClassMethods
374
+ end
375
+
376
+ # The output content
377
+ # @!attribute [rw] gcs_destination
378
+ # @return [Google::Cloud::Redis::V1::GcsDestination]
379
+ # Google Cloud Storage destination for output content.
380
+ class OutputConfig
381
+ include Google::Protobuf::MessageExts
382
+ extend Google::Protobuf::MessageExts::ClassMethods
383
+ end
384
+
385
+ # Request for {Google::Cloud::Redis::V1::CloudRedis::Client#export_instance Export}.
386
+ # @!attribute [rw] name
387
+ # @return [String]
388
+ # Required. Redis instance resource name using the form:
389
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
390
+ # where `location_id` refers to a GCP region.
391
+ # @!attribute [rw] output_config
392
+ # @return [Google::Cloud::Redis::V1::OutputConfig]
393
+ # Required. Specify data to be exported.
394
+ class ExportInstanceRequest
395
+ include Google::Protobuf::MessageExts
396
+ extend Google::Protobuf::MessageExts::ClassMethods
397
+ end
398
+
399
+ # Request for {Google::Cloud::Redis::V1::CloudRedis::Client#failover_instance Failover}.
400
+ # @!attribute [rw] name
401
+ # @return [String]
402
+ # Required. Redis instance resource name using the form:
403
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
404
+ # where `location_id` refers to a GCP region.
405
+ # @!attribute [rw] data_protection_mode
406
+ # @return [Google::Cloud::Redis::V1::FailoverInstanceRequest::DataProtectionMode]
407
+ # Optional. Available data protection modes that the user can choose. If it's
408
+ # unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
409
+ class FailoverInstanceRequest
410
+ include Google::Protobuf::MessageExts
411
+ extend Google::Protobuf::MessageExts::ClassMethods
412
+
413
+ # Specifies different modes of operation in relation to the data retention.
414
+ module DataProtectionMode
415
+ # Defaults to LIMITED_DATA_LOSS if a data protection mode is not
416
+ # specified.
417
+ DATA_PROTECTION_MODE_UNSPECIFIED = 0
418
+
419
+ # Instance failover will be protected with data loss control. More
420
+ # specifically, the failover will only be performed if the current
421
+ # replication offset diff between master and replica is under a certain
422
+ # threshold.
423
+ LIMITED_DATA_LOSS = 1
424
+
425
+ # Instance failover will be performed without data loss control.
426
+ FORCE_DATA_LOSS = 2
427
+ end
428
+ end
429
+
430
+ # Represents the v1 metadata of the long-running operation.
431
+ # @!attribute [rw] create_time
432
+ # @return [Google::Protobuf::Timestamp]
433
+ # Creation timestamp.
434
+ # @!attribute [rw] end_time
435
+ # @return [Google::Protobuf::Timestamp]
436
+ # End timestamp.
437
+ # @!attribute [rw] target
438
+ # @return [String]
439
+ # Operation target.
440
+ # @!attribute [rw] verb
441
+ # @return [String]
442
+ # Operation verb.
443
+ # @!attribute [rw] status_detail
444
+ # @return [String]
445
+ # Operation status details.
446
+ # @!attribute [rw] cancel_requested
447
+ # @return [Boolean]
448
+ # Specifies if cancellation was requested for the operation.
449
+ # @!attribute [rw] api_version
450
+ # @return [String]
451
+ # API version.
452
+ class OperationMetadata
453
+ include Google::Protobuf::MessageExts
454
+ extend Google::Protobuf::MessageExts::ClassMethods
455
+ end
456
+
457
+ # This location metadata represents additional configuration options for a
458
+ # given location where a Redis instance may be created. All fields are output
459
+ # only. It is returned as content of the
460
+ # `google.cloud.location.Location.metadata` field.
461
+ # @!attribute [r] available_zones
462
+ # @return [Google::Protobuf::Map{String => Google::Cloud::Redis::V1::ZoneMetadata}]
463
+ # Output only. The set of available zones in the location. The map is keyed
464
+ # by the lowercase ID of each zone, as defined by GCE. These keys can be
465
+ # specified in `location_id` or `alternative_location_id` fields when
466
+ # creating a Redis instance.
467
+ class LocationMetadata
468
+ include Google::Protobuf::MessageExts
469
+ extend Google::Protobuf::MessageExts::ClassMethods
470
+
471
+ # @!attribute [rw] key
472
+ # @return [String]
473
+ # @!attribute [rw] value
474
+ # @return [Google::Cloud::Redis::V1::ZoneMetadata]
475
+ class AvailableZonesEntry
476
+ include Google::Protobuf::MessageExts
477
+ extend Google::Protobuf::MessageExts::ClassMethods
478
+ end
479
+ end
480
+
481
+ # Defines specific information for a particular zone. Currently empty and
482
+ # reserved for future use only.
483
+ class ZoneMetadata
484
+ include Google::Protobuf::MessageExts
485
+ extend Google::Protobuf::MessageExts::ClassMethods
486
+ end
487
+ end
488
+ end
489
+ end
490
+ end