execution.proto 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  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/cloud/run/v2/condition.proto";
  22. import "google/cloud/run/v2/task_template.proto";
  23. import "google/longrunning/operations.proto";
  24. import "google/protobuf/timestamp.proto";
  25. option go_package = "google.golang.org/genproto/googleapis/cloud/run/v2;run";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "ExecutionProto";
  28. option java_package = "com.google.cloud.run.v2";
  29. // Cloud Run Execution Control Plane API.
  30. service Executions {
  31. option (google.api.default_host) = "run.googleapis.com";
  32. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  33. // Gets information about an Execution.
  34. rpc GetExecution(GetExecutionRequest) returns (Execution) {
  35. option (google.api.http) = {
  36. get: "/v2/{name=projects/*/locations/*/jobs/*/executions/*}"
  37. };
  38. option (google.api.method_signature) = "name";
  39. }
  40. // Lists Executions from a Job.
  41. rpc ListExecutions(ListExecutionsRequest) returns (ListExecutionsResponse) {
  42. option (google.api.http) = {
  43. get: "/v2/{parent=projects/*/locations/*/jobs/*}/executions"
  44. };
  45. option (google.api.method_signature) = "parent";
  46. }
  47. // Deletes an Execution.
  48. rpc DeleteExecution(DeleteExecutionRequest) returns (google.longrunning.Operation) {
  49. option (google.api.http) = {
  50. delete: "/v2/{name=projects/*/locations/*/jobs/*/executions/*}"
  51. };
  52. option (google.api.method_signature) = "name";
  53. option (google.longrunning.operation_info) = {
  54. response_type: "Execution"
  55. metadata_type: "Execution"
  56. };
  57. }
  58. }
  59. // Request message for obtaining a Execution by its full name.
  60. message GetExecutionRequest {
  61. // Required. The full name of the Execution.
  62. // Format:
  63. // projects/{project}/locations/{location}/jobs/{job}/executions/{execution},
  64. // where {project} can be project id or number.
  65. string name = 1 [
  66. (google.api.field_behavior) = REQUIRED,
  67. (google.api.resource_reference) = {
  68. type: "run.googleapis.com/Execution"
  69. }
  70. ];
  71. }
  72. // Request message for retrieving a list of Executions.
  73. message ListExecutionsRequest {
  74. // Required. The Execution from which the Executions should be listed.
  75. // To list all Executions across Jobs, use "-" instead of Job name.
  76. // Format: projects/{project}/locations/{location}/jobs/{job}, where {project}
  77. // can be project id or number.
  78. string parent = 1 [
  79. (google.api.field_behavior) = REQUIRED,
  80. (google.api.resource_reference) = {
  81. child_type: "run.googleapis.com/Execution"
  82. }
  83. ];
  84. // Maximum number of Executions to return in this call.
  85. int32 page_size = 2;
  86. // A page token received from a previous call to ListExecutions.
  87. // All other parameters must match.
  88. string page_token = 3;
  89. // If true, returns deleted (but unexpired) resources along with active ones.
  90. bool show_deleted = 4;
  91. }
  92. // Response message containing a list of Executions.
  93. message ListExecutionsResponse {
  94. // The resulting list of Executions.
  95. repeated Execution executions = 1;
  96. // A token indicating there are more items than page_size. Use it in the next
  97. // ListExecutions request to continue.
  98. string next_page_token = 2;
  99. }
  100. // Request message for deleting an Execution.
  101. message DeleteExecutionRequest {
  102. // Required. The name of the Execution to delete.
  103. // Format:
  104. // projects/{project}/locations/{location}/jobs/{job}/executions/{execution},
  105. // where {project} can be project id or number.
  106. string name = 1 [
  107. (google.api.field_behavior) = REQUIRED,
  108. (google.api.resource_reference) = {
  109. type: "run.googleapis.com/Execution"
  110. }
  111. ];
  112. // Indicates that the request should be validated without actually
  113. // deleting any resources.
  114. bool validate_only = 2;
  115. // A system-generated fingerprint for this version of the resource.
  116. // This may be used to detect modification conflict during updates.
  117. string etag = 3;
  118. }
  119. // Execution represents the configuration of a single execution. A execution an
  120. // immutable resource that references a container image which is run to
  121. // completion.
  122. message Execution {
  123. option (google.api.resource) = {
  124. type: "run.googleapis.com/Execution"
  125. pattern: "projects/{project}/locations/{location}/jobs/{job}/executions/{execution}"
  126. style: DECLARATIVE_FRIENDLY
  127. };
  128. // Output only. The unique name of this Execution.
  129. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  130. // Output only. Server assigned unique identifier for the Execution. The value is a UUID4
  131. // string and guaranteed to remain unchanged until the resource is deleted.
  132. string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  133. // Output only. A number that monotonically increases every time the user
  134. // modifies the desired state.
  135. int64 generation = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  136. // KRM-style labels for the resource.
  137. // User-provided labels are shared with Google's billing system, so they can
  138. // be used to filter, or break down billing charges by team, component,
  139. // environment, state, etc. For more information, visit
  140. // https://cloud.google.com/resource-manager/docs/creating-managing-labels or
  141. // https://cloud.google.com/run/docs/configuring/labels
  142. // Cloud Run will populate some labels with 'run.googleapis.com' or
  143. // 'serving.knative.dev' namespaces. Those labels are read-only, and user
  144. // changes will not be preserved.
  145. map<string, string> labels = 4;
  146. // KRM-style annotations for the resource.
  147. map<string, string> annotations = 5;
  148. // Output only. Represents time when the execution was acknowledged by the execution
  149. // controller. It is not guaranteed to be set in happens-before order across
  150. // separate operations.
  151. google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  152. // Output only. Represents time when the execution started to run.
  153. // It is not guaranteed to be set in happens-before order across separate
  154. // operations.
  155. google.protobuf.Timestamp start_time = 22 [(google.api.field_behavior) = OUTPUT_ONLY];
  156. // Output only. Represents time when the execution was completed. It is not guaranteed to
  157. // be set in happens-before order across separate operations.
  158. google.protobuf.Timestamp completion_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  159. // Output only. The last-modified time.
  160. google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  161. // Output only. For a deleted resource, the deletion time. It is only
  162. // populated as a response to a Delete request.
  163. google.protobuf.Timestamp delete_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  164. // Output only. For a deleted resource, the time after which it will be
  165. // permamently deleted. It is only populated as a response to a Delete
  166. // request.
  167. google.protobuf.Timestamp expire_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  168. // Set the launch stage to a preview stage on write to allow use of preview
  169. // features in that stage. On read, describes whether the resource uses
  170. // preview features. Launch Stages are defined at [Google Cloud Platform
  171. // Launch Stages](https://cloud.google.com/terms/launch-stages).
  172. google.api.LaunchStage launch_stage = 11;
  173. // Output only. The name of the parent Job.
  174. string job = 12 [
  175. (google.api.field_behavior) = OUTPUT_ONLY,
  176. (google.api.resource_reference) = {
  177. type: "run.googleapis.com/Job"
  178. }
  179. ];
  180. // Output only. Specifies the maximum desired number of tasks the execution should
  181. // run at any given time. Must be <= task_count. The actual number of
  182. // tasks running in steady state will be less than this number when
  183. // ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when
  184. // the work left to do is less than max parallelism. More info:
  185. // https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
  186. int32 parallelism = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  187. // Output only. Specifies the desired number of tasks the execution should run.
  188. // Setting to 1 means that parallelism is limited to 1 and the success of
  189. // that task signals the success of the execution.
  190. // More info:
  191. // https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
  192. int32 task_count = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
  193. // Output only. The template used to create tasks for this execution.
  194. TaskTemplate template = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
  195. // Output only. Indicates whether the resource's reconciliation is still in progress.
  196. // See comments in `Job.reconciling` for additional information on
  197. // reconciliation process in Cloud Run.
  198. bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
  199. // Output only. The Condition of this Execution, containing its readiness status, and
  200. // detailed error information in case it did not reach the desired state.
  201. repeated Condition conditions = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
  202. // Output only. The generation of this Execution. See comments in `reconciling` for
  203. // additional information on reconciliation process in Cloud Run.
  204. int64 observed_generation = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
  205. // Output only. The number of actively running tasks.
  206. int32 running_count = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
  207. // Output only. The number of tasks which reached phase Succeeded.
  208. int32 succeeded_count = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
  209. // Output only. The number of tasks which reached phase Failed.
  210. int32 failed_count = 21 [(google.api.field_behavior) = OUTPUT_ONLY];
  211. // Output only. A system-generated fingerprint for this version of the
  212. // resource. May be used to detect modification conflict during updates.
  213. string etag = 99 [(google.api.field_behavior) = OUTPUT_ONLY];
  214. }