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