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