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