xref: /aosp_15_r20/external/googleapis/google/cloud/redis/v1/cloud_redis.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 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//     http://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
15syntax = "proto3";
16
17package google.cloud.redis.v1;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/longrunning/operations.proto";
24import "google/protobuf/duration.proto";
25import "google/protobuf/empty.proto";
26import "google/protobuf/field_mask.proto";
27import "google/protobuf/timestamp.proto";
28import "google/type/dayofweek.proto";
29import "google/type/timeofday.proto";
30
31option go_package = "cloud.google.com/go/redis/apiv1/redispb;redispb";
32option java_multiple_files = true;
33option java_outer_classname = "CloudRedisServiceV1Proto";
34option java_package = "com.google.cloud.redis.v1";
35
36// Configures and manages Cloud Memorystore for Redis instances
37//
38// Google Cloud Memorystore for Redis v1
39//
40// The `redis.googleapis.com` service implements the Google Cloud Memorystore
41// for Redis API and defines the following resource model for managing Redis
42// instances:
43// * The service works with a collection of cloud projects, named: `/projects/*`
44// * Each project has a collection of available locations, named: `/locations/*`
45// * Each location has a collection of Redis instances, named: `/instances/*`
46// * As such, Redis instances are resources of the form:
47//   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
48//
49// Note that location_id must be referring to a GCP `region`; for example:
50// * `projects/redpepper-1290/locations/us-central1/instances/my-redis`
51service CloudRedis {
52  option (google.api.default_host) = "redis.googleapis.com";
53  option (google.api.oauth_scopes) =
54      "https://www.googleapis.com/auth/cloud-platform";
55
56  // Lists all Redis instances owned by a project in either the specified
57  // location (region) or all locations.
58  //
59  // The location should have the following format:
60  //
61  // * `projects/{project_id}/locations/{location_id}`
62  //
63  // If `location_id` is specified as `-` (wildcard), then all regions
64  // available to the project are queried, and the results are aggregated.
65  rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) {
66    option (google.api.http) = {
67      get: "/v1/{parent=projects/*/locations/*}/instances"
68    };
69    option (google.api.method_signature) = "parent";
70  }
71
72  // Gets the details of a specific Redis instance.
73  rpc GetInstance(GetInstanceRequest) returns (Instance) {
74    option (google.api.http) = {
75      get: "/v1/{name=projects/*/locations/*/instances/*}"
76    };
77    option (google.api.method_signature) = "name";
78  }
79
80  // Gets the AUTH string for a Redis instance. If AUTH is not enabled for the
81  // instance the response will be empty. This information is not included in
82  // the details returned to GetInstance.
83  rpc GetInstanceAuthString(GetInstanceAuthStringRequest)
84      returns (InstanceAuthString) {
85    option (google.api.http) = {
86      get: "/v1/{name=projects/*/locations/*/instances/*}/authString"
87    };
88    option (google.api.method_signature) = "name";
89  }
90
91  // Creates a Redis instance based on the specified tier and memory size.
92  //
93  // By default, the instance is accessible from the project's
94  // [default network](https://cloud.google.com/vpc/docs/vpc).
95  //
96  // The creation is executed asynchronously and callers may check the returned
97  // operation to track its progress. Once the operation is completed the Redis
98  // instance will be fully functional. Completed longrunning.Operation will
99  // contain the new instance object in the response field.
100  //
101  // The returned operation is automatically deleted after a few hours, so there
102  // is no need to call DeleteOperation.
103  rpc CreateInstance(CreateInstanceRequest)
104      returns (google.longrunning.Operation) {
105    option (google.api.http) = {
106      post: "/v1/{parent=projects/*/locations/*}/instances"
107      body: "instance"
108    };
109    option (google.api.method_signature) = "parent,instance_id,instance";
110    option (google.longrunning.operation_info) = {
111      response_type: "google.cloud.redis.v1.Instance"
112      metadata_type: "google.cloud.redis.v1.OperationMetadata"
113    };
114  }
115
116  // Updates the metadata and configuration of a specific Redis instance.
117  //
118  // Completed longrunning.Operation will contain the new instance object
119  // in the response field. The returned operation is automatically deleted
120  // after a few hours, so there is no need to call DeleteOperation.
121  rpc UpdateInstance(UpdateInstanceRequest)
122      returns (google.longrunning.Operation) {
123    option (google.api.http) = {
124      patch: "/v1/{instance.name=projects/*/locations/*/instances/*}"
125      body: "instance"
126    };
127    option (google.api.method_signature) = "update_mask,instance";
128    option (google.longrunning.operation_info) = {
129      response_type: "google.cloud.redis.v1.Instance"
130      metadata_type: "google.cloud.redis.v1.OperationMetadata"
131    };
132  }
133
134  // Upgrades Redis instance to the newer Redis version specified in the
135  // request.
136  rpc UpgradeInstance(UpgradeInstanceRequest)
137      returns (google.longrunning.Operation) {
138    option (google.api.http) = {
139      post: "/v1/{name=projects/*/locations/*/instances/*}:upgrade"
140      body: "*"
141    };
142    option (google.api.method_signature) = "name,redis_version";
143    option (google.longrunning.operation_info) = {
144      response_type: "google.cloud.redis.v1.Instance"
145      metadata_type: "google.cloud.redis.v1.OperationMetadata"
146    };
147  }
148
149  // Import a Redis RDB snapshot file from Cloud Storage into a Redis instance.
150  //
151  // Redis may stop serving during this operation. Instance state will be
152  // IMPORTING for entire operation. When complete, the instance will contain
153  // only data from the imported file.
154  //
155  // The returned operation is automatically deleted after a few hours, so
156  // there is no need to call DeleteOperation.
157  rpc ImportInstance(ImportInstanceRequest)
158      returns (google.longrunning.Operation) {
159    option (google.api.http) = {
160      post: "/v1/{name=projects/*/locations/*/instances/*}:import"
161      body: "*"
162    };
163    option (google.api.method_signature) = "name,input_config";
164    option (google.longrunning.operation_info) = {
165      response_type: "google.cloud.redis.v1.Instance"
166      metadata_type: "google.cloud.redis.v1.OperationMetadata"
167    };
168  }
169
170  // Export Redis instance data into a Redis RDB format file in Cloud Storage.
171  //
172  // Redis will continue serving during this operation.
173  //
174  // The returned operation is automatically deleted after a few hours, so
175  // there is no need to call DeleteOperation.
176  rpc ExportInstance(ExportInstanceRequest)
177      returns (google.longrunning.Operation) {
178    option (google.api.http) = {
179      post: "/v1/{name=projects/*/locations/*/instances/*}:export"
180      body: "*"
181    };
182    option (google.api.method_signature) = "name,output_config";
183    option (google.longrunning.operation_info) = {
184      response_type: "google.cloud.redis.v1.Instance"
185      metadata_type: "google.cloud.redis.v1.OperationMetadata"
186    };
187  }
188
189  // Initiates a failover of the primary node to current replica node for a
190  // specific STANDARD tier Cloud Memorystore for Redis instance.
191  rpc FailoverInstance(FailoverInstanceRequest)
192      returns (google.longrunning.Operation) {
193    option (google.api.http) = {
194      post: "/v1/{name=projects/*/locations/*/instances/*}:failover"
195      body: "*"
196    };
197    option (google.api.method_signature) = "name,data_protection_mode";
198    option (google.longrunning.operation_info) = {
199      response_type: "google.cloud.redis.v1.Instance"
200      metadata_type: "google.cloud.redis.v1.OperationMetadata"
201    };
202  }
203
204  // Deletes a specific Redis instance.  Instance stops serving and data is
205  // deleted.
206  rpc DeleteInstance(DeleteInstanceRequest)
207      returns (google.longrunning.Operation) {
208    option (google.api.http) = {
209      delete: "/v1/{name=projects/*/locations/*/instances/*}"
210    };
211    option (google.api.method_signature) = "name";
212    option (google.longrunning.operation_info) = {
213      response_type: "google.protobuf.Empty"
214      metadata_type: "google.cloud.redis.v1.OperationMetadata"
215    };
216  }
217
218  // Reschedule maintenance for a given instance in a given project and
219  // location.
220  rpc RescheduleMaintenance(RescheduleMaintenanceRequest)
221      returns (google.longrunning.Operation) {
222    option (google.api.http) = {
223      post: "/v1/{name=projects/*/locations/*/instances/*}:rescheduleMaintenance"
224      body: "*"
225    };
226    option (google.api.method_signature) =
227        "name, reschedule_type, schedule_time";
228    option (google.longrunning.operation_info) = {
229      response_type: "google.cloud.redis.v1.Instance"
230      metadata_type: "google.cloud.redis.v1.OperationMetadata"
231    };
232  }
233}
234
235// Node specific properties.
236message NodeInfo {
237  // Output only. Node identifying string. e.g. 'node-0', 'node-1'
238  string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
239
240  // Output only. Location of the node.
241  string zone = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
242}
243
244// A Memorystore for Redis instance.
245message Instance {
246  option (google.api.resource) = {
247    type: "redis.googleapis.com/Instance"
248    pattern: "projects/{project}/locations/{location}/instances/{instance}"
249  };
250
251  // Represents the different states of a Redis instance.
252  enum State {
253    // Not set.
254    STATE_UNSPECIFIED = 0;
255
256    // Redis instance is being created.
257    CREATING = 1;
258
259    // Redis instance has been created and is fully usable.
260    READY = 2;
261
262    // Redis instance configuration is being updated. Certain kinds of updates
263    // may cause the instance to become unusable while the update is in
264    // progress.
265    UPDATING = 3;
266
267    // Redis instance is being deleted.
268    DELETING = 4;
269
270    // Redis instance is being repaired and may be unusable.
271    REPAIRING = 5;
272
273    // Maintenance is being performed on this Redis instance.
274    MAINTENANCE = 6;
275
276    // Redis instance is importing data (availability may be affected).
277    IMPORTING = 8;
278
279    // Redis instance is failing over (availability may be affected).
280    FAILING_OVER = 9;
281  }
282
283  // Available service tiers to choose from
284  enum Tier {
285    // Not set.
286    TIER_UNSPECIFIED = 0;
287
288    // BASIC tier: standalone instance
289    BASIC = 1;
290
291    // STANDARD_HA tier: highly available primary/replica instances
292    STANDARD_HA = 3;
293  }
294
295  // Available connection modes.
296  enum ConnectMode {
297    // Not set.
298    CONNECT_MODE_UNSPECIFIED = 0;
299
300    // Connect via direct peering to the Memorystore for Redis hosted service.
301    DIRECT_PEERING = 1;
302
303    // Connect your Memorystore for Redis instance using Private Service
304    // Access. Private services access provides an IP address range for multiple
305    // Google Cloud services, including Memorystore.
306    PRIVATE_SERVICE_ACCESS = 2;
307  }
308
309  // Available TLS modes.
310  enum TransitEncryptionMode {
311    // Not set.
312    TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0;
313
314    // Client to Server traffic encryption enabled with server authentication.
315    SERVER_AUTHENTICATION = 1;
316
317    // TLS is disabled for the instance.
318    DISABLED = 2;
319  }
320
321  // Read replicas mode.
322  enum ReadReplicasMode {
323    // If not set, Memorystore Redis backend will default to
324    // READ_REPLICAS_DISABLED.
325    READ_REPLICAS_MODE_UNSPECIFIED = 0;
326
327    // If disabled, read endpoint will not be provided and the instance cannot
328    // scale up or down the number of replicas.
329    READ_REPLICAS_DISABLED = 1;
330
331    // If enabled, read endpoint will be provided and the instance can scale
332    // up and down the number of replicas. Not valid for basic tier.
333    READ_REPLICAS_ENABLED = 2;
334  }
335
336  // Possible reasons for the instance to be in a "SUSPENDED" state.
337  enum SuspensionReason {
338    // Not set.
339    SUSPENSION_REASON_UNSPECIFIED = 0;
340
341    // Something wrong with the CMEK key provided by customer.
342    CUSTOMER_MANAGED_KEY_ISSUE = 1;
343  }
344
345  // Required. Unique name of the resource in this scope including project and
346  // location using the form:
347  //     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
348  //
349  // Note: Redis instances are managed and addressed at regional level so
350  // location_id here refers to a GCP region; however, users may choose which
351  // specific zone (or collection of zones for cross-zone instances) an instance
352  // should be provisioned in. Refer to
353  // [location_id][google.cloud.redis.v1.Instance.location_id] and
354  // [alternative_location_id][google.cloud.redis.v1.Instance.alternative_location_id]
355  // fields for more details.
356  string name = 1 [(google.api.field_behavior) = REQUIRED];
357
358  // An arbitrary and optional user-provided name for the instance.
359  string display_name = 2;
360
361  // Resource labels to represent user provided metadata
362  map<string, string> labels = 3;
363
364  // Optional. The zone where the instance will be provisioned. If not provided,
365  // the service will choose a zone from the specified region for the instance.
366  // For standard tier, additional nodes will be added across multiple zones for
367  // protection against zonal failures. If specified, at least one node will be
368  // provisioned in this zone.
369  string location_id = 4 [(google.api.field_behavior) = OPTIONAL];
370
371  // Optional. If specified, at least one node will be provisioned in this zone
372  // in addition to the zone specified in location_id. Only applicable to
373  // standard tier. If provided, it must be a different zone from the one
374  // provided in [location_id]. Additional nodes beyond the first 2 will be
375  // placed in zones selected by the service.
376  string alternative_location_id = 5 [(google.api.field_behavior) = OPTIONAL];
377
378  // Optional. The version of Redis software.
379  // If not provided, latest supported version will be used. Currently, the
380  // supported values are:
381  //
382  //  *   `REDIS_3_2` for Redis 3.2 compatibility
383  //  *   `REDIS_4_0` for Redis 4.0 compatibility (default)
384  //  *   `REDIS_5_0` for Redis 5.0 compatibility
385  //  *   `REDIS_6_X` for Redis 6.x compatibility
386  string redis_version = 7 [(google.api.field_behavior) = OPTIONAL];
387
388  // Optional. For DIRECT_PEERING mode, the CIDR range of internal addresses
389  // that are reserved for this instance. Range must
390  // be unique and non-overlapping with existing subnets in an authorized
391  // network. For PRIVATE_SERVICE_ACCESS mode, the name of one allocated IP
392  // address ranges associated with this private service access connection.
393  // If not provided, the service will choose an unused /29 block, for
394  // example, 10.0.0.0/29 or 192.168.0.0/29.  For READ_REPLICAS_ENABLED
395  // the default block size is /28.
396  string reserved_ip_range = 9 [(google.api.field_behavior) = OPTIONAL];
397
398  // Optional. Additional IP range for node placement. Required when enabling
399  // read replicas on an existing instance. For DIRECT_PEERING mode value must
400  // be a CIDR range of size /28, or "auto". For PRIVATE_SERVICE_ACCESS mode
401  // value must be the name of an allocated address range associated with the
402  // private service access connection, or "auto".
403  string secondary_ip_range = 30 [(google.api.field_behavior) = OPTIONAL];
404
405  // Output only. Hostname or IP address of the exposed Redis endpoint used by
406  // clients to connect to the service.
407  string host = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
408
409  // Output only. The port number of the exposed Redis endpoint.
410  int32 port = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
411
412  // Output only. The current zone where the Redis primary node is located. In
413  // basic tier, this will always be the same as [location_id]. In
414  // standard tier, this can be the zone of any node in the instance.
415  string current_location_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
416
417  // Output only. The time the instance was created.
418  google.protobuf.Timestamp create_time = 13
419      [(google.api.field_behavior) = OUTPUT_ONLY];
420
421  // Output only. The current state of this instance.
422  State state = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
423
424  // Output only. Additional information about the current status of this
425  // instance, if available.
426  string status_message = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
427
428  // Optional. Redis configuration parameters, according to
429  // http://redis.io/topics/config. Currently, the only supported parameters
430  // are:
431  //
432  //  Redis version 3.2 and newer:
433  //
434  //  *   maxmemory-policy
435  //  *   notify-keyspace-events
436  //
437  //  Redis version 4.0 and newer:
438  //
439  //  *   activedefrag
440  //  *   lfu-decay-time
441  //  *   lfu-log-factor
442  //  *   maxmemory-gb
443  //
444  //  Redis version 5.0 and newer:
445  //
446  //  *   stream-node-max-bytes
447  //  *   stream-node-max-entries
448  map<string, string> redis_configs = 16
449      [(google.api.field_behavior) = OPTIONAL];
450
451  // Required. The service tier of the instance.
452  Tier tier = 17 [(google.api.field_behavior) = REQUIRED];
453
454  // Required. Redis memory size in GiB.
455  int32 memory_size_gb = 18 [(google.api.field_behavior) = REQUIRED];
456
457  // Optional. The full name of the Google Compute Engine
458  // [network](https://cloud.google.com/vpc/docs/vpc) to which the
459  // instance is connected. If left unspecified, the `default` network
460  // will be used.
461  string authorized_network = 20 [(google.api.field_behavior) = OPTIONAL];
462
463  // Output only. Cloud IAM identity used by import / export operations to
464  // transfer data to/from Cloud Storage. Format is
465  // "serviceAccount:<service_account_email>". The value may change over time
466  // for a given instance so should be checked before each import/export
467  // operation.
468  string persistence_iam_identity = 21
469      [(google.api.field_behavior) = OUTPUT_ONLY];
470
471  // Optional. The network connect mode of the Redis instance.
472  // If not provided, the connect mode defaults to DIRECT_PEERING.
473  ConnectMode connect_mode = 22 [(google.api.field_behavior) = OPTIONAL];
474
475  // Optional. Indicates whether OSS Redis AUTH is enabled for the instance. If
476  // set to "true" AUTH is enabled on the instance. Default value is "false"
477  // meaning AUTH is disabled.
478  bool auth_enabled = 23 [(google.api.field_behavior) = OPTIONAL];
479
480  // Output only. List of server CA certificates for the instance.
481  repeated TlsCertificate server_ca_certs = 25
482      [(google.api.field_behavior) = OUTPUT_ONLY];
483
484  // Optional. The TLS mode of the Redis instance.
485  // If not provided, TLS is disabled for the instance.
486  TransitEncryptionMode transit_encryption_mode = 26
487      [(google.api.field_behavior) = OPTIONAL];
488
489  // Optional. The maintenance policy for the instance. If not provided,
490  // maintenance events can be performed at any time.
491  MaintenancePolicy maintenance_policy = 27
492      [(google.api.field_behavior) = OPTIONAL];
493
494  // Output only. Date and time of upcoming maintenance events which have been
495  // scheduled.
496  MaintenanceSchedule maintenance_schedule = 28
497      [(google.api.field_behavior) = OUTPUT_ONLY];
498
499  // Optional. The number of replica nodes. The valid range for the Standard
500  // Tier with read replicas enabled is [1-5] and defaults to 2. If read
501  // replicas are not enabled for a Standard Tier instance, the only valid value
502  // is 1 and the default is 1. The valid value for basic tier is 0 and the
503  // default is also 0.
504  int32 replica_count = 31 [(google.api.field_behavior) = OPTIONAL];
505
506  // Output only. Info per node.
507  repeated NodeInfo nodes = 32 [(google.api.field_behavior) = OUTPUT_ONLY];
508
509  // Output only. Hostname or IP address of the exposed readonly Redis
510  // endpoint. Standard tier only. Targets all healthy replica nodes in
511  // instance. Replication is asynchronous and replica nodes will exhibit some
512  // lag behind the primary. Write requests must target 'host'.
513  string read_endpoint = 33 [(google.api.field_behavior) = OUTPUT_ONLY];
514
515  // Output only. The port number of the exposed readonly redis
516  // endpoint. Standard tier only. Write requests should target 'port'.
517  int32 read_endpoint_port = 34 [(google.api.field_behavior) = OUTPUT_ONLY];
518
519  // Optional. Read replicas mode for the instance. Defaults to
520  // READ_REPLICAS_DISABLED.
521  ReadReplicasMode read_replicas_mode = 35
522      [(google.api.field_behavior) = OPTIONAL];
523
524  // Optional. The KMS key reference that the customer provides when trying to
525  // create the instance.
526  string customer_managed_key = 36 [(google.api.field_behavior) = OPTIONAL];
527
528  // Optional. Persistence configuration parameters
529  PersistenceConfig persistence_config = 37
530      [(google.api.field_behavior) = OPTIONAL];
531
532  // Optional. reasons that causes instance in "SUSPENDED" state.
533  repeated SuspensionReason suspension_reasons = 38
534      [(google.api.field_behavior) = OPTIONAL];
535
536  // Optional. The self service update maintenance version.
537  // The version is date based such as "20210712_00_00".
538  string maintenance_version = 39 [(google.api.field_behavior) = OPTIONAL];
539
540  // Optional. The available maintenance versions that an instance could update
541  // to.
542  repeated string available_maintenance_versions = 40
543      [(google.api.field_behavior) = OPTIONAL];
544}
545
546// Configuration of the persistence functionality.
547message PersistenceConfig {
548  // Available Persistence modes.
549  enum PersistenceMode {
550    // Not set.
551    PERSISTENCE_MODE_UNSPECIFIED = 0;
552
553    // Persistence is disabled for the instance,
554    // and any existing snapshots are deleted.
555    DISABLED = 1;
556
557    // RDB based Persistence is enabled.
558    RDB = 2;
559  }
560
561  // Available snapshot periods for scheduling.
562  enum SnapshotPeriod {
563    // Not set.
564    SNAPSHOT_PERIOD_UNSPECIFIED = 0;
565
566    // Snapshot every 1 hour.
567    ONE_HOUR = 3;
568
569    // Snapshot every 6 hours.
570    SIX_HOURS = 4;
571
572    // Snapshot every 12 hours.
573    TWELVE_HOURS = 5;
574
575    // Snapshot every 24 hours.
576    TWENTY_FOUR_HOURS = 6;
577  }
578
579  // Optional. Controls whether Persistence features are enabled.
580  // If not provided, the existing value will be used.
581  PersistenceMode persistence_mode = 1 [(google.api.field_behavior) = OPTIONAL];
582
583  // Optional. Period between RDB snapshots. Snapshots will be attempted every
584  // period starting from the provided snapshot start time. For example, a start
585  // time of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing
586  // until 01/01/2033, and then trigger snapshots every day at 06:45, 12:45,
587  // 18:45, and 00:45 the next day, and so on. If not provided,
588  // TWENTY_FOUR_HOURS will be used as default.
589  SnapshotPeriod rdb_snapshot_period = 2
590      [(google.api.field_behavior) = OPTIONAL];
591
592  // Output only. The next time that a snapshot attempt is scheduled to occur.
593  google.protobuf.Timestamp rdb_next_snapshot_time = 4
594      [(google.api.field_behavior) = OUTPUT_ONLY];
595
596  // Optional. Date and time that the first snapshot was/will be attempted, and
597  // to which future snapshots will be aligned. If not provided, the current
598  // time will be used.
599  google.protobuf.Timestamp rdb_snapshot_start_time = 5
600      [(google.api.field_behavior) = OPTIONAL];
601}
602
603// Request for
604// [RescheduleMaintenance][google.cloud.redis.v1.CloudRedis.RescheduleMaintenance].
605message RescheduleMaintenanceRequest {
606  // Reschedule options.
607  enum RescheduleType {
608    // Not set.
609    RESCHEDULE_TYPE_UNSPECIFIED = 0;
610
611    // If the user wants to schedule the maintenance to happen now.
612    IMMEDIATE = 1;
613
614    // If the user wants to use the existing maintenance policy to find the
615    // next available window.
616    NEXT_AVAILABLE_WINDOW = 2;
617
618    // If the user wants to reschedule the maintenance to a specific time.
619    SPECIFIC_TIME = 3;
620  }
621
622  // Required. Redis instance resource name using the form:
623  //     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
624  // where `location_id` refers to a GCP region.
625  string name = 1 [
626    (google.api.field_behavior) = REQUIRED,
627    (google.api.resource_reference) = { type: "redis.googleapis.com/Instance" }
628  ];
629
630  // Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as
631  // well.
632  RescheduleType reschedule_type = 2 [(google.api.field_behavior) = REQUIRED];
633
634  // Optional. Timestamp when the maintenance shall be rescheduled to if
635  // reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for
636  // example `2012-11-15T16:19:00.094Z`.
637  google.protobuf.Timestamp schedule_time = 3
638      [(google.api.field_behavior) = OPTIONAL];
639}
640
641// Maintenance policy for an instance.
642message MaintenancePolicy {
643  // Output only. The time when the policy was created.
644  google.protobuf.Timestamp create_time = 1
645      [(google.api.field_behavior) = OUTPUT_ONLY];
646
647  // Output only. The time when the policy was last updated.
648  google.protobuf.Timestamp update_time = 2
649      [(google.api.field_behavior) = OUTPUT_ONLY];
650
651  // Optional. Description of what this policy is for. Create/Update methods
652  // return INVALID_ARGUMENT if the length is greater than 512.
653  string description = 3 [(google.api.field_behavior) = OPTIONAL];
654
655  // Optional. Maintenance window that is applied to resources covered by this
656  // policy. Minimum 1. For the current version, the maximum number of
657  // weekly_window is expected to be one.
658  repeated WeeklyMaintenanceWindow weekly_maintenance_window = 4
659      [(google.api.field_behavior) = OPTIONAL];
660}
661
662// Time window in which disruptive maintenance updates occur. Non-disruptive
663// updates can occur inside or outside this window.
664message WeeklyMaintenanceWindow {
665  // Required. The day of week that maintenance updates occur.
666  google.type.DayOfWeek day = 1 [(google.api.field_behavior) = REQUIRED];
667
668  // Required. Start time of the window in UTC time.
669  google.type.TimeOfDay start_time = 2 [(google.api.field_behavior) = REQUIRED];
670
671  // Output only. Duration of the maintenance window. The current window is
672  // fixed at 1 hour.
673  google.protobuf.Duration duration = 3
674      [(google.api.field_behavior) = OUTPUT_ONLY];
675}
676
677// Upcoming maintenance schedule. If no maintenance is scheduled, fields are not
678// populated.
679message MaintenanceSchedule {
680  // Output only. The start time of any upcoming scheduled maintenance for this
681  // instance.
682  google.protobuf.Timestamp start_time = 1
683      [(google.api.field_behavior) = OUTPUT_ONLY];
684
685  // Output only. The end time of any upcoming scheduled maintenance for this
686  // instance.
687  google.protobuf.Timestamp end_time = 2
688      [(google.api.field_behavior) = OUTPUT_ONLY];
689
690  // If the scheduled maintenance can be rescheduled, default is true.
691  bool can_reschedule = 3 [deprecated = true];
692
693  // Output only. The deadline that the maintenance schedule start time can not
694  // go beyond, including reschedule.
695  google.protobuf.Timestamp schedule_deadline_time = 5
696      [(google.api.field_behavior) = OUTPUT_ONLY];
697}
698
699// Request for [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances].
700message ListInstancesRequest {
701  // Required. The resource name of the instance location using the form:
702  //     `projects/{project_id}/locations/{location_id}`
703  // where `location_id` refers to a GCP region.
704  string parent = 1 [
705    (google.api.field_behavior) = REQUIRED,
706    (google.api.resource_reference) = {
707      type: "locations.googleapis.com/Location"
708    }
709  ];
710
711  // The maximum number of items to return.
712  //
713  // If not specified, a default value of 1000 will be used by the service.
714  // Regardless of the page_size value, the response may include a partial list
715  // and a caller should only rely on response's
716  // [`next_page_token`][google.cloud.redis.v1.ListInstancesResponse.next_page_token]
717  // to determine if there are more instances left to be queried.
718  int32 page_size = 2;
719
720  // The `next_page_token` value returned from a previous
721  // [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances] request, if
722  // any.
723  string page_token = 3;
724}
725
726// Response for [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances].
727message ListInstancesResponse {
728  // A list of Redis instances in the project in the specified location,
729  // or across all locations.
730  //
731  // If the `location_id` in the parent field of the request is "-", all regions
732  // available to the project are queried, and the results aggregated.
733  // If in such an aggregated query a location is unavailable, a placeholder
734  // Redis entry is included in the response with the `name` field set to a
735  // value of the form
736  // `projects/{project_id}/locations/{location_id}/instances/`- and the
737  // `status` field set to ERROR and `status_message` field set to "location not
738  // available for ListInstances".
739  repeated Instance instances = 1;
740
741  // Token to retrieve the next page of results, or empty if there are no more
742  // results in the list.
743  string next_page_token = 2;
744
745  // Locations that could not be reached.
746  repeated string unreachable = 3;
747}
748
749// Request for [GetInstance][google.cloud.redis.v1.CloudRedis.GetInstance].
750message GetInstanceRequest {
751  // Required. Redis instance resource name using the form:
752  //     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
753  // where `location_id` refers to a GCP region.
754  string name = 1 [
755    (google.api.field_behavior) = REQUIRED,
756    (google.api.resource_reference) = { type: "redis.googleapis.com/Instance" }
757  ];
758}
759
760// Request for
761// [GetInstanceAuthString][google.cloud.redis.v1.CloudRedis.GetInstanceAuthString].
762message GetInstanceAuthStringRequest {
763  // Required. Redis instance resource name using the form:
764  //     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
765  // where `location_id` refers to a GCP region.
766  string name = 1 [
767    (google.api.field_behavior) = REQUIRED,
768    (google.api.resource_reference) = { type: "redis.googleapis.com/Instance" }
769  ];
770}
771
772// Instance AUTH string details.
773message InstanceAuthString {
774  // AUTH string set on the instance.
775  string auth_string = 1;
776}
777
778// Request for
779// [CreateInstance][google.cloud.redis.v1.CloudRedis.CreateInstance].
780message CreateInstanceRequest {
781  // Required. The resource name of the instance location using the form:
782  //     `projects/{project_id}/locations/{location_id}`
783  // where `location_id` refers to a GCP region.
784  string parent = 1 [
785    (google.api.field_behavior) = REQUIRED,
786    (google.api.resource_reference) = {
787      type: "locations.googleapis.com/Location"
788    }
789  ];
790
791  // Required. The logical name of the Redis instance in the customer project
792  // with the following restrictions:
793  //
794  // * Must contain only lowercase letters, numbers, and hyphens.
795  // * Must start with a letter.
796  // * Must be between 1-40 characters.
797  // * Must end with a number or a letter.
798  // * Must be unique within the customer project / location
799  string instance_id = 2 [(google.api.field_behavior) = REQUIRED];
800
801  // Required. A Redis [Instance] resource
802  Instance instance = 3 [(google.api.field_behavior) = REQUIRED];
803}
804
805// Request for
806// [UpdateInstance][google.cloud.redis.v1.CloudRedis.UpdateInstance].
807message UpdateInstanceRequest {
808  // Required. Mask of fields to update. At least one path must be supplied in
809  // this field. The elements of the repeated paths field may only include these
810  // fields from [Instance][google.cloud.redis.v1.Instance]:
811  //
812  //  *   `displayName`
813  //  *   `labels`
814  //  *   `memorySizeGb`
815  //  *   `redisConfig`
816  //  *   `replica_count`
817  google.protobuf.FieldMask update_mask = 1
818      [(google.api.field_behavior) = REQUIRED];
819
820  // Required. Update description.
821  // Only fields specified in update_mask are updated.
822  Instance instance = 2 [(google.api.field_behavior) = REQUIRED];
823}
824
825// Request for
826// [UpgradeInstance][google.cloud.redis.v1.CloudRedis.UpgradeInstance].
827message UpgradeInstanceRequest {
828  // Required. Redis instance resource name using the form:
829  //     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
830  // where `location_id` refers to a GCP region.
831  string name = 1 [
832    (google.api.field_behavior) = REQUIRED,
833    (google.api.resource_reference) = { type: "redis.googleapis.com/Instance" }
834  ];
835
836  // Required. Specifies the target version of Redis software to upgrade to.
837  string redis_version = 2 [(google.api.field_behavior) = REQUIRED];
838}
839
840// Request for
841// [DeleteInstance][google.cloud.redis.v1.CloudRedis.DeleteInstance].
842message DeleteInstanceRequest {
843  // Required. Redis instance resource name using the form:
844  //     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
845  // where `location_id` refers to a GCP region.
846  string name = 1 [
847    (google.api.field_behavior) = REQUIRED,
848    (google.api.resource_reference) = { type: "redis.googleapis.com/Instance" }
849  ];
850}
851
852// The Cloud Storage location for the input content
853message GcsSource {
854  // Required. Source data URI. (e.g. 'gs://my_bucket/my_object').
855  string uri = 1 [(google.api.field_behavior) = REQUIRED];
856}
857
858// The input content
859message InputConfig {
860  // Required. Specify source location of input data
861  oneof source {
862    // Google Cloud Storage location where input content is located.
863    GcsSource gcs_source = 1;
864  }
865}
866
867// Request for [Import][google.cloud.redis.v1.CloudRedis.ImportInstance].
868message ImportInstanceRequest {
869  // Required. Redis instance resource name using the form:
870  //     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
871  // where `location_id` refers to a GCP region.
872  string name = 1 [(google.api.field_behavior) = REQUIRED];
873
874  // Required. Specify data to be imported.
875  InputConfig input_config = 3 [(google.api.field_behavior) = REQUIRED];
876}
877
878// The Cloud Storage location for the output content
879message GcsDestination {
880  // Required. Data destination URI (e.g.
881  // 'gs://my_bucket/my_object'). Existing files will be overwritten.
882  string uri = 1 [(google.api.field_behavior) = REQUIRED];
883}
884
885// The output content
886message OutputConfig {
887  // Required. Specify destination location of output data
888  oneof destination {
889    // Google Cloud Storage destination for output content.
890    GcsDestination gcs_destination = 1;
891  }
892}
893
894// Request for [Export][google.cloud.redis.v1.CloudRedis.ExportInstance].
895message ExportInstanceRequest {
896  // Required. Redis instance resource name using the form:
897  //     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
898  // where `location_id` refers to a GCP region.
899  string name = 1 [(google.api.field_behavior) = REQUIRED];
900
901  // Required. Specify data to be exported.
902  OutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED];
903}
904
905// Request for [Failover][google.cloud.redis.v1.CloudRedis.FailoverInstance].
906message FailoverInstanceRequest {
907  // Specifies different modes of operation in relation to the data retention.
908  enum DataProtectionMode {
909    // Defaults to LIMITED_DATA_LOSS if a data protection mode is not
910    // specified.
911    DATA_PROTECTION_MODE_UNSPECIFIED = 0;
912
913    // Instance failover will be protected with data loss control. More
914    // specifically, the failover will only be performed if the current
915    // replication offset diff between primary and replica is under a certain
916    // threshold.
917    LIMITED_DATA_LOSS = 1;
918
919    // Instance failover will be performed without data loss control.
920    FORCE_DATA_LOSS = 2;
921  }
922
923  // Required. Redis instance resource name using the form:
924  //     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
925  // where `location_id` refers to a GCP region.
926  string name = 1 [
927    (google.api.field_behavior) = REQUIRED,
928    (google.api.resource_reference) = { type: "redis.googleapis.com/Instance" }
929  ];
930
931  // Optional. Available data protection modes that the user can choose. If it's
932  // unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
933  DataProtectionMode data_protection_mode = 2
934      [(google.api.field_behavior) = OPTIONAL];
935}
936
937// Represents the v1 metadata of the long-running operation.
938message OperationMetadata {
939  // Creation timestamp.
940  google.protobuf.Timestamp create_time = 1;
941
942  // End timestamp.
943  google.protobuf.Timestamp end_time = 2;
944
945  // Operation target.
946  string target = 3;
947
948  // Operation verb.
949  string verb = 4;
950
951  // Operation status details.
952  string status_detail = 5;
953
954  // Specifies if cancellation was requested for the operation.
955  bool cancel_requested = 6;
956
957  // API version.
958  string api_version = 7;
959}
960
961// This location metadata represents additional configuration options for a
962// given location where a Redis instance may be created. All fields are output
963// only. It is returned as content of the
964// `google.cloud.location.Location.metadata` field.
965message LocationMetadata {
966  // Output only. The set of available zones in the location. The map is keyed
967  // by the lowercase ID of each zone, as defined by GCE. These keys can be
968  // specified in `location_id` or `alternative_location_id` fields when
969  // creating a Redis instance.
970  map<string, ZoneMetadata> available_zones = 1
971      [(google.api.field_behavior) = OUTPUT_ONLY];
972}
973
974// Defines specific information for a particular zone. Currently empty and
975// reserved for future use only.
976message ZoneMetadata {}
977
978// TlsCertificate Resource
979message TlsCertificate {
980  // Serial number, as extracted from the certificate.
981  string serial_number = 1;
982
983  // PEM representation.
984  string cert = 2;
985
986  // Output only. The time when the certificate was created in [RFC
987  // 3339](https://tools.ietf.org/html/rfc3339) format, for example
988  // `2020-05-18T00:00:00.094Z`.
989  google.protobuf.Timestamp create_time = 3
990      [(google.api.field_behavior) = OUTPUT_ONLY];
991
992  // Output only. The time when the certificate expires in [RFC
993  // 3339](https://tools.ietf.org/html/rfc3339) format, for example
994  // `2020-05-18T00:00:00.094Z`.
995  google.protobuf.Timestamp expire_time = 4
996      [(google.api.field_behavior) = OUTPUT_ONLY];
997
998  // Sha1 Fingerprint of the certificate.
999  string sha1_fingerprint = 5;
1000}
1001