revision.proto 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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/k8s.min.proto";
  24. import "google/cloud/run/v2/vendor_settings.proto";
  25. import "google/longrunning/operations.proto";
  26. import "google/protobuf/duration.proto";
  27. import "google/protobuf/timestamp.proto";
  28. option go_package = "google.golang.org/genproto/googleapis/cloud/run/v2;run";
  29. option java_multiple_files = true;
  30. option java_outer_classname = "RevisionProto";
  31. option java_package = "com.google.cloud.run.v2";
  32. // Cloud Run Revision Control Plane API.
  33. service Revisions {
  34. option (google.api.default_host) = "run.googleapis.com";
  35. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  36. // Gets information about a Revision.
  37. rpc GetRevision(GetRevisionRequest) returns (Revision) {
  38. option (google.api.http) = {
  39. get: "/v2/{name=projects/*/locations/*/services/*/revisions/*}"
  40. };
  41. option (google.api.routing) = {
  42. routing_parameters {
  43. field: "name"
  44. path_template: "projects/*/locations/{location=*}/**"
  45. }
  46. };
  47. option (google.api.method_signature) = "name";
  48. }
  49. // Lists Revisions from a given Service, or from a given location.
  50. rpc ListRevisions(ListRevisionsRequest) returns (ListRevisionsResponse) {
  51. option (google.api.http) = {
  52. get: "/v2/{parent=projects/*/locations/*/services/*}/revisions"
  53. };
  54. option (google.api.routing) = {
  55. routing_parameters {
  56. field: "parent"
  57. path_template: "projects/*/locations/{location=*}/**"
  58. }
  59. };
  60. option (google.api.method_signature) = "parent";
  61. }
  62. // Deletes a Revision.
  63. rpc DeleteRevision(DeleteRevisionRequest) returns (google.longrunning.Operation) {
  64. option (google.api.http) = {
  65. delete: "/v2/{name=projects/*/locations/*/services/*/revisions/*}"
  66. };
  67. option (google.api.routing) = {
  68. routing_parameters {
  69. field: "name"
  70. path_template: "projects/*/locations/{location=*}/**"
  71. }
  72. };
  73. option (google.api.method_signature) = "name";
  74. option (google.longrunning.operation_info) = {
  75. response_type: "Revision"
  76. metadata_type: "Revision"
  77. };
  78. }
  79. }
  80. // Request message for obtaining a Revision by its full name.
  81. message GetRevisionRequest {
  82. // Required. The full name of the Revision.
  83. // Format:
  84. // projects/{project}/locations/{location}/services/{service}/revisions/{revision}
  85. string name = 1 [
  86. (google.api.field_behavior) = REQUIRED,
  87. (google.api.resource_reference) = {
  88. type: "run.googleapis.com/Revision"
  89. }
  90. ];
  91. }
  92. // Request message for retrieving a list of Revisions.
  93. message ListRevisionsRequest {
  94. // Required. The Service from which the Revisions should be listed.
  95. // To list all Revisions across Services, use "-" instead of Service name.
  96. // Format:
  97. // projects/{project}/locations/{location}/services/{service}
  98. string parent = 1 [
  99. (google.api.field_behavior) = REQUIRED,
  100. (google.api.resource_reference) = {
  101. child_type: "run.googleapis.com/Revision"
  102. }
  103. ];
  104. // Maximum number of revisions to return in this call.
  105. int32 page_size = 2;
  106. // A page token received from a previous call to ListRevisions.
  107. // All other parameters must match.
  108. string page_token = 3;
  109. // If true, returns deleted (but unexpired) resources along with active ones.
  110. bool show_deleted = 4;
  111. }
  112. // Response message containing a list of Revisions.
  113. message ListRevisionsResponse {
  114. // The resulting list of Revisions.
  115. repeated Revision revisions = 1;
  116. // A token indicating there are more items than page_size. Use it in the next
  117. // ListRevisions request to continue.
  118. string next_page_token = 2;
  119. }
  120. // Request message for deleting a retired Revision.
  121. // Revision lifecycle is usually managed by making changes to the parent
  122. // Service. Only retired revisions can be deleted with this API.
  123. message DeleteRevisionRequest {
  124. // Required. The name of the Revision to delete.
  125. // Format:
  126. // projects/{project}/locations/{location}/services/{service}/revisions/{revision}
  127. string name = 1 [
  128. (google.api.field_behavior) = REQUIRED,
  129. (google.api.resource_reference) = {
  130. type: "run.googleapis.com/Revision"
  131. }
  132. ];
  133. // Indicates that the request should be validated without actually
  134. // deleting any resources.
  135. bool validate_only = 2;
  136. // A system-generated fingerprint for this version of the
  137. // resource. This may be used to detect modification conflict during updates.
  138. string etag = 3;
  139. }
  140. // A Revision is an immutable snapshot of code and configuration. A Revision
  141. // references a container image. Revisions are only created by updates to its
  142. // parent Service.
  143. message Revision {
  144. option (google.api.resource) = {
  145. type: "run.googleapis.com/Revision"
  146. pattern: "projects/{project}/locations/{location}/services/{service}/revisions/{revision}"
  147. style: DECLARATIVE_FRIENDLY
  148. };
  149. // Output only. The unique name of this Revision.
  150. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  151. // Output only. Server assigned unique identifier for the Revision. The value is a UUID4
  152. // string and guaranteed to remain unchanged until the resource is deleted.
  153. string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  154. // Output only. A number that monotonically increases every time the user
  155. // modifies the desired state.
  156. int64 generation = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  157. // KRM-style labels for the resource.
  158. // User-provided labels are shared with Google's billing system, so they can
  159. // be used to filter, or break down billing charges by team, component,
  160. // environment, state, etc. For more information, visit
  161. // https://cloud.google.com/resource-manager/docs/creating-managing-labels or
  162. // https://cloud.google.com/run/docs/configuring/labels
  163. // Cloud Run will populate some labels with 'run.googleapis.com' or
  164. // 'serving.knative.dev' namespaces. Those labels are read-only, and user
  165. // changes will not be preserved.
  166. map<string, string> labels = 4;
  167. // KRM-style annotations for the resource.
  168. map<string, string> annotations = 5;
  169. // Output only. The creation time.
  170. google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  171. // Output only. The last-modified time.
  172. google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  173. // Output only. For a deleted resource, the deletion time. It is only
  174. // populated as a response to a Delete request.
  175. google.protobuf.Timestamp delete_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  176. // Output only. For a deleted resource, the time after which it will be
  177. // permamently deleted. It is only populated as a response to a Delete
  178. // request.
  179. google.protobuf.Timestamp expire_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  180. // Set the launch stage to a preview stage on write to allow use of preview
  181. // features in that stage. On read, describes whether the resource uses
  182. // preview features. Launch Stages are defined at [Google Cloud Platform
  183. // Launch Stages](https://cloud.google.com/terms/launch-stages).
  184. google.api.LaunchStage launch_stage = 10;
  185. // Output only. The name of the parent service.
  186. string service = 11 [
  187. (google.api.field_behavior) = OUTPUT_ONLY,
  188. (google.api.resource_reference) = {
  189. type: "run.googleapis.com/Service"
  190. }
  191. ];
  192. // Scaling settings for this revision.
  193. RevisionScaling scaling = 12;
  194. // VPC Access configuration for this Revision. For more information, visit
  195. // https://cloud.google.com/run/docs/configuring/connecting-vpc.
  196. VpcAccess vpc_access = 13;
  197. // Sets the maximum number of requests that each serving instance can receive.
  198. int32 max_instance_request_concurrency = 34;
  199. // Max allowed time for an instance to respond to a request.
  200. google.protobuf.Duration timeout = 15;
  201. // Email address of the IAM service account associated with the revision of
  202. // the service. The service account represents the identity of the running
  203. // revision, and determines what permissions the revision has.
  204. string service_account = 16;
  205. // Holds the single container that defines the unit of execution for this
  206. // Revision.
  207. repeated Container containers = 17;
  208. // A list of Volumes to make available to containers.
  209. repeated Volume volumes = 18;
  210. // The execution environment being used to host this Revision.
  211. ExecutionEnvironment execution_environment = 20;
  212. // A reference to a customer managed encryption key (CMEK) to use to encrypt
  213. // this container image. For more information, go to
  214. // https://cloud.google.com/run/docs/securing/using-cmek
  215. string encryption_key = 21 [(google.api.resource_reference) = {
  216. type: "cloudkms.googleapis.com/CryptoKey"
  217. }];
  218. // Output only. Indicates whether the resource's reconciliation is still in progress.
  219. // See comments in `Service.reconciling` for additional information on
  220. // reconciliation process in Cloud Run.
  221. bool reconciling = 30 [(google.api.field_behavior) = OUTPUT_ONLY];
  222. // Output only. The Condition of this Revision, containing its readiness status, and
  223. // detailed error information in case it did not reach a serving state.
  224. repeated Condition conditions = 31 [(google.api.field_behavior) = OUTPUT_ONLY];
  225. // Output only. The generation of this Revision currently serving traffic. See comments in
  226. // `reconciling` for additional information on reconciliation process in Cloud
  227. // Run.
  228. int64 observed_generation = 32 [(google.api.field_behavior) = OUTPUT_ONLY];
  229. // Output only. The Google Console URI to obtain logs for the Revision.
  230. string log_uri = 33 [(google.api.field_behavior) = OUTPUT_ONLY];
  231. // Output only. A system-generated fingerprint for this version of the
  232. // resource. May be used to detect modification conflict during updates.
  233. string etag = 99 [(google.api.field_behavior) = OUTPUT_ONLY];
  234. }