service.proto 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. // Copyright 2022 Google LLC
  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.run.v2;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/launch_stage.proto";
  20. import "google/api/resource.proto";
  21. import "google/api/routing.proto";
  22. import "google/cloud/run/v2/condition.proto";
  23. import "google/cloud/run/v2/revision_template.proto";
  24. import "google/cloud/run/v2/traffic_target.proto";
  25. import "google/cloud/run/v2/vendor_settings.proto";
  26. import "google/iam/v1/iam_policy.proto";
  27. import "google/iam/v1/policy.proto";
  28. import "google/longrunning/operations.proto";
  29. import "google/protobuf/timestamp.proto";
  30. option go_package = "google.golang.org/genproto/googleapis/cloud/run/v2;run";
  31. option java_multiple_files = true;
  32. option java_outer_classname = "ServiceProto";
  33. option java_package = "com.google.cloud.run.v2";
  34. // Cloud Run Service Control Plane API
  35. service Services {
  36. option (google.api.default_host) = "run.googleapis.com";
  37. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  38. // Creates a new Service in a given project and location.
  39. rpc CreateService(CreateServiceRequest) returns (google.longrunning.Operation) {
  40. option (google.api.http) = {
  41. post: "/v2/{parent=projects/*/locations/*}/services"
  42. body: "service"
  43. };
  44. option (google.api.routing) = {
  45. routing_parameters {
  46. field: "parent"
  47. path_template: "projects/*/locations/{location=*}"
  48. }
  49. };
  50. option (google.api.method_signature) = "parent,service,service_id";
  51. option (google.longrunning.operation_info) = {
  52. response_type: "Service"
  53. metadata_type: "Service"
  54. };
  55. }
  56. // Gets information about a Service.
  57. rpc GetService(GetServiceRequest) returns (Service) {
  58. option (google.api.http) = {
  59. get: "/v2/{name=projects/*/locations/*/services/*}"
  60. };
  61. option (google.api.routing) = {
  62. routing_parameters {
  63. field: "name"
  64. path_template: "projects/*/locations/{location=*}/**"
  65. }
  66. };
  67. option (google.api.method_signature) = "name";
  68. }
  69. // Lists Services.
  70. rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {
  71. option (google.api.http) = {
  72. get: "/v2/{parent=projects/*/locations/*}/services"
  73. };
  74. option (google.api.routing) = {
  75. routing_parameters {
  76. field: "parent"
  77. path_template: "projects/*/locations/{location=*}"
  78. }
  79. };
  80. option (google.api.method_signature) = "parent";
  81. }
  82. // Updates a Service.
  83. rpc UpdateService(UpdateServiceRequest) returns (google.longrunning.Operation) {
  84. option (google.api.http) = {
  85. patch: "/v2/{service.name=projects/*/locations/*/services/*}"
  86. body: "service"
  87. };
  88. option (google.api.routing) = {
  89. routing_parameters {
  90. field: "service.name"
  91. path_template: "projects/*/locations/{location=*}/**"
  92. }
  93. };
  94. option (google.api.method_signature) = "service";
  95. option (google.longrunning.operation_info) = {
  96. response_type: "Service"
  97. metadata_type: "Service"
  98. };
  99. }
  100. // Deletes a Service.
  101. // This will cause the Service to stop serving traffic and will delete all
  102. // revisions.
  103. rpc DeleteService(DeleteServiceRequest) returns (google.longrunning.Operation) {
  104. option (google.api.http) = {
  105. delete: "/v2/{name=projects/*/locations/*/services/*}"
  106. };
  107. option (google.api.routing) = {
  108. routing_parameters {
  109. field: "name"
  110. path_template: "projects/*/locations/{location=*}/**"
  111. }
  112. };
  113. option (google.api.method_signature) = "name";
  114. option (google.longrunning.operation_info) = {
  115. response_type: "Service"
  116. metadata_type: "Service"
  117. };
  118. }
  119. // Gets the IAM Access Control policy currently in effect for the given
  120. // Cloud Run Service. This result does not include any inherited policies.
  121. rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
  122. option (google.api.http) = {
  123. get: "/v2/{resource=projects/*/locations/*/services/*}:getIamPolicy"
  124. };
  125. }
  126. // Sets the IAM Access control policy for the specified Service. Overwrites
  127. // any existing policy.
  128. rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
  129. option (google.api.http) = {
  130. post: "/v2/{resource=projects/*/locations/*/services/*}:setIamPolicy"
  131. body: "*"
  132. };
  133. }
  134. // Returns permissions that a caller has on the specified Project.
  135. //
  136. // There are no permissions required for making this API call.
  137. rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
  138. option (google.api.http) = {
  139. post: "/v2/{resource=projects/*/locations/*/services/*}:testIamPermissions"
  140. body: "*"
  141. };
  142. }
  143. }
  144. // Request message for creating a Service.
  145. message CreateServiceRequest {
  146. // Required. The location and project in which this service should be created.
  147. // Format: projects/{project}/locations/{location}, where {project} can be
  148. // project id or number. Only lowercase characters, digits, and hyphens.
  149. string parent = 1 [
  150. (google.api.field_behavior) = REQUIRED,
  151. (google.api.resource_reference) = {
  152. child_type: "run.googleapis.com/Service"
  153. }
  154. ];
  155. // Required. The Service instance to create.
  156. Service service = 2 [(google.api.field_behavior) = REQUIRED];
  157. // Required. The unique identifier for the Service. It must begin with letter,
  158. // and cannot end with hyphen; must contain fewer than 50 characters.
  159. // The name of the service becomes {parent}/services/{service_id}.
  160. string service_id = 3 [(google.api.field_behavior) = REQUIRED];
  161. // Indicates that the request should be validated and default values
  162. // populated, without persisting the request or creating any resources.
  163. bool validate_only = 4;
  164. }
  165. // Request message for updating a service.
  166. message UpdateServiceRequest {
  167. // Required. The Service to be updated.
  168. Service service = 1 [(google.api.field_behavior) = REQUIRED];
  169. // Indicates that the request should be validated and default values
  170. // populated, without persisting the request or updating any resources.
  171. bool validate_only = 3;
  172. // If set to true, and if the Service does not exist, it will create a new
  173. // one. Caller must have both create and update permissions for this call if
  174. // this is set to true.
  175. bool allow_missing = 4;
  176. }
  177. // Request message for retrieving a list of Services.
  178. message ListServicesRequest {
  179. // Required. The location and project to list resources on.
  180. // Location must be a valid GCP region, and cannot be the "-" wildcard.
  181. // Format: projects/{project}/locations/{location}, where {project} can be
  182. // project id or number.
  183. string parent = 1 [
  184. (google.api.field_behavior) = REQUIRED,
  185. (google.api.resource_reference) = {
  186. child_type: "run.googleapis.com/Service"
  187. }
  188. ];
  189. // Maximum number of Services to return in this call.
  190. int32 page_size = 2;
  191. // A page token received from a previous call to ListServices.
  192. // All other parameters must match.
  193. string page_token = 3;
  194. // If true, returns deleted (but unexpired) resources along with active ones.
  195. bool show_deleted = 4;
  196. }
  197. // Response message containing a list of Services.
  198. message ListServicesResponse {
  199. // The resulting list of Services.
  200. repeated Service services = 1;
  201. // A token indicating there are more items than page_size. Use it in the next
  202. // ListServices request to continue.
  203. string next_page_token = 2;
  204. }
  205. // Request message for obtaining a Service by its full name.
  206. message GetServiceRequest {
  207. // Required. The full name of the Service.
  208. // Format: projects/{project}/locations/{location}/services/{service}, where
  209. // {project} can be project id or number.
  210. string name = 1 [
  211. (google.api.field_behavior) = REQUIRED,
  212. (google.api.resource_reference) = {
  213. type: "run.googleapis.com/Service"
  214. }
  215. ];
  216. }
  217. // Request message to delete a Service by its full name.
  218. message DeleteServiceRequest {
  219. // Required. The full name of the Service.
  220. // Format: projects/{project}/locations/{location}/services/{service}, where
  221. // {project} can be project id or number.
  222. string name = 1 [
  223. (google.api.field_behavior) = REQUIRED,
  224. (google.api.resource_reference) = {
  225. type: "run.googleapis.com/Service"
  226. }
  227. ];
  228. // Indicates that the request should be validated without actually
  229. // deleting any resources.
  230. bool validate_only = 2;
  231. // A system-generated fingerprint for this version of the
  232. // resource. May be used to detect modification conflict during updates.
  233. string etag = 3;
  234. }
  235. // Service acts as a top-level container that manages a set of
  236. // configurations and revision templates which implement a network service.
  237. // Service exists to provide a singular abstraction which can be access
  238. // controlled, reasoned about, and which encapsulates software lifecycle
  239. // decisions such as rollout policy and team resource ownership.
  240. message Service {
  241. option (google.api.resource) = {
  242. type: "run.googleapis.com/Service"
  243. pattern: "projects/{project}/locations/{location}/services/{service}"
  244. style: DECLARATIVE_FRIENDLY
  245. };
  246. // The fully qualified name of this Service. In CreateServiceRequest, this
  247. // field is ignored, and instead composed from CreateServiceRequest.parent and
  248. // CreateServiceRequest.service_id.
  249. //
  250. // Format:
  251. // projects/{project}/locations/{location}/services/{service_id}
  252. string name = 1;
  253. // User-provided description of the Service. This field currently has a
  254. // 512-character limit.
  255. string description = 2;
  256. // Output only. Server assigned unique identifier for the trigger. The value is a UUID4
  257. // string and guaranteed to remain unchanged until the resource is deleted.
  258. string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  259. // Output only. A number that monotonically increases every time the user
  260. // modifies the desired state.
  261. // Please note that unlike v1, this is an int64 value. As with most Google
  262. // APIs, its JSON representation will be a `string` instead of an `integer`.
  263. int64 generation = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  264. // Map of string keys and values that can be used to organize and categorize
  265. // objects.
  266. // User-provided labels are shared with Google's billing system, so they can
  267. // be used to filter, or break down billing charges by team, component,
  268. // environment, state, etc. For more information, visit
  269. // https://cloud.google.com/resource-manager/docs/creating-managing-labels or
  270. // https://cloud.google.com/run/docs/configuring/labels
  271. // Cloud Run will populate some labels with 'run.googleapis.com' or
  272. // 'serving.knative.dev' namespaces. Those labels are read-only, and user
  273. // changes will not be preserved.
  274. map<string, string> labels = 5;
  275. // Unstructured key value map that may be set by external tools to store and
  276. // arbitrary metadata. They are not queryable and should be preserved
  277. // when modifying objects. Cloud Run will populate some annotations using
  278. // 'run.googleapis.com' or 'serving.knative.dev' namespaces. This field
  279. // follows Kubernetes annotations' namespacing, limits, and rules. More info:
  280. // https://kubernetes.io/docs/user-guide/annotations
  281. map<string, string> annotations = 6;
  282. // Output only. The creation time.
  283. google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  284. // Output only. The last-modified time.
  285. google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  286. // Output only. The deletion time.
  287. google.protobuf.Timestamp delete_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  288. // Output only. For a deleted resource, the time after which it will be
  289. // permamently deleted.
  290. google.protobuf.Timestamp expire_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  291. // Output only. Email address of the authenticated creator.
  292. string creator = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
  293. // Output only. Email address of the last authenticated modifier.
  294. string last_modifier = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  295. // Arbitrary identifier for the API client.
  296. string client = 13;
  297. // Arbitrary version identifier for the API client.
  298. string client_version = 14;
  299. // Provides the ingress settings for this Service. On output, returns the
  300. // currently observed ingress settings, or INGRESS_TRAFFIC_UNSPECIFIED if no
  301. // revision is active.
  302. IngressTraffic ingress = 15;
  303. // The launch stage as defined by [Google Cloud Platform
  304. // Launch Stages](https://cloud.google.com/terms/launch-stages).
  305. // Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA
  306. // is assumed.
  307. google.api.LaunchStage launch_stage = 16;
  308. // Settings for the Binary Authorization feature.
  309. BinaryAuthorization binary_authorization = 17;
  310. // Required. The template used to create revisions for this Service.
  311. RevisionTemplate template = 18 [(google.api.field_behavior) = REQUIRED];
  312. // Specifies how to distribute traffic over a collection of Revisions
  313. // belonging to the Service. If traffic is empty or not provided, defaults to
  314. // 100% traffic to the latest `Ready` Revision.
  315. repeated TrafficTarget traffic = 19;
  316. // Output only. The generation of this Service currently serving traffic. See comments in
  317. // `reconciling` for additional information on reconciliation process in Cloud
  318. // Run.
  319. // Please note that unlike v1, this is an int64 value. As with most Google
  320. // APIs, its JSON representation will be a `string` instead of an `integer`.
  321. int64 observed_generation = 30 [(google.api.field_behavior) = OUTPUT_ONLY];
  322. // Output only. The Condition of this Service, containing its readiness status, and
  323. // detailed error information in case it did not reach a serving state. See
  324. // comments in `reconciling` for additional information on reconciliation
  325. // process in Cloud Run.
  326. Condition terminal_condition = 31 [(google.api.field_behavior) = OUTPUT_ONLY];
  327. // Output only. The Conditions of all other associated sub-resources. They contain
  328. // additional diagnostics information in case the Service does not reach its
  329. // Serving state. See comments in `reconciling` for additional information on
  330. // reconciliation process in Cloud Run.
  331. repeated Condition conditions = 32 [(google.api.field_behavior) = OUTPUT_ONLY];
  332. // Output only. Name of the latest revision that is serving traffic. See comments in
  333. // `reconciling` for additional information on reconciliation process in Cloud
  334. // Run.
  335. string latest_ready_revision = 33 [
  336. (google.api.field_behavior) = OUTPUT_ONLY,
  337. (google.api.resource_reference) = {
  338. type: "run.googleapis.com/Revision"
  339. }
  340. ];
  341. // Output only. Name of the last created revision. See comments in `reconciling` for
  342. // additional information on reconciliation process in Cloud Run.
  343. string latest_created_revision = 34 [
  344. (google.api.field_behavior) = OUTPUT_ONLY,
  345. (google.api.resource_reference) = {
  346. type: "run.googleapis.com/Revision"
  347. }
  348. ];
  349. // Output only. Detailed status information for corresponding traffic targets. See comments
  350. // in `reconciling` for additional information on reconciliation process in
  351. // Cloud Run.
  352. repeated TrafficTargetStatus traffic_statuses = 35 [(google.api.field_behavior) = OUTPUT_ONLY];
  353. // Output only. The main URI in which this Service is serving traffic.
  354. string uri = 36 [(google.api.field_behavior) = OUTPUT_ONLY];
  355. // Output only. Returns true if the Service is currently being acted upon by the system to
  356. // bring it into the desired state.
  357. //
  358. // When a new Service is created, or an existing one is updated, Cloud Run
  359. // will asynchronously perform all necessary steps to bring the Service to the
  360. // desired serving state. This process is called reconciliation.
  361. // While reconciliation is in process, `observed_generation`,
  362. // `latest_ready_revison`, `traffic_statuses`, and `uri` will have transient
  363. // values that might mismatch the intended state: Once reconciliation is over
  364. // (and this field is false), there are two possible outcomes: reconciliation
  365. // succeeded and the serving state matches the Service, or there was an error,
  366. // and reconciliation failed. This state can be found in
  367. // `terminal_condition.state`.
  368. //
  369. // If reconciliation succeeded, the following fields will match: `traffic` and
  370. // `traffic_statuses`, `observed_generation` and `generation`,
  371. // `latest_ready_revision` and `latest_created_revision`.
  372. //
  373. // If reconciliation failed, `traffic_statuses`, `observed_generation`, and
  374. // `latest_ready_revision` will have the state of the last serving revision,
  375. // or empty for newly created Services. Additional information on the failure
  376. // can be found in `terminal_condition` and `conditions`.
  377. bool reconciling = 98 [(google.api.field_behavior) = OUTPUT_ONLY];
  378. // Output only. A system-generated fingerprint for this version of the
  379. // resource. May be used to detect modification conflict during updates.
  380. string etag = 99 [(google.api.field_behavior) = OUTPUT_ONLY];
  381. }