Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit ac4b95d

Browse files
authored
Add protos as an artifact to library (#7205)
1 parent e361a47 commit ac4b95d

File tree

4 files changed

+689
-6
lines changed

4 files changed

+689
-6
lines changed
Lines changed: 340 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,340 @@
1+
// Copyright 2018 Google Inc.
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+
15+
syntax = "proto3";
16+
17+
package google.cloud.redis.v1beta1;
18+
19+
import "google/api/annotations.proto";
20+
import "google/longrunning/operations.proto";
21+
import "google/protobuf/field_mask.proto";
22+
import "google/protobuf/timestamp.proto";
23+
24+
option go_package = "google.golang.org/genproto/googleapis/cloud/redis/v1beta1;redis";
25+
option java_multiple_files = true;
26+
option java_outer_classname = "CloudRedisServiceBetaProto";
27+
option java_package = "com.google.cloud.redis.v1beta1";
28+
29+
30+
// Configures and manages Cloud Memorystore for Redis instances
31+
//
32+
// Google Cloud Memorystore for Redis v1beta1
33+
//
34+
// The `redis.googleapis.com` service implements the Google Cloud Memorystore
35+
// for Redis API and defines the following resource model for managing Redis
36+
// instances:
37+
// * The service works with a collection of cloud projects, named: `/projects/*`
38+
// * Each project has a collection of available locations, named: `/locations/*`
39+
// * Each location has a collection of Redis instances, named: `/instances/*`
40+
// * As such, Redis instances are resources of the form:
41+
// `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
42+
//
43+
// Note that location_id must be refering to a GCP `region`; for example:
44+
// * `projects/redpepper-1290/locations/us-central1/instances/my-redis`
45+
service CloudRedis {
46+
// Lists all Redis instances owned by a project in either the specified
47+
// location (region) or all locations.
48+
//
49+
// The location should have the following format:
50+
// * `projects/{project_id}/locations/{location_id}`
51+
//
52+
// If `location_id` is specified as `-` (wildcard), then all regions
53+
// available to the project are queried, and the results are aggregated.
54+
rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) {
55+
option (google.api.http) = {
56+
get: "/v1beta1/{parent=projects/*/locations/*}/instances"
57+
};
58+
}
59+
60+
// Gets the details of a specific Redis instance.
61+
rpc GetInstance(GetInstanceRequest) returns (Instance) {
62+
option (google.api.http) = {
63+
get: "/v1beta1/{name=projects/*/locations/*/instances/*}"
64+
};
65+
}
66+
67+
// Creates a Redis instance based on the specified tier and memory size.
68+
//
69+
// By default, the instance is peered to the project's
70+
// [default network](/compute/docs/networks-and-firewalls#networks).
71+
//
72+
// The creation is executed asynchronously and callers may check the returned
73+
// operation to track its progress. Once the operation is completed the Redis
74+
// instance will be fully functional. Completed longrunning.Operation will
75+
// contain the new instance object in the response field.
76+
//
77+
// The returned operation is automatically deleted after a few hours, so there
78+
// is no need to call DeleteOperation.
79+
rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) {
80+
option (google.api.http) = {
81+
post: "/v1beta1/{parent=projects/*/locations/*}/instances"
82+
body: "instance"
83+
};
84+
}
85+
86+
// Updates the metadata and configuration of a specific Redis instance.
87+
//
88+
// Completed longrunning.Operation will contain the new instance object
89+
// in the response field. The returned operation is automatically deleted
90+
// after a few hours, so there is no need to call DeleteOperation.
91+
rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) {
92+
option (google.api.http) = {
93+
patch: "/v1beta1/{instance.name=projects/*/locations/*/instances/*}"
94+
body: "instance"
95+
};
96+
}
97+
98+
// Deletes a specific Redis instance. Instance stops serving and data is
99+
// deleted.
100+
rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) {
101+
option (google.api.http) = {
102+
delete: "/v1beta1/{name=projects/*/locations/*/instances/*}"
103+
};
104+
}
105+
}
106+
107+
// A Google Cloud Redis instance.
108+
message Instance {
109+
// Represents the different states of a Redis instance.
110+
enum State {
111+
// Not set.
112+
STATE_UNSPECIFIED = 0;
113+
114+
// Redis instance is being created.
115+
CREATING = 1;
116+
117+
// Redis instance has been created and is fully usable.
118+
READY = 2;
119+
120+
// Redis instance configuration is being updated. Certain kinds of updates
121+
// may cause the instance to become unusable while the update is in
122+
// progress.
123+
UPDATING = 3;
124+
125+
// Redis instance is being deleted.
126+
DELETING = 4;
127+
128+
// Redis instance is being repaired and may be unusable. Details can be
129+
// found in the `status_message` field.
130+
REPAIRING = 5;
131+
132+
// Maintenance is being performed on this Redis instance.
133+
MAINTENANCE = 6;
134+
}
135+
136+
// Available service tiers to choose from
137+
enum Tier {
138+
// Not set.
139+
TIER_UNSPECIFIED = 0;
140+
141+
// BASIC tier: standalone instance
142+
BASIC = 1;
143+
144+
// STANDARD_HA tier: highly available primary/replica instances
145+
STANDARD_HA = 3;
146+
}
147+
148+
// Required. Unique name of the resource in this scope including project and
149+
// location using the form:
150+
// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
151+
//
152+
// Note: Redis instances are managed and addressed at regional level so
153+
// location_id here refers to a GCP region; however, users get to choose which
154+
// specific zone (or collection of zones for cross-zone instances) an instance
155+
// should be provisioned in. Refer to [location_id] and
156+
// [alternative_location_id] fields for more details.
157+
string name = 1;
158+
159+
// An arbitrary and optional user-provided name for the instance.
160+
string display_name = 2;
161+
162+
// Resource labels to represent user provided metadata
163+
map<string, string> labels = 3;
164+
165+
// Optional. The zone where the instance will be provisioned. If not provided,
166+
// the service will choose a zone for the instance. For STANDARD_HA tier,
167+
// instances will be created across two zones for protection against zonal
168+
// failures. if [alternative_location_id] is also provided, it must be
169+
// different from [location_id].
170+
string location_id = 4;
171+
172+
// Optional. Only applicable to STANDARD_HA tier which protects the instance
173+
// against zonal failures by provisioning it across two zones. If provided, it
174+
// must be a different zone from the one provided in [location_id].
175+
string alternative_location_id = 5;
176+
177+
// Optional. The version of Redis software.
178+
// If not provided, latest supported version will be used.
179+
string redis_version = 7;
180+
181+
// Optional. The CIDR range of internal addresses that are reserved for this
182+
// instance. If not provided, the service will choose an unused /29 block,
183+
// for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique
184+
// and non-overlapping with existing subnets in a network.
185+
string reserved_ip_range = 9;
186+
187+
// Output only. Hostname or IP address of the exposed redis endpoint used by
188+
// clients to connect to the service.
189+
string host = 10;
190+
191+
// Output only. The port number of the exposed redis endpoint.
192+
int32 port = 11;
193+
194+
// Output only. The current zone where the Redis endpoint is placed. In
195+
// single zone deployments, this will always be the same as [location_id]
196+
// provided by the user at creation time. In cross-zone instances (only
197+
// applicable in STANDARD_HA tier), this can be either [location_id] or
198+
// [alternative_location_id] and can change on a failover event.
199+
string current_location_id = 12;
200+
201+
// Output only. The time the instance was created.
202+
google.protobuf.Timestamp create_time = 13;
203+
204+
// Output only. The current state of this instance.
205+
State state = 14;
206+
207+
// Output only. Additional information about the current status of this
208+
// instance, if available.
209+
string status_message = 15;
210+
211+
// Optional. Redis configuration parameters, according to
212+
// http://redis.io/topics/config. Currently, the only supported parameters
213+
// are:
214+
// * maxmemory-policy
215+
// * notify-keyspace-events
216+
map<string, string> redis_configs = 16;
217+
218+
// Required. The service tier of the instance.
219+
Tier tier = 17;
220+
221+
// Required. Redis memory size in GB.
222+
int32 memory_size_gb = 18;
223+
224+
// Optional. The full name of the Google Compute Engine
225+
// [network](/compute/docs/networks-and-firewalls#networks) to which the
226+
// instance is connected. If left unspecified, the `default` network
227+
// will be used.
228+
string authorized_network = 20;
229+
}
230+
231+
// Request for [ListInstances][google.cloud.redis.v1beta1.CloudRedis.ListInstances].
232+
message ListInstancesRequest {
233+
// Required. The resource name of the instance location using the form:
234+
// `projects/{project_id}/locations/{location_id}`
235+
// where `location_id` refers to a GCP region
236+
string parent = 1;
237+
238+
// The maximum number of items to return.
239+
//
240+
// If not specified, a default value of 1000 will be used by the service.
241+
// Regardless of the page_size value, the response may include a partial list
242+
// and a caller should only rely on response's
243+
// [next_page_token][CloudRedis.ListInstancesResponse.next_page_token]
244+
// to determine if there are more instances left to be queried.
245+
int32 page_size = 2;
246+
247+
// The next_page_token value returned from a previous List request,
248+
// if any.
249+
string page_token = 3;
250+
}
251+
252+
// Response for [ListInstances][google.cloud.redis.v1beta1.CloudRedis.ListInstances].
253+
message ListInstancesResponse {
254+
// A list of Redis instances in the project in the specified location,
255+
// or across all locations.
256+
//
257+
// If the `location_id` in the parent field of the request is "-", all regions
258+
// available to the project are queried, and the results aggregated.
259+
// If in such an aggregated query a location is unavailable, a dummy Redis
260+
// entry is included in the response with the "name" field set to a value of
261+
// the form projects/{project_id}/locations/{location_id}/instances/- and the
262+
// "status" field set to ERROR and "status_message" field set to "location not
263+
// available for ListInstances".
264+
repeated Instance instances = 1;
265+
266+
// Token to retrieve the next page of results, or empty if there are no more
267+
// results in the list.
268+
string next_page_token = 2;
269+
}
270+
271+
// Request for [GetInstance][google.cloud.redis.v1beta1.CloudRedis.GetInstance].
272+
message GetInstanceRequest {
273+
// Required. Redis instance resource name using the form:
274+
// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
275+
// where `location_id` refers to a GCP region
276+
string name = 1;
277+
}
278+
279+
// Request for [CreateInstance][google.cloud.redis.v1beta1.CloudRedis.CreateInstance].
280+
message CreateInstanceRequest {
281+
// Required. The resource name of the instance location using the form:
282+
// `projects/{project_id}/locations/{location_id}`
283+
// where `location_id` refers to a GCP region
284+
string parent = 1;
285+
286+
// Required. The logical name of the Redis instance in the customer project
287+
// with the following restrictions:
288+
//
289+
// * Must contain only lowercase letters, numbers, and hyphens.
290+
// * Must start with a letter.
291+
// * Must be between 1-40 characters.
292+
// * Must end with a number or a letter.
293+
// * Must be unique within the customer project / location
294+
string instance_id = 2;
295+
296+
// Required. A Redis [Instance] resource
297+
Instance instance = 3;
298+
}
299+
300+
// Request for [UpdateInstance][google.cloud.redis.v1beta1.CloudRedis.UpdateInstance].
301+
message UpdateInstanceRequest {
302+
// Required. Mask of fields to update. At least one path must be supplied in
303+
// this field. The elements of the repeated paths field may only include these
304+
// fields from [Instance][CloudRedis.Instance]:
305+
// * `display_name`
306+
// * `labels`
307+
// * `memory_size_gb`
308+
// * `redis_config`
309+
google.protobuf.FieldMask update_mask = 1;
310+
311+
// Required. Update description.
312+
// Only fields specified in update_mask are updated.
313+
Instance instance = 2;
314+
}
315+
316+
// Request for [DeleteInstance][google.cloud.redis.v1beta1.CloudRedis.DeleteInstance].
317+
message DeleteInstanceRequest {
318+
// Required. Redis instance resource name using the form:
319+
// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
320+
// where `location_id` refers to a GCP region
321+
string name = 1;
322+
}
323+
324+
// This location metadata represents additional configuration options for a
325+
// given location where a Redis instance may be created. All fields are output
326+
// only. It is returned as content of the
327+
// `google.cloud.location.Location.metadata` field.
328+
message LocationMetadata {
329+
// Output only. The set of available zones in the location. The map is keyed
330+
// by the lowercase ID of each zone, as defined by GCE. These keys can be
331+
// specified in `location_id` or `alternative_location_id` fields when
332+
// creating a Redis instance.
333+
map<string, ZoneMetadata> available_zones = 1;
334+
}
335+
336+
// Defines specific information for a particular zone. Currently empty and
337+
// reserved for future use only.
338+
message ZoneMetadata {
339+
340+
}

0 commit comments

Comments
 (0)