runtimeconfig.proto 14 KB

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