runtimeconfig.proto 16 KB

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