xref: /aosp_15_r20/external/googleapis/google/cloud/run/v2/execution.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 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
15syntax = "proto3";
16
17package google.cloud.run.v2;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/launch_stage.proto";
23import "google/api/resource.proto";
24import "google/cloud/run/v2/condition.proto";
25import "google/cloud/run/v2/task_template.proto";
26import "google/longrunning/operations.proto";
27import "google/protobuf/timestamp.proto";
28
29option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb";
30option java_multiple_files = true;
31option java_outer_classname = "ExecutionProto";
32option java_package = "com.google.cloud.run.v2";
33
34// Cloud Run Execution Control Plane API.
35service Executions {
36  option (google.api.default_host) = "run.googleapis.com";
37  option (google.api.oauth_scopes) =
38      "https://www.googleapis.com/auth/cloud-platform";
39
40  // Gets information about an Execution.
41  rpc GetExecution(GetExecutionRequest) returns (Execution) {
42    option (google.api.http) = {
43      get: "/v2/{name=projects/*/locations/*/jobs/*/executions/*}"
44    };
45    option (google.api.method_signature) = "name";
46  }
47
48  // Lists Executions from a Job.
49  rpc ListExecutions(ListExecutionsRequest) returns (ListExecutionsResponse) {
50    option (google.api.http) = {
51      get: "/v2/{parent=projects/*/locations/*/jobs/*}/executions"
52    };
53    option (google.api.method_signature) = "parent";
54  }
55
56  // Deletes an Execution.
57  rpc DeleteExecution(DeleteExecutionRequest)
58      returns (google.longrunning.Operation) {
59    option (google.api.http) = {
60      delete: "/v2/{name=projects/*/locations/*/jobs/*/executions/*}"
61    };
62    option (google.api.method_signature) = "name";
63    option (google.longrunning.operation_info) = {
64      response_type: "Execution"
65      metadata_type: "Execution"
66    };
67  }
68
69  // Cancels an Execution.
70  rpc CancelExecution(CancelExecutionRequest)
71      returns (google.longrunning.Operation) {
72    option (google.api.http) = {
73      post: "/v2/{name=projects/*/locations/*/jobs/*/executions/*}:cancel"
74      body: "*"
75    };
76    option (google.api.method_signature) = "name";
77    option (google.longrunning.operation_info) = {
78      response_type: "Execution"
79      metadata_type: "Execution"
80    };
81  }
82}
83
84// Request message for obtaining a Execution by its full name.
85message GetExecutionRequest {
86  // Required. The full name of the Execution.
87  // Format:
88  // `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`,
89  // where `{project}` can be project id or number.
90  string name = 1 [
91    (google.api.field_behavior) = REQUIRED,
92    (google.api.resource_reference) = { type: "run.googleapis.com/Execution" }
93  ];
94}
95
96// Request message for retrieving a list of Executions.
97message ListExecutionsRequest {
98  // Required. The Execution from which the Executions should be listed.
99  // To list all Executions across Jobs, use "-" instead of Job name.
100  // Format: `projects/{project}/locations/{location}/jobs/{job}`, where
101  // `{project}` can be project id or number.
102  string parent = 1 [
103    (google.api.field_behavior) = REQUIRED,
104    (google.api.resource_reference) = {
105      child_type: "run.googleapis.com/Execution"
106    }
107  ];
108
109  // Maximum number of Executions to return in this call.
110  int32 page_size = 2;
111
112  // A page token received from a previous call to ListExecutions.
113  // All other parameters must match.
114  string page_token = 3;
115
116  // If true, returns deleted (but unexpired) resources along with active ones.
117  bool show_deleted = 4;
118}
119
120// Response message containing a list of Executions.
121message ListExecutionsResponse {
122  // The resulting list of Executions.
123  repeated Execution executions = 1;
124
125  // A token indicating there are more items than page_size. Use it in the next
126  // ListExecutions request to continue.
127  string next_page_token = 2;
128}
129
130// Request message for deleting an Execution.
131message DeleteExecutionRequest {
132  // Required. The name of the Execution to delete.
133  // Format:
134  // `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`,
135  // where `{project}` can be project id or number.
136  string name = 1 [
137    (google.api.field_behavior) = REQUIRED,
138    (google.api.resource_reference) = { type: "run.googleapis.com/Execution" }
139  ];
140
141  // Indicates that the request should be validated without actually
142  // deleting any resources.
143  bool validate_only = 2;
144
145  // A system-generated fingerprint for this version of the resource.
146  // This may be used to detect modification conflict during updates.
147  string etag = 3;
148}
149
150// Request message for deleting an Execution.
151message CancelExecutionRequest {
152  // Required. The name of the Execution to cancel.
153  // Format:
154  // `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`,
155  // where `{project}` can be project id or number.
156  string name = 1 [
157    (google.api.field_behavior) = REQUIRED,
158    (google.api.resource_reference) = { type: "run.googleapis.com/Execution" }
159  ];
160
161  // Indicates that the request should be validated without actually
162  // cancelling any resources.
163  bool validate_only = 2;
164
165  // A system-generated fingerprint for this version of the resource.
166  // This may be used to detect modification conflict during updates.
167  string etag = 3;
168}
169
170// Execution represents the configuration of a single execution. A execution an
171// immutable resource that references a container image which is run to
172// completion.
173message Execution {
174  option (google.api.resource) = {
175    type: "run.googleapis.com/Execution"
176    pattern: "projects/{project}/locations/{location}/jobs/{job}/executions/{execution}"
177    style: DECLARATIVE_FRIENDLY
178  };
179
180  // Output only. The unique name of this Execution.
181  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
182
183  // Output only. Server assigned unique identifier for the Execution. The value
184  // is a UUID4 string and guaranteed to remain unchanged until the resource is
185  // deleted.
186  string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
187
188  // Output only. A number that monotonically increases every time the user
189  // modifies the desired state.
190  int64 generation = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
191
192  // Output only. Unstructured key value map that can be used to organize and
193  // categorize objects. User-provided labels are shared with Google's billing
194  // system, so they can be used to filter, or break down billing charges by
195  // team, component, environment, state, etc. For more information, visit
196  // https://cloud.google.com/resource-manager/docs/creating-managing-labels or
197  // https://cloud.google.com/run/docs/configuring/labels
198  map<string, string> labels = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
199
200  // Output only. Unstructured key value map that may
201  // be set by external tools to store and arbitrary metadata.
202  // They are not queryable and should be preserved
203  // when modifying objects.
204  map<string, string> annotations = 5
205      [(google.api.field_behavior) = OUTPUT_ONLY];
206
207  // Output only. Represents time when the execution was acknowledged by the
208  // execution controller. It is not guaranteed to be set in happens-before
209  // order across separate operations.
210  google.protobuf.Timestamp create_time = 6
211      [(google.api.field_behavior) = OUTPUT_ONLY];
212
213  // Output only. Represents time when the execution started to run.
214  // It is not guaranteed to be set in happens-before order across separate
215  // operations.
216  google.protobuf.Timestamp start_time = 22
217      [(google.api.field_behavior) = OUTPUT_ONLY];
218
219  // Output only. Represents time when the execution was completed. It is not
220  // guaranteed to be set in happens-before order across separate operations.
221  google.protobuf.Timestamp completion_time = 7
222      [(google.api.field_behavior) = OUTPUT_ONLY];
223
224  // Output only. The last-modified time.
225  google.protobuf.Timestamp update_time = 8
226      [(google.api.field_behavior) = OUTPUT_ONLY];
227
228  // Output only. For a deleted resource, the deletion time. It is only
229  // populated as a response to a Delete request.
230  google.protobuf.Timestamp delete_time = 9
231      [(google.api.field_behavior) = OUTPUT_ONLY];
232
233  // Output only. For a deleted resource, the time after which it will be
234  // permamently deleted. It is only populated as a response to a Delete
235  // request.
236  google.protobuf.Timestamp expire_time = 10
237      [(google.api.field_behavior) = OUTPUT_ONLY];
238
239  // The least stable launch stage needed to create this resource, as defined by
240  // [Google Cloud Platform Launch
241  // Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports
242  // `ALPHA`, `BETA`, and `GA`.
243  // <p>Note that this value might not be what was used
244  // as input. For example, if ALPHA was provided as input in the parent
245  // resource, but only BETA and GA-level features are were, this field will be
246  // BETA.
247  google.api.LaunchStage launch_stage = 11;
248
249  // Output only. The name of the parent Job.
250  string job = 12 [
251    (google.api.field_behavior) = OUTPUT_ONLY,
252    (google.api.resource_reference) = { type: "run.googleapis.com/Job" }
253  ];
254
255  // Output only. Specifies the maximum desired number of tasks the execution
256  // should run at any given time. Must be <= task_count. The actual number of
257  // tasks running in steady state will be less than this number when
258  // ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when
259  // the work left to do is less than max parallelism.
260  int32 parallelism = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
261
262  // Output only. Specifies the desired number of tasks the execution should
263  // run. Setting to 1 means that parallelism is limited to 1 and the success of
264  // that task signals the success of the execution.
265  int32 task_count = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
266
267  // Output only. The template used to create tasks for this execution.
268  TaskTemplate template = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
269
270  // Output only. Indicates whether the resource's reconciliation is still in
271  // progress. See comments in `Job.reconciling` for additional information on
272  // reconciliation process in Cloud Run.
273  bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
274
275  // Output only. The Condition of this Execution, containing its readiness
276  // status, and detailed error information in case it did not reach the desired
277  // state.
278  repeated Condition conditions = 17
279      [(google.api.field_behavior) = OUTPUT_ONLY];
280
281  // Output only. The generation of this Execution. See comments in
282  // `reconciling` for additional information on reconciliation process in Cloud
283  // Run.
284  int64 observed_generation = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
285
286  // Output only. The number of actively running tasks.
287  int32 running_count = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
288
289  // Output only. The number of tasks which reached phase Succeeded.
290  int32 succeeded_count = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
291
292  // Output only. The number of tasks which reached phase Failed.
293  int32 failed_count = 21 [(google.api.field_behavior) = OUTPUT_ONLY];
294
295  // Output only. The number of tasks which reached phase Cancelled.
296  int32 cancelled_count = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
297
298  // Output only. The number of tasks which have retried at least once.
299  int32 retried_count = 25 [(google.api.field_behavior) = OUTPUT_ONLY];
300
301  // Output only. URI where logs for this execution can be found in Cloud
302  // Console.
303  string log_uri = 26 [(google.api.field_behavior) = OUTPUT_ONLY];
304
305  // Output only. Reserved for future use.
306  bool satisfies_pzs = 27 [(google.api.field_behavior) = OUTPUT_ONLY];
307
308  // Output only. A system-generated fingerprint for this version of the
309  // resource. May be used to detect modification conflict during updates.
310  string etag = 99 [(google.api.field_behavior) = OUTPUT_ONLY];
311}
312