1 // Copyright 2019 Google LLC.
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 package google.cloud.redis.v1;
20 import "google/api/annotations.proto";
21 import "google/api/resource.proto";
22 import "google/longrunning/operations.proto";
23 import "google/protobuf/field_mask.proto";
24 import "google/protobuf/timestamp.proto";
26 option go_package = "google.golang.org/genproto/googleapis/cloud/redis/v1;redis";
27 option java_multiple_files = true;
28 option java_outer_classname = "CloudRedisServiceV1Proto";
29 option java_package = "com.google.cloud.redis.v1";
32 // Configures and manages Cloud Memorystore for Redis instances
34 // Google Cloud Memorystore for Redis v1
36 // The `redis.googleapis.com` service implements the Google Cloud Memorystore
37 // for Redis API and defines the following resource model for managing Redis
39 // * The service works with a collection of cloud projects, named: `/projects/*`
40 // * Each project has a collection of available locations, named: `/locations/*`
41 // * Each location has a collection of Redis instances, named: `/instances/*`
42 // * As such, Redis instances are resources of the form:
43 // `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
45 // Note that location_id must be referring to a GCP `region`; for example:
46 // * `projects/redpepper-1290/locations/us-central1/instances/my-redis`
48 // Lists all Redis instances owned by a project in either the specified
49 // location (region) or all locations.
51 // The location should have the following format:
52 // * `projects/{project_id}/locations/{location_id}`
54 // If `location_id` is specified as `-` (wildcard), then all regions
55 // available to the project are queried, and the results are aggregated.
56 rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) {
57 option (google.api.http) = {
58 get: "/v1/{parent=projects/*/locations/*}/instances"
62 // Gets the details of a specific Redis instance.
63 rpc GetInstance(GetInstanceRequest) returns (Instance) {
64 option (google.api.http) = {
65 get: "/v1/{name=projects/*/locations/*/instances/*}"
69 // Creates a Redis instance based on the specified tier and memory size.
71 // By default, the instance is accessible from the project's
72 // [default network](/compute/docs/networks-and-firewalls#networks).
74 // The creation is executed asynchronously and callers may check the returned
75 // operation to track its progress. Once the operation is completed the Redis
76 // instance will be fully functional. Completed longrunning.Operation will
77 // contain the new instance object in the response field.
79 // The returned operation is automatically deleted after a few hours, so there
80 // is no need to call DeleteOperation.
81 rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) {
82 option (google.api.http) = {
83 post: "/v1/{parent=projects/*/locations/*}/instances"
88 // Updates the metadata and configuration of a specific Redis instance.
90 // Completed longrunning.Operation will contain the new instance object
91 // in the response field. The returned operation is automatically deleted
92 // after a few hours, so there is no need to call DeleteOperation.
93 rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) {
94 option (google.api.http) = {
95 patch: "/v1/{instance.name=projects/*/locations/*/instances/*}"
100 // Failover the master role to current replica node against a specific
101 // STANDARD tier redis instance.
102 rpc FailoverInstance(FailoverInstanceRequest) returns (google.longrunning.Operation) {
103 option (google.api.http) = {
104 post: "/v1/{name=projects/*/locations/*/instances/*}:failover"
109 // Deletes a specific Redis instance. Instance stops serving and data is
111 rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) {
112 option (google.api.http) = {
113 delete: "/v1/{name=projects/*/locations/*/instances/*}"
118 // A Google Cloud Redis instance.
120 // Represents the different states of a Redis instance.
123 STATE_UNSPECIFIED = 0;
125 // Redis instance is being created.
128 // Redis instance has been created and is fully usable.
131 // Redis instance configuration is being updated. Certain kinds of updates
132 // may cause the instance to become unusable while the update is in
136 // Redis instance is being deleted.
139 // Redis instance is being repaired and may be unusable.
142 // Maintenance is being performed on this Redis instance.
145 // Redis instance is failing over (availability may be affected).
149 // Available service tiers to choose from
152 TIER_UNSPECIFIED = 0;
154 // BASIC tier: standalone instance
157 // STANDARD_HA tier: highly available primary/replica instances
161 // Required. Unique name of the resource in this scope including project and
162 // location using the form:
163 // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
165 // Note: Redis instances are managed and addressed at regional level so
166 // location_id here refers to a GCP region; however, users may choose which
167 // specific zone (or collection of zones for cross-zone instances) an instance
168 // should be provisioned in. Refer to [location_id] and
169 // [alternative_location_id] fields for more details.
172 // An arbitrary and optional user-provided name for the instance.
173 string display_name = 2;
175 // Resource labels to represent user provided metadata
176 map<string, string> labels = 3;
178 // Optional. The zone where the instance will be provisioned. If not provided,
179 // the service will choose a zone for the instance. For STANDARD_HA tier,
180 // instances will be created across two zones for protection against zonal
181 // failures. If [alternative_location_id] is also provided, it must be
182 // different from [location_id].
183 string location_id = 4;
185 // Optional. Only applicable to STANDARD_HA tier which protects the instance
186 // against zonal failures by provisioning it across two zones. If provided, it
187 // must be a different zone from the one provided in [location_id].
188 string alternative_location_id = 5;
190 // Optional. The version of Redis software.
191 // If not provided, latest supported version will be used. Updating the
192 // version will perform an upgrade/downgrade to the new version. Currently,
193 // the supported values are `REDIS_3_2` for Redis 3.2.
194 string redis_version = 7;
196 // Optional. The CIDR range of internal addresses that are reserved for this
197 // instance. If not provided, the service will choose an unused /29 block,
198 // for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique
199 // and non-overlapping with existing subnets in an authorized network.
200 string reserved_ip_range = 9;
202 // Output only. Hostname or IP address of the exposed Redis endpoint used by
203 // clients to connect to the service.
206 // Output only. The port number of the exposed Redis endpoint.
209 // Output only. The current zone where the Redis endpoint is placed. For Basic
210 // Tier instances, this will always be the same as the [location_id]
211 // provided by the user at creation time. For Standard Tier instances,
212 // this can be either [location_id] or [alternative_location_id] and can
213 // change after a failover event.
214 string current_location_id = 12;
216 // Output only. The time the instance was created.
217 google.protobuf.Timestamp create_time = 13;
219 // Output only. The current state of this instance.
222 // Output only. Additional information about the current status of this
223 // instance, if available.
224 string status_message = 15;
226 // Optional. Redis configuration parameters, according to
227 // http://redis.io/topics/config. Currently, the only supported parameters
230 // * maxmemory-policy
231 // * notify-keyspace-events
232 map<string, string> redis_configs = 16;
234 // Required. The service tier of the instance.
237 // Required. Redis memory size in GiB.
238 int32 memory_size_gb = 18;
240 // Optional. The full name of the Google Compute Engine
241 // [network](/compute/docs/networks-and-firewalls#networks) to which the
242 // instance is connected. If left unspecified, the `default` network
244 string authorized_network = 20;
247 // Request for [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances].
248 message ListInstancesRequest {
249 // Required. The resource name of the instance location using the form:
250 // `projects/{project_id}/locations/{location_id}`
251 // where `location_id` refers to a GCP region
254 // The maximum number of items to return.
256 // If not specified, a default value of 1000 will be used by the service.
257 // Regardless of the page_size value, the response may include a partial list
258 // and a caller should only rely on response's
259 // [next_page_token][CloudRedis.ListInstancesResponse.next_page_token]
260 // to determine if there are more instances left to be queried.
263 // The next_page_token value returned from a previous List request,
265 string page_token = 3;
268 // Response for [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances].
269 message ListInstancesResponse {
270 // A list of Redis instances in the project in the specified location,
271 // or across all locations.
273 // If the `location_id` in the parent field of the request is "-", all regions
274 // available to the project are queried, and the results aggregated.
275 // If in such an aggregated query a location is unavailable, a dummy Redis
276 // entry is included in the response with the "name" field set to a value of
277 // the form projects/{project_id}/locations/{location_id}/instances/- and the
278 // "status" field set to ERROR and "status_message" field set to "location not
279 // available for ListInstances".
280 repeated Instance instances = 1;
282 // Token to retrieve the next page of results, or empty if there are no more
283 // results in the list.
284 string next_page_token = 2;
286 // Locations that could not be reached.
287 repeated string unreachable = 3;
290 // Request for [GetInstance][google.cloud.redis.v1.CloudRedis.GetInstance].
291 message GetInstanceRequest {
292 // Required. Redis instance resource name using the form:
293 // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
294 // where `location_id` refers to a GCP region
298 // Request for [CreateInstance][google.cloud.redis.v1.CloudRedis.CreateInstance].
299 message CreateInstanceRequest {
300 // Required. The resource name of the instance location using the form:
301 // `projects/{project_id}/locations/{location_id}`
302 // where `location_id` refers to a GCP region
305 // Required. The logical name of the Redis instance in the customer project
306 // with the following restrictions:
308 // * Must contain only lowercase letters, numbers, and hyphens.
309 // * Must start with a letter.
310 // * Must be between 1-40 characters.
311 // * Must end with a number or a letter.
312 // * Must be unique within the customer project / location
313 string instance_id = 2;
315 // Required. A Redis [Instance] resource
316 Instance instance = 3;
319 // Request for [UpdateInstance][google.cloud.redis.v1.CloudRedis.UpdateInstance].
320 message UpdateInstanceRequest {
321 // Required. Mask of fields to update. At least one path must be supplied in
322 // this field. The elements of the repeated paths field may only include these
323 // fields from [Instance][CloudRedis.Instance]:
329 google.protobuf.FieldMask update_mask = 1;
331 // Required. Update description.
332 // Only fields specified in update_mask are updated.
333 Instance instance = 2;
336 // Request for [DeleteInstance][google.cloud.redis.v1.CloudRedis.DeleteInstance].
337 message DeleteInstanceRequest {
338 // Required. Redis instance resource name using the form:
339 // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
340 // where `location_id` refers to a GCP region
344 // Request for [Failover][google.cloud.redis.v1.CloudRedis.FailoverInstance].
345 message FailoverInstanceRequest {
346 enum DataProtectionMode {
347 DATA_PROTECTION_MODE_UNSPECIFIED = 0;
349 // Instance failover will be protected with data loss control. More
350 // specifically, the failover will only be performed if the current
351 // replication offset diff between master and replica is under a certain
353 LIMITED_DATA_LOSS = 1;
355 // Instance failover will be performed without data loss control.
359 // Required. Redis instance resource name using the form:
360 // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
361 // where `location_id` refers to a GCP region
364 // Optional. Available data protection modes that the user can choose. If it's
365 // unspecified, data protection mode will be LIMITED_DATA_LOSS by default.
366 DataProtectionMode data_protection_mode = 2;
369 // Represents the v1 metadata of the long-running operation.
370 message OperationMetadata {
371 // Creation timestamp.
372 google.protobuf.Timestamp create_time = 1;
375 google.protobuf.Timestamp end_time = 2;
383 // Operation status details.
384 string status_detail = 5;
386 // Specifies if cancellation was requested for the operation.
387 bool cancel_requested = 6;
390 string api_version = 7;
393 // This location metadata represents additional configuration options for a
394 // given location where a Redis instance may be created. All fields are output
395 // only. It is returned as content of the
396 // `google.cloud.location.Location.metadata` field.
397 message LocationMetadata {
398 // Output only. The set of available zones in the location. The map is keyed
399 // by the lowercase ID of each zone, as defined by GCE. These keys can be
400 // specified in `location_id` or `alternative_location_id` fields when
401 // creating a Redis instance.
402 map<string, ZoneMetadata> available_zones = 1;
405 // Defines specific information for a particular zone. Currently empty and
406 // reserved for future use only.
407 message ZoneMetadata {