xref: /aosp_15_r20/external/googleapis/google/cloud/runtimeconfig/v1beta1/runtimeconfig.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2017 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
15syntax = "proto3";
16
17package google.cloud.runtimeconfig.v1beta1;
18
19import "google/api/annotations.proto";
20import "google/cloud/runtimeconfig/v1beta1/resources.proto";
21import "google/longrunning/operations.proto";
22import "google/protobuf/empty.proto";
23import "google/protobuf/timestamp.proto";
24
25option csharp_namespace = "Google.Cloud.RuntimeConfig.V1Beta1";
26option go_package = "cloud.google.com/go/runtimeconfig/apiv1beta1/runtimeconfigpb;runtimeconfigpb";
27option java_multiple_files = true;
28option java_package = "com.google.cloud.runtimeconfig.v1beta1";
29option php_namespace = "Google\\Cloud\\RuntimeConfig\\V1beta1";
30
31// RuntimeConfig API represents configuration objects and operations on those
32// configuration objects.
33// RuntimeConfig objects consist of Variables logically grouped in the those
34// objects.
35// Variables are simple key-value pairs. Variables can be watched for changes or
36// deletions. Variable key can be hieararchical, e.g. ports/serving_port,
37// ports/monitoring_port, etc. Variable names can be hierarchical. No variable
38// name can be prefix of another.
39// Config objects represent logical containers for variables, e.g. flags,
40// passwords, etc.
41service RuntimeConfigManager {
42  // Lists all the RuntimeConfig resources within project.
43  rpc ListConfigs(ListConfigsRequest) returns (ListConfigsResponse) {
44    option (google.api.http) = {
45      get: "/v1beta1/{parent=projects/*}/configs"
46    };
47  }
48
49  // Gets information about a RuntimeConfig resource.
50  rpc GetConfig(GetConfigRequest) returns (RuntimeConfig) {
51    option (google.api.http) = {
52      get: "/v1beta1/{name=projects/*/configs/*}"
53    };
54  }
55
56  // Creates a new RuntimeConfig resource. The configuration name must be
57  // unique within project.
58  rpc CreateConfig(CreateConfigRequest) returns (RuntimeConfig) {
59    option (google.api.http) = {
60      post: "/v1beta1/{parent=projects/*}/configs"
61      body: "config"
62    };
63  }
64
65  // Updates a RuntimeConfig resource. The configuration must exist beforehand.
66  rpc UpdateConfig(UpdateConfigRequest) returns (RuntimeConfig) {
67    option (google.api.http) = {
68      put: "/v1beta1/{name=projects/*/configs/*}"
69      body: "config"
70    };
71  }
72
73  // Deletes a RuntimeConfig resource.
74  rpc DeleteConfig(DeleteConfigRequest) returns (google.protobuf.Empty) {
75    option (google.api.http) = {
76      delete: "/v1beta1/{name=projects/*/configs/*}"
77    };
78  }
79
80  // Lists variables within given a configuration, matching any provided
81  // filters. This only lists variable names, not the values, unless
82  // `return_values` is true, in which case only variables that user has IAM
83  // permission to GetVariable will be returned.
84  rpc ListVariables(ListVariablesRequest) returns (ListVariablesResponse) {
85    option (google.api.http) = {
86      get: "/v1beta1/{parent=projects/*/configs/*}/variables"
87    };
88  }
89
90  // Gets information about a single variable.
91  rpc GetVariable(GetVariableRequest) returns (Variable) {
92    option (google.api.http) = {
93      get: "/v1beta1/{name=projects/*/configs/*/variables/**}"
94    };
95  }
96
97  // Watches a specific variable and waits for a change in the variable's value.
98  // When there is a change, this method returns the new value or times out.
99  //
100  // If a variable is deleted while being watched, the `variableState` state is
101  // set to `DELETED` and the method returns the last known variable `value`.
102  //
103  // If you set the deadline for watching to a larger value than internal
104  // timeout (60 seconds), the current variable value is returned and the
105  // `variableState` will be `VARIABLE_STATE_UNSPECIFIED`.
106  //
107  // To learn more about creating a watcher, read the
108  // [Watching a Variable for
109  // Changes](/deployment-manager/runtime-configurator/watching-a-variable)
110  // documentation.
111  rpc WatchVariable(WatchVariableRequest) returns (Variable) {
112    option (google.api.http) = {
113      post: "/v1beta1/{name=projects/*/configs/*/variables/**}:watch"
114      body: "*"
115    };
116  }
117
118  // Creates a variable within the given configuration. You cannot create
119  // a variable with a name that is a prefix of an existing variable name, or a
120  // name that has an existing variable name as a prefix.
121  //
122  // To learn more about creating a variable, read the
123  // [Setting and Getting
124  // Data](/deployment-manager/runtime-configurator/set-and-get-variables)
125  // documentation.
126  rpc CreateVariable(CreateVariableRequest) returns (Variable) {
127    option (google.api.http) = {
128      post: "/v1beta1/{parent=projects/*/configs/*}/variables"
129      body: "variable"
130    };
131  }
132
133  // Updates an existing variable with a new value.
134  rpc UpdateVariable(UpdateVariableRequest) returns (Variable) {
135    option (google.api.http) = {
136      put: "/v1beta1/{name=projects/*/configs/*/variables/**}"
137      body: "variable"
138    };
139  }
140
141  // Deletes a variable or multiple variables.
142  //
143  // If you specify a variable name, then that variable is deleted. If you
144  // specify a prefix and `recursive` is true, then all variables with that
145  // prefix are deleted. You must set a `recursive` to true if you delete
146  // variables by prefix.
147  rpc DeleteVariable(DeleteVariableRequest) returns (google.protobuf.Empty) {
148    option (google.api.http) = {
149      delete: "/v1beta1/{name=projects/*/configs/*/variables/**}"
150    };
151  }
152
153  // List waiters within the given configuration.
154  rpc ListWaiters(ListWaitersRequest) returns (ListWaitersResponse) {
155    option (google.api.http) = {
156      get: "/v1beta1/{parent=projects/*/configs/*}/waiters"
157    };
158  }
159
160  // Gets information about a single waiter.
161  rpc GetWaiter(GetWaiterRequest) returns (Waiter) {
162    option (google.api.http) = {
163      get: "/v1beta1/{name=projects/*/configs/*/waiters/*}"
164    };
165  }
166
167  // Creates a Waiter resource. This operation returns a long-running Operation
168  // resource which can be polled for completion. However, a waiter with the
169  // given name will exist (and can be retrieved) prior to the operation
170  // completing. If the operation fails, the failed Waiter resource will
171  // still exist and must be deleted prior to subsequent creation attempts.
172  rpc CreateWaiter(CreateWaiterRequest) returns (google.longrunning.Operation) {
173    option (google.api.http) = {
174      post: "/v1beta1/{parent=projects/*/configs/*}/waiters"
175      body: "waiter"
176    };
177  }
178
179  // Deletes the waiter with the specified name.
180  rpc DeleteWaiter(DeleteWaiterRequest) returns (google.protobuf.Empty) {
181    option (google.api.http) = {
182      delete: "/v1beta1/{name=projects/*/configs/*/waiters/*}"
183    };
184  }
185}
186
187// Request for the `ListConfigs()` method.
188message ListConfigsRequest {
189  // The [project
190  // ID](https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848)
191  // for this request, in the format `projects/[PROJECT_ID]`.
192  string parent = 1;
193
194  // Specifies the number of results to return per page. If there are fewer
195  // elements than the specified number, returns all elements.
196  int32 page_size = 2;
197
198  // Specifies a page token to use. Set `pageToken` to a `nextPageToken`
199  // returned by a previous list request to get the next page of results.
200  string page_token = 3;
201}
202
203// `ListConfigs()` returns the following response. The order of returned
204// objects is arbitrary; that is, it is not ordered in any particular way.
205message ListConfigsResponse {
206  // A list of the configurations in the project. The order of returned
207  // objects is arbitrary; that is, it is not ordered in any particular way.
208  repeated RuntimeConfig configs = 1;
209
210  // This token allows you to get the next page of results for list requests.
211  // If the number of results is larger than `pageSize`, use the `nextPageToken`
212  // as a value for the query parameter `pageToken` in the next list request.
213  // Subsequent list requests will have their own `nextPageToken` to continue
214  // paging through the results
215  string next_page_token = 2;
216}
217
218// Gets a RuntimeConfig resource.
219message GetConfigRequest {
220  // The name of the RuntimeConfig resource to retrieve, in the format:
221  //
222  // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]`
223  string name = 2;
224}
225
226// Creates a RuntimeConfig resource.
227message CreateConfigRequest {
228  // The [project
229  // ID](https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848)
230  // for this request, in the format `projects/[PROJECT_ID]`.
231  string parent = 1;
232
233  // The RuntimeConfig to create.
234  RuntimeConfig config = 2;
235
236  // An optional but recommended unique `request_id`. If the server
237  // receives two `create()` requests  with the same
238  // `request_id`, then the second request will be ignored and the
239  // first resource created and stored in the backend is returned.
240  // Empty `request_id` fields are ignored.
241  //
242  // It is responsibility of the client to ensure uniqueness of the
243  // `request_id` strings.
244  //
245  // `request_id` strings are limited to 64 characters.
246  string request_id = 3;
247}
248
249// Request message for `UpdateConfig()` method.
250message UpdateConfigRequest {
251  // The name of the RuntimeConfig resource to update, in the format:
252  //
253  // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]`
254  string name = 1;
255
256  // The config resource to update.
257  RuntimeConfig config = 2;
258}
259
260// Request for the `DeleteConfig()` method.
261message DeleteConfigRequest {
262  // The RuntimeConfig resource to delete, in the format:
263  //
264  // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]`
265  string name = 1;
266}
267
268// Request for the `ListVariables()` method.
269message ListVariablesRequest {
270  // The path to the RuntimeConfig resource for which you want to list
271  // variables. The configuration must exist beforehand; the path must by in the
272  // format:
273  //
274  // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]`
275  string parent = 1;
276
277  // Filters variables by matching the specified filter. For example:
278  //
279  // `projects/example-project/config/[CONFIG_NAME]/variables/example-variable`.
280  string filter = 2;
281
282  // Specifies the number of results to return per page. If there are fewer
283  // elements than the specified number, returns all elements.
284  int32 page_size = 3;
285
286  // Specifies a page token to use. Set `pageToken` to a `nextPageToken`
287  // returned by a previous list request to get the next page of results.
288  string page_token = 4;
289
290  // The flag indicates whether the user wants to return values of variables.
291  // If true, then only those variables that user has IAM GetVariable permission
292  // will be returned along with their values.
293  bool return_values = 5;
294}
295
296// Response for the `ListVariables()` method.
297message ListVariablesResponse {
298  // A list of variables and their values. The order of returned variable
299  // objects is arbitrary.
300  repeated Variable variables = 1;
301
302  // This token allows you to get the next page of results for list requests.
303  // If the number of results is larger than `pageSize`, use the `nextPageToken`
304  // as a value for the query parameter `pageToken` in the next list request.
305  // Subsequent list requests will have their own `nextPageToken` to continue
306  // paging through the results
307  string next_page_token = 2;
308}
309
310// Request for the `WatchVariable()` method.
311message WatchVariableRequest {
312  // The name of the variable to watch, in the format:
313  //
314  // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]`
315  string name = 1;
316
317  // If specified, checks the current timestamp of the variable and if the
318  // current timestamp is newer than `newerThan` timestamp, the method returns
319  // immediately.
320  //
321  // If not specified or the variable has an older timestamp, the watcher waits
322  // for a the value to change before returning.
323  google.protobuf.Timestamp newer_than = 4;
324}
325
326// Request for the `GetVariable()` method.
327message GetVariableRequest {
328  // The name of the variable to return, in the format:
329  //
330  // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIBLE_NAME]`
331  string name = 1;
332}
333
334// Request for the `CreateVariable()` method.
335message CreateVariableRequest {
336  // The path to the RutimeConfig resource that this variable should belong to.
337  // The configuration must exist beforehand; the path must by in the format:
338  //
339  // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]`
340  string parent = 1;
341
342  // The variable to create.
343  Variable variable = 2;
344
345  // An optional but recommended unique `request_id`. If the server
346  // receives two `create()` requests  with the same
347  // `request_id`, then the second request will be ignored and the
348  // first resource created and stored in the backend is returned.
349  // Empty `request_id` fields are ignored.
350  //
351  // It is responsibility of the client to ensure uniqueness of the
352  // `request_id` strings.
353  //
354  // `request_id` strings are limited to 64 characters.
355  string request_id = 3;
356}
357
358// Request for the `UpdateVariable()` method.
359message UpdateVariableRequest {
360  // The name of the variable to update, in the format:
361  //
362  // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]`
363  string name = 1;
364
365  // The variable to update.
366  Variable variable = 2;
367}
368
369// Request for the `DeleteVariable()` method.
370message DeleteVariableRequest {
371  // The name of the variable to delete, in the format:
372  //
373  // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]`
374  string name = 1;
375
376  // Set to `true` to recursively delete multiple variables with the same
377  // prefix.
378  bool recursive = 2;
379}
380
381// Request for the `ListWaiters()` method.
382message ListWaitersRequest {
383  // The path to the configuration for which you want to get a list of waiters.
384  // The configuration must exist beforehand; the path must by in the format:
385  //
386  // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]`
387  string parent = 1;
388
389  // Specifies the number of results to return per page. If there are fewer
390  // elements than the specified number, returns all elements.
391  int32 page_size = 2;
392
393  // Specifies a page token to use. Set `pageToken` to a `nextPageToken`
394  // returned by a previous list request to get the next page of results.
395  string page_token = 3;
396}
397
398// Response for the `ListWaiters()` method.
399// Order of returned waiter objects is arbitrary.
400message ListWaitersResponse {
401  // Found waiters in the project.
402  repeated Waiter waiters = 1;
403
404  // This token allows you to get the next page of results for list requests.
405  // If the number of results is larger than `pageSize`, use the `nextPageToken`
406  // as a value for the query parameter `pageToken` in the next list request.
407  // Subsequent list requests will have their own `nextPageToken` to continue
408  // paging through the results
409  string next_page_token = 2;
410}
411
412// Request for the `GetWaiter()` method.
413message GetWaiterRequest {
414  // The fully-qualified name of the Waiter resource object to retrieve, in the
415  // format:
416  //
417  // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]`
418  string name = 1;
419}
420
421// Request message for `CreateWaiter()` method.
422message CreateWaiterRequest {
423  // The path to the configuration that will own the waiter.
424  // The configuration must exist beforehand; the path must by in the format:
425  //
426  // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]`.
427  string parent = 1;
428
429  // The Waiter resource to create.
430  Waiter waiter = 2;
431
432  // An optional but recommended unique `request_id`. If the server
433  // receives two `create()` requests  with the same
434  // `request_id`, then the second request will be ignored and the
435  // first resource created and stored in the backend is returned.
436  // Empty `request_id` fields are ignored.
437  //
438  // It is responsibility of the client to ensure uniqueness of the
439  // `request_id` strings.
440  //
441  // `request_id` strings are limited to 64 characters.
442  string request_id = 3;
443}
444
445// Request for the `DeleteWaiter()` method.
446message DeleteWaiterRequest {
447  // The Waiter resource to delete, in the format:
448  //
449  //  `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]`
450  string name = 1;
451}
452