1 // Copyright 2016 Google Inc.
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 package google.appengine.v1;
19 import "google/api/annotations.proto";
20 import "google/appengine/v1/app_yaml.proto";
21 import "google/appengine/v1/deploy.proto";
22 import "google/protobuf/duration.proto";
23 import "google/protobuf/timestamp.proto";
25 option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine";
26 option java_multiple_files = true;
27 option java_outer_classname = "VersionProto";
28 option java_package = "com.google.appengine.v1";
30 // A Version resource is a specific set of source code and configuration files
31 // that are deployed into a service.
33 // Full path to the Version resource in the API. Example:
34 // `apps/myapp/services/default/versions/v1`.
39 // Relative name of the version within the service. Example: `v1`.
40 // Version names can contain only lowercase letters, numbers, or hyphens.
41 // Reserved names: "default", "latest", and any name with the prefix "ah-".
44 // Controls how instances are created.
46 // Defaults to `AutomaticScaling`.
48 // Automatic scaling is based on request rate, response latencies, and other
49 // application metrics.
50 AutomaticScaling automatic_scaling = 3;
52 // A service with basic scaling will create an instance when the application
53 // receives a request. The instance will be turned down when the app becomes
54 // idle. Basic scaling is ideal for work that is intermittent or driven by
56 BasicScaling basic_scaling = 4;
58 // A service with manual scaling runs continuously, allowing you to perform
59 // complex initialization and rely on the state of its memory over time.
60 ManualScaling manual_scaling = 5;
63 // Before an application can receive email or XMPP messages, the application
64 // must be configured to enable the service.
65 repeated InboundServiceType inbound_services = 6;
67 // Instance class that is used to run this version. Valid values are:
68 // * AutomaticScaling: `F1`, `F2`, `F4`, `F4_1G`
69 // * ManualScaling or BasicScaling: `B1`, `B2`, `B4`, `B8`, `B4_1G`
71 // Defaults to `F1` for AutomaticScaling and `B1` for ManualScaling or
73 string instance_class = 7;
75 // Extra network settings. Only applicable for VM runtimes.
78 // Machine resources for this version. Only applicable for VM runtimes.
79 Resources resources = 9;
81 // Desired runtime. Example: `python27`.
84 // Whether multiple requests can be dispatched to this version at once.
87 // Whether to deploy this version in a container on a virtual machine.
90 // Metadata settings that are supplied to this version to enable
91 // beta runtime features.
92 map<string, string> beta_settings = 13;
94 // App Engine execution environment for this version.
96 // Defaults to `standard`.
99 // Current serving status of this version. Only the versions with a
100 // `SERVING` status create instances and can be billed.
102 // `SERVING_STATUS_UNSPECIFIED` is an invalid value. Defaults to `SERVING`.
103 ServingStatus serving_status = 15;
105 // Email address of the user who created this version.
108 string created_by = 16;
110 // Time that this version was created.
113 google.protobuf.Timestamp create_time = 17;
115 // Total size in bytes of all the files that are included in this version
116 // and curerntly hosted on the App Engine disk.
119 int64 disk_usage_bytes = 18;
121 // An ordered list of URL-matching patterns that should be applied to incoming
122 // requests. The first matching URL handles the request and other request
123 // handlers are not attempted.
125 // Only returned in `GET` requests if `view=FULL` is set.
126 repeated UrlMap handlers = 100;
128 // Custom static error pages. Limited to 10KB per page.
130 // Only returned in `GET` requests if `view=FULL` is set.
131 repeated ErrorHandler error_handlers = 101;
133 // Configuration for third-party Python runtime libraries that are required
134 // by the application.
136 // Only returned in `GET` requests if `view=FULL` is set.
137 repeated Library libraries = 102;
139 // Serving configuration for
141 // Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/).
143 // Only returned in `GET` requests if `view=FULL` is set.
144 ApiConfigHandler api_config = 103;
146 // Environment variables available to the application.
148 // Only returned in `GET` requests if `view=FULL` is set.
149 map<string, string> env_variables = 104;
151 // Duration that static files should be cached by web proxies and browsers.
152 // Only applicable if the corresponding
153 // [StaticFilesHandler](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler)
154 // does not specify its own expiration time.
156 // Only returned in `GET` requests if `view=FULL` is set.
157 google.protobuf.Duration default_expiration = 105;
159 // Configures health checking for VM instances. Unhealthy instances are
160 // stopped and replaced with new instances. Only applicable for VM
163 // Only returned in `GET` requests if `view=FULL` is set.
164 HealthCheck health_check = 106;
166 // Files that match this pattern will not be built into this version.
167 // Only applicable for Go runtimes.
169 // Only returned in `GET` requests if `view=FULL` is set.
170 string nobuild_files_regex = 107;
172 // Code and application artifacts that make up this version.
174 // Only returned in `GET` requests if `view=FULL` is set.
175 Deployment deployment = 108;
177 // Serving URL for this version. Example:
178 // "https://myversion-dot-myservice-dot-myapp.appspot.com"
181 string version_url = 109;
184 // Automatic scaling is based on request rate, response latencies, and other
185 // application metrics.
186 message AutomaticScaling {
187 // Amount of time that the
188 // [Autoscaler](https://cloud.google.com/compute/docs/autoscaler/)
189 // should wait between changes to the number of virtual machines.
190 // Only applicable for VM runtimes.
191 google.protobuf.Duration cool_down_period = 1;
193 // Target scaling by CPU usage.
194 CpuUtilization cpu_utilization = 2;
196 // Number of concurrent requests an automatic scaling instance can accept
197 // before the scheduler spawns a new instance.
199 // Defaults to a runtime-specific value.
200 int32 max_concurrent_requests = 3;
202 // Maximum number of idle instances that should be maintained for this
204 int32 max_idle_instances = 4;
206 // Maximum number of instances that should be started to handle requests.
207 int32 max_total_instances = 5;
209 // Maximum amount of time that a request should wait in the pending queue
210 // before starting a new instance to handle it.
211 google.protobuf.Duration max_pending_latency = 6;
213 // Minimum number of idle instances that should be maintained for
214 // this version. Only applicable for the default version of a service.
215 int32 min_idle_instances = 7;
217 // Minimum number of instances that should be maintained for this version.
218 int32 min_total_instances = 8;
220 // Minimum amount of time a request should wait in the pending queue before
221 // starting a new instance to handle it.
222 google.protobuf.Duration min_pending_latency = 9;
224 // Target scaling by request utilization.
225 RequestUtilization request_utilization = 10;
227 // Target scaling by disk usage.
228 DiskUtilization disk_utilization = 11;
230 // Target scaling by network usage.
231 NetworkUtilization network_utilization = 12;
234 // A service with basic scaling will create an instance when the application
235 // receives a request. The instance will be turned down when the app becomes
236 // idle. Basic scaling is ideal for work that is intermittent or driven by
238 message BasicScaling {
239 // Duration of time after the last request that an instance must wait before
240 // the instance is shut down.
241 google.protobuf.Duration idle_timeout = 1;
243 // Maximum number of instances to create for this version.
244 int32 max_instances = 2;
247 // A service with manual scaling runs continuously, allowing you to perform
248 // complex initialization and rely on the state of its memory over time.
249 message ManualScaling {
250 // Number of instances to assign to the service at the start. This number
251 // can later be altered by using the
253 // API](https://cloud.google.com/appengine/docs/python/modules/functions)
254 // `set_num_instances()` function.
258 // Target scaling by CPU usage.
259 message CpuUtilization {
260 // Period of time over which CPU utilization is calculated.
261 google.protobuf.Duration aggregation_window_length = 1;
263 // Target CPU utilization ratio to maintain when scaling. Must be between 0
265 double target_utilization = 2;
268 // Target scaling by request utilization. Only applicable for VM runtimes.
269 message RequestUtilization {
270 // Target requests per second.
271 int32 target_request_count_per_second = 1;
273 // Target number of concurrent requests.
274 int32 target_concurrent_requests = 2;
277 // Target scaling by disk usage. Only applicable for VM runtimes.
278 message DiskUtilization {
279 // Target bytes written per second.
280 int32 target_write_bytes_per_second = 14;
282 // Target ops written per second.
283 int32 target_write_ops_per_second = 15;
285 // Target bytes read per second.
286 int32 target_read_bytes_per_second = 16;
288 // Target ops read per seconds.
289 int32 target_read_ops_per_second = 17;
292 // Target scaling by network usage. Only applicable for VM runtimes.
293 message NetworkUtilization {
294 // Target bytes sent per second.
295 int32 target_sent_bytes_per_second = 1;
297 // Target packets sent per second.
298 int32 target_sent_packets_per_second = 11;
300 // Target bytes received per second.
301 int32 target_received_bytes_per_second = 12;
303 // Target packets received per second.
304 int32 target_received_packets_per_second = 13;
307 // Extra network settings. Only applicable for VM runtimes.
309 // List of ports, or port pairs, to forward from the virtual machine to the
310 // application container.
311 repeated string forwarded_ports = 1;
313 // Tag to apply to the VM instance during creation.
314 string instance_tag = 2;
316 // Google Cloud Platform network where the virtual machines are created.
317 // Specify the short name, not the resource path.
319 // Defaults to `default`.
323 // Machine resources for a version.
325 // Number of CPU cores needed.
328 // Disk size (GB) needed.
331 // Memory (GB) needed.
332 double memory_gb = 3;
335 // Available inbound services.
336 enum InboundServiceType {
338 INBOUND_SERVICE_UNSPECIFIED = 0;
340 // Allows an application to receive mail.
341 INBOUND_SERVICE_MAIL = 1;
343 // Allows an application to receive email-bound notifications.
344 INBOUND_SERVICE_MAIL_BOUNCE = 2;
346 // Allows an application to receive error stanzas.
347 INBOUND_SERVICE_XMPP_ERROR = 3;
349 // Allows an application to receive instant messages.
350 INBOUND_SERVICE_XMPP_MESSAGE = 4;
352 // Allows an application to receive user subscription POSTs.
353 INBOUND_SERVICE_XMPP_SUBSCRIBE = 5;
355 // Allows an application to receive a user's chat presence.
356 INBOUND_SERVICE_XMPP_PRESENCE = 6;
358 // Registers an application for notifications when a client connects or
359 // disconnects from a channel.
360 INBOUND_SERVICE_CHANNEL_PRESENCE = 7;
362 // Enables warmup requests.
363 INBOUND_SERVICE_WARMUP = 9;
366 // Run states of a version.
369 SERVING_STATUS_UNSPECIFIED = 0;
371 // Currently serving. Instances are created according to the
372 // scaling settings of the version.
375 // Disabled. No instances will be created and the scaling
376 // settings are ignored until the state of the version changes