xref: /aosp_15_r20/external/googleapis/google/appengine/v1/version.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
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
15syntax = "proto3";
16
17package google.appengine.v1;
18
19import "google/appengine/v1/app_yaml.proto";
20import "google/appengine/v1/deploy.proto";
21import "google/protobuf/duration.proto";
22import "google/protobuf/timestamp.proto";
23
24option csharp_namespace = "Google.Cloud.AppEngine.V1";
25option go_package = "cloud.google.com/go/appengine/apiv1/appenginepb;appenginepb";
26option java_multiple_files = true;
27option java_outer_classname = "VersionProto";
28option java_package = "com.google.appengine.v1";
29option php_namespace = "Google\\Cloud\\AppEngine\\V1";
30option ruby_package = "Google::Cloud::AppEngine::V1";
31
32// A Version resource is a specific set of source code and configuration files
33// that are deployed into a service.
34message Version {
35  // Full path to the Version resource in the API.  Example:
36  // `apps/myapp/services/default/versions/v1`.
37  //
38  // @OutputOnly
39  string name = 1;
40
41  // Relative name of the version within the service.  Example: `v1`.
42  // Version names can contain only lowercase letters, numbers, or hyphens.
43  // Reserved names: "default", "latest", and any name with the prefix "ah-".
44  string id = 2;
45
46  // Controls how instances are created, scaled, and reaped.
47  //
48  // Defaults to `AutomaticScaling`.
49  oneof scaling {
50    // Automatic scaling is based on request rate, response latencies, and other
51    // application metrics. Instances are dynamically created and destroyed as
52    // needed in order to handle traffic.
53    AutomaticScaling automatic_scaling = 3;
54
55    // A service with basic scaling will create an instance when the application
56    // receives a request. The instance will be turned down when the app becomes
57    // idle. Basic scaling is ideal for work that is intermittent or driven by
58    // user activity.
59    BasicScaling basic_scaling = 4;
60
61    // A service with manual scaling runs continuously, allowing you to perform
62    // complex initialization and rely on the state of its memory over time.
63    // Manually scaled versions are sometimes referred to as "backends".
64    ManualScaling manual_scaling = 5;
65  }
66
67  // Before an application can receive email or XMPP messages, the application
68  // must be configured to enable the service.
69  repeated InboundServiceType inbound_services = 6;
70
71  // Instance class that is used to run this version. Valid values are:
72  //
73  // * AutomaticScaling: `F1`, `F2`, `F4`, `F4_1G`
74  // * ManualScaling or BasicScaling: `B1`, `B2`, `B4`, `B8`, `B4_1G`
75  //
76  // Defaults to `F1` for AutomaticScaling and `B1` for ManualScaling or
77  // BasicScaling.
78  string instance_class = 7;
79
80  // Extra network settings.
81  // Only applicable in the App Engine flexible environment.
82  Network network = 8;
83
84  // The Google Compute Engine zones that are supported by this version in the
85  // App Engine flexible environment. Deprecated.
86  repeated string zones = 118;
87
88  // Machine resources for this version.
89  // Only applicable in the App Engine flexible environment.
90  Resources resources = 9;
91
92  // Desired runtime. Example: `python27`.
93  string runtime = 10;
94
95  // The channel of the runtime to use. Only available for some
96  // runtimes. Defaults to the `default` channel.
97  string runtime_channel = 117;
98
99  // Whether multiple requests can be dispatched to this version at once.
100  bool threadsafe = 11;
101
102  // Whether to deploy this version in a container on a virtual machine.
103  bool vm = 12;
104
105  // Allows App Engine second generation runtimes to access the legacy bundled
106  // services.
107  bool app_engine_apis = 128;
108
109  // Metadata settings that are supplied to this version to enable
110  // beta runtime features.
111  map<string, string> beta_settings = 13;
112
113  // App Engine execution environment for this version.
114  //
115  // Defaults to `standard`.
116  string env = 14;
117
118  // Current serving status of this version. Only the versions with a
119  // `SERVING` status create instances and can be billed.
120  //
121  // `SERVING_STATUS_UNSPECIFIED` is an invalid value. Defaults to `SERVING`.
122  ServingStatus serving_status = 15;
123
124  // Email address of the user who created this version.
125  //
126  // @OutputOnly
127  string created_by = 16;
128
129  // Time that this version was created.
130  //
131  // @OutputOnly
132  google.protobuf.Timestamp create_time = 17;
133
134  // Total size in bytes of all the files that are included in this version
135  // and currently hosted on the App Engine disk.
136  //
137  // @OutputOnly
138  int64 disk_usage_bytes = 18;
139
140  // The version of the API in the given runtime environment. Please see the
141  // app.yaml reference for valid values at
142  // https://cloud.google.com/appengine/docs/standard/<language>/config/appref
143  string runtime_api_version = 21;
144
145  // The path or name of the app's main executable.
146  string runtime_main_executable_path = 22;
147
148  // The identity that the deployed version will run as.
149  // Admin API will use the App Engine Appspot service account as default if
150  // this field is neither provided in app.yaml file nor through CLI flag.
151  string service_account = 127;
152
153  // An ordered list of URL-matching patterns that should be applied to incoming
154  // requests. The first matching URL handles the request and other request
155  // handlers are not attempted.
156  //
157  // Only returned in `GET` requests if `view=FULL` is set.
158  repeated UrlMap handlers = 100;
159
160  // Custom static error pages. Limited to 10KB per page.
161  //
162  // Only returned in `GET` requests if `view=FULL` is set.
163  repeated ErrorHandler error_handlers = 101;
164
165  // Configuration for third-party Python runtime libraries that are required
166  // by the application.
167  //
168  // Only returned in `GET` requests if `view=FULL` is set.
169  repeated Library libraries = 102;
170
171  // Serving configuration for
172  // [Google Cloud Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/).
173  //
174  // Only returned in `GET` requests if `view=FULL` is set.
175  ApiConfigHandler api_config = 103;
176
177  // Environment variables available to the application.
178  //
179  // Only returned in `GET` requests if `view=FULL` is set.
180  map<string, string> env_variables = 104;
181
182  // Environment variables available to the build environment.
183  //
184  // Only returned in `GET` requests if `view=FULL` is set.
185  map<string, string> build_env_variables = 125;
186
187  // Duration that static files should be cached by web proxies and browsers.
188  // Only applicable if the corresponding
189  // [StaticFilesHandler](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StaticFilesHandler)
190  // does not specify its own expiration time.
191  //
192  // Only returned in `GET` requests if `view=FULL` is set.
193  google.protobuf.Duration default_expiration = 105;
194
195  // Configures health checking for instances. Unhealthy instances are
196  // stopped and replaced with new instances.
197  // Only applicable in the App Engine flexible environment.
198  //
199  // Only returned in `GET` requests if `view=FULL` is set.
200  HealthCheck health_check = 106;
201
202  // Configures readiness health checking for instances.
203  // Unhealthy instances are not put into the backend traffic rotation.
204  //
205  // Only returned in `GET` requests if `view=FULL` is set.
206  ReadinessCheck readiness_check = 112;
207
208  // Configures liveness health checking for instances.
209  // Unhealthy instances are stopped and replaced with new instances
210  //
211  // Only returned in `GET` requests if `view=FULL` is set.
212  LivenessCheck liveness_check = 113;
213
214  // Files that match this pattern will not be built into this version.
215  // Only applicable for Go runtimes.
216  //
217  // Only returned in `GET` requests if `view=FULL` is set.
218  string nobuild_files_regex = 107;
219
220  // Code and application artifacts that make up this version.
221  //
222  // Only returned in `GET` requests if `view=FULL` is set.
223  Deployment deployment = 108;
224
225  // Serving URL for this version. Example:
226  // "https://myversion-dot-myservice-dot-myapp.appspot.com"
227  //
228  // @OutputOnly
229  string version_url = 109;
230
231  // Cloud Endpoints configuration.
232  //
233  // If endpoints_api_service is set, the Cloud Endpoints Extensible Service
234  // Proxy will be provided to serve the API implemented by the app.
235  EndpointsApiService endpoints_api_service = 110;
236
237  // The entrypoint for the application.
238  Entrypoint entrypoint = 122;
239
240  // Enables VPC connectivity for standard apps.
241  VpcAccessConnector vpc_access_connector = 121;
242}
243
244// [Cloud Endpoints](https://cloud.google.com/endpoints) configuration.
245// The Endpoints API Service provides tooling for serving Open API and gRPC
246// endpoints via an NGINX proxy. Only valid for App Engine Flexible environment
247// deployments.
248//
249// The fields here refer to the name and configuration ID of a "service"
250// resource in the [Service Management API](https://cloud.google.com/service-management/overview).
251message EndpointsApiService {
252  // Available rollout strategies.
253  enum RolloutStrategy {
254    // Not specified. Defaults to `FIXED`.
255    UNSPECIFIED_ROLLOUT_STRATEGY = 0;
256
257    // Endpoints service configuration ID will be fixed to the configuration ID
258    // specified by `config_id`.
259    FIXED = 1;
260
261    // Endpoints service configuration ID will be updated with each rollout.
262    MANAGED = 2;
263  }
264
265  // Endpoints service name which is the name of the "service" resource in the
266  // Service Management API. For example "myapi.endpoints.myproject.cloud.goog"
267  string name = 1;
268
269  // Endpoints service configuration ID as specified by the Service Management
270  // API. For example "2016-09-19r1".
271  //
272  // By default, the rollout strategy for Endpoints is `RolloutStrategy.FIXED`.
273  // This means that Endpoints starts up with a particular configuration ID.
274  // When a new configuration is rolled out, Endpoints must be given the new
275  // configuration ID. The `config_id` field is used to give the configuration
276  // ID and is required in this case.
277  //
278  // Endpoints also has a rollout strategy called `RolloutStrategy.MANAGED`.
279  // When using this, Endpoints fetches the latest configuration and does not
280  // need the configuration ID. In this case, `config_id` must be omitted.
281  string config_id = 2;
282
283  // Endpoints rollout strategy. If `FIXED`, `config_id` must be specified. If
284  // `MANAGED`, `config_id` must be omitted.
285  RolloutStrategy rollout_strategy = 3;
286
287  // Enable or disable trace sampling. By default, this is set to false for
288  // enabled.
289  bool disable_trace_sampling = 4;
290}
291
292// Automatic scaling is based on request rate, response latencies, and other
293// application metrics.
294message AutomaticScaling {
295  // The time period that the
296  // [Autoscaler](https://cloud.google.com/compute/docs/autoscaler/)
297  // should wait before it starts collecting information from a new instance.
298  // This prevents the autoscaler from collecting information when the instance
299  // is initializing, during which the collected usage would not be reliable.
300  // Only applicable in the App Engine flexible environment.
301  google.protobuf.Duration cool_down_period = 1;
302
303  // Target scaling by CPU usage.
304  CpuUtilization cpu_utilization = 2;
305
306  // Number of concurrent requests an automatic scaling instance can accept
307  // before the scheduler spawns a new instance.
308  //
309  // Defaults to a runtime-specific value.
310  int32 max_concurrent_requests = 3;
311
312  // Maximum number of idle instances that should be maintained for this
313  // version.
314  int32 max_idle_instances = 4;
315
316  // Maximum number of instances that should be started to handle requests for
317  // this version.
318  int32 max_total_instances = 5;
319
320  // Maximum amount of time that a request should wait in the pending queue
321  // before starting a new instance to handle it.
322  google.protobuf.Duration max_pending_latency = 6;
323
324  // Minimum number of idle instances that should be maintained for
325  // this version. Only applicable for the default version of a service.
326  int32 min_idle_instances = 7;
327
328  // Minimum number of running instances that should be maintained for this
329  // version.
330  int32 min_total_instances = 8;
331
332  // Minimum amount of time a request should wait in the pending queue before
333  // starting a new instance to handle it.
334  google.protobuf.Duration min_pending_latency = 9;
335
336  // Target scaling by request utilization.
337  RequestUtilization request_utilization = 10;
338
339  // Target scaling by disk usage.
340  DiskUtilization disk_utilization = 11;
341
342  // Target scaling by network usage.
343  NetworkUtilization network_utilization = 12;
344
345  // Scheduler settings for standard environment.
346  StandardSchedulerSettings standard_scheduler_settings = 20;
347}
348
349// A service with basic scaling will create an instance when the application
350// receives a request. The instance will be turned down when the app becomes
351// idle. Basic scaling is ideal for work that is intermittent or driven by
352// user activity.
353message BasicScaling {
354  // Duration of time after the last request that an instance must wait before
355  // the instance is shut down.
356  google.protobuf.Duration idle_timeout = 1;
357
358  // Maximum number of instances to create for this version.
359  int32 max_instances = 2;
360}
361
362// A service with manual scaling runs continuously, allowing you to perform
363// complex initialization and rely on the state of its memory over time.
364message ManualScaling {
365  // Number of instances to assign to the service at the start. This number
366  // can later be altered by using the
367  // [Modules API](https://cloud.google.com/appengine/docs/python/modules/functions)
368  // `set_num_instances()` function.
369  int32 instances = 1;
370}
371
372// Target scaling by CPU usage.
373message CpuUtilization {
374  // Period of time over which CPU utilization is calculated.
375  google.protobuf.Duration aggregation_window_length = 1;
376
377  // Target CPU utilization ratio to maintain when scaling. Must be between 0
378  // and 1.
379  double target_utilization = 2;
380}
381
382// Target scaling by request utilization.
383// Only applicable in the App Engine flexible environment.
384message RequestUtilization {
385  // Target requests per second.
386  int32 target_request_count_per_second = 1;
387
388  // Target number of concurrent requests.
389  int32 target_concurrent_requests = 2;
390}
391
392// Target scaling by disk usage.
393// Only applicable in the App Engine flexible environment.
394message DiskUtilization {
395  // Target bytes written per second.
396  int32 target_write_bytes_per_second = 14;
397
398  // Target ops written per second.
399  int32 target_write_ops_per_second = 15;
400
401  // Target bytes read per second.
402  int32 target_read_bytes_per_second = 16;
403
404  // Target ops read per seconds.
405  int32 target_read_ops_per_second = 17;
406}
407
408// Target scaling by network usage.
409// Only applicable in the App Engine flexible environment.
410message NetworkUtilization {
411  // Target bytes sent per second.
412  int32 target_sent_bytes_per_second = 1;
413
414  // Target packets sent per second.
415  int32 target_sent_packets_per_second = 11;
416
417  // Target bytes received per second.
418  int32 target_received_bytes_per_second = 12;
419
420  // Target packets received per second.
421  int32 target_received_packets_per_second = 13;
422}
423
424// Scheduler settings for standard environment.
425message StandardSchedulerSettings {
426  // Target CPU utilization ratio to maintain when scaling.
427  double target_cpu_utilization = 1;
428
429  // Target throughput utilization ratio to maintain when scaling
430  double target_throughput_utilization = 2;
431
432  // Minimum number of instances to run for this version. Set to zero to disable
433  // `min_instances` configuration.
434  int32 min_instances = 3;
435
436  // Maximum number of instances to run for this version. Set to zero to disable
437  // `max_instances` configuration.
438  int32 max_instances = 4;
439}
440
441// Extra network settings.
442// Only applicable in the App Engine flexible environment.
443message Network {
444  // List of ports, or port pairs, to forward from the virtual machine to the
445  // application container.
446  // Only applicable in the App Engine flexible environment.
447  repeated string forwarded_ports = 1;
448
449  // Tag to apply to the instance during creation.
450  // Only applicable in the App Engine flexible environment.
451  string instance_tag = 2;
452
453  // Google Compute Engine network where the virtual machines are created.
454  // Specify the short name, not the resource path.
455  //
456  // Defaults to `default`.
457  string name = 3;
458
459  // Google Cloud Platform sub-network where the virtual machines are created.
460  // Specify the short name, not the resource path.
461  //
462  // If a subnetwork name is specified, a network name will also be required
463  // unless it is for the default network.
464  //
465  // * If the network that the instance is being created in is a Legacy network,
466  // then the IP address is allocated from the IPv4Range.
467  // * If the network that the instance is being created in is an auto Subnet
468  // Mode Network, then only network name should be specified (not the
469  // subnetwork_name) and the IP address is created from the IPCidrRange of the
470  // subnetwork that exists in that zone for that network.
471  // * If the network that the instance is being created in is a custom Subnet
472  // Mode Network, then the subnetwork_name must be specified and the
473  // IP address is created from the IPCidrRange of the subnetwork.
474  //
475  // If specified, the subnetwork must exist in the same region as the
476  // App Engine flexible environment application.
477  string subnetwork_name = 4;
478
479  // Enable session affinity.
480  // Only applicable in the App Engine flexible environment.
481  bool session_affinity = 5;
482}
483
484// Volumes mounted within the app container.
485// Only applicable in the App Engine flexible environment.
486message Volume {
487  // Unique name for the volume.
488  string name = 1;
489
490  // Underlying volume type, e.g. 'tmpfs'.
491  string volume_type = 2;
492
493  // Volume size in gigabytes.
494  double size_gb = 3;
495}
496
497// Machine resources for a version.
498message Resources {
499  // Number of CPU cores needed.
500  double cpu = 1;
501
502  // Disk size (GB) needed.
503  double disk_gb = 2;
504
505  // Memory (GB) needed.
506  double memory_gb = 3;
507
508  // User specified volumes.
509  repeated Volume volumes = 4;
510
511  // The name of the encryption key that is stored in Google Cloud KMS.
512  // Only should be used by Cloud Composer to encrypt the vm disk
513  string kms_key_reference = 5;
514}
515
516// Available inbound services.
517enum InboundServiceType {
518  // Not specified.
519  INBOUND_SERVICE_UNSPECIFIED = 0;
520
521  // Allows an application to receive mail.
522  INBOUND_SERVICE_MAIL = 1;
523
524  // Allows an application to receive email-bound notifications.
525  INBOUND_SERVICE_MAIL_BOUNCE = 2;
526
527  // Allows an application to receive error stanzas.
528  INBOUND_SERVICE_XMPP_ERROR = 3;
529
530  // Allows an application to receive instant messages.
531  INBOUND_SERVICE_XMPP_MESSAGE = 4;
532
533  // Allows an application to receive user subscription POSTs.
534  INBOUND_SERVICE_XMPP_SUBSCRIBE = 5;
535
536  // Allows an application to receive a user's chat presence.
537  INBOUND_SERVICE_XMPP_PRESENCE = 6;
538
539  // Registers an application for notifications when a client connects or
540  // disconnects from a channel.
541  INBOUND_SERVICE_CHANNEL_PRESENCE = 7;
542
543  // Enables warmup requests.
544  INBOUND_SERVICE_WARMUP = 9;
545}
546
547// Run states of a version.
548enum ServingStatus {
549  // Not specified.
550  SERVING_STATUS_UNSPECIFIED = 0;
551
552  // Currently serving. Instances are created according to the
553  // scaling settings of the version.
554  SERVING = 1;
555
556  // Disabled. No instances will be created and the scaling
557  // settings are ignored until the state of the version changes
558  // to `SERVING`.
559  STOPPED = 2;
560}
561
562// VPC access connector specification.
563message VpcAccessConnector {
564  // Available egress settings.
565  //
566  // This controls what traffic is diverted through the VPC Access Connector
567  // resource. By default PRIVATE_IP_RANGES will be used.
568  enum EgressSetting {
569    EGRESS_SETTING_UNSPECIFIED = 0;
570
571    // Force the use of VPC Access for all egress traffic from the function.
572    ALL_TRAFFIC = 1;
573
574    // Use the VPC Access Connector for private IP space from RFC1918.
575    PRIVATE_IP_RANGES = 2;
576  }
577
578  // Full Serverless VPC Access Connector name e.g.
579  // /projects/my-project/locations/us-central1/connectors/c1.
580  string name = 1;
581
582  // The egress setting for the connector, controlling what traffic is diverted
583  // through it.
584  EgressSetting egress_setting = 2;
585}
586
587// The entrypoint for the application.
588message Entrypoint {
589  // The command to run.
590  oneof command {
591    // The format should be a shell command that can be fed to `bash -c`.
592    string shell = 1;
593  }
594}
595