version.proto 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. // Copyright 2016 Google Inc.
  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. syntax = "proto3";
  15. package google.appengine.v1;
  16. import "google/api/annotations.proto";
  17. import "google/appengine/v1/app_yaml.proto";
  18. import "google/appengine/v1/deploy.proto";
  19. import "google/protobuf/duration.proto";
  20. import "google/protobuf/timestamp.proto";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "VersionProto";
  23. option java_package = "com.google.appengine.v1";
  24. // A Version resource is a specific set of source code and configuration files
  25. // that are deployed into a service.
  26. message Version {
  27. // Full path to the Version resource in the API. Example:
  28. // `apps/myapp/services/default/versions/v1`.
  29. //
  30. // @OutputOnly
  31. string name = 1;
  32. // Relative name of the version within the service. Example: `v1`.
  33. // Version names can contain only lowercase letters, numbers, or hyphens.
  34. // Reserved names: "default", "latest", and any name with the prefix "ah-".
  35. string id = 2;
  36. // Controls how instances are created.
  37. //
  38. // Defaults to `AutomaticScaling`.
  39. oneof scaling {
  40. // Automatic scaling is based on request rate, response latencies, and other
  41. // application metrics.
  42. AutomaticScaling automatic_scaling = 3;
  43. // A service with basic scaling will create an instance when the application
  44. // receives a request. The instance will be turned down when the app becomes
  45. // idle. Basic scaling is ideal for work that is intermittent or driven by
  46. // user activity.
  47. BasicScaling basic_scaling = 4;
  48. // A service with manual scaling runs continuously, allowing you to perform
  49. // complex initialization and rely on the state of its memory over time.
  50. ManualScaling manual_scaling = 5;
  51. }
  52. // Before an application can receive email or XMPP messages, the application
  53. // must be configured to enable the service.
  54. repeated InboundServiceType inbound_services = 6;
  55. // Instance class that is used to run this version. Valid values are:
  56. // * AutomaticScaling: `F1`, `F2`, `F4`, `F4_1G`
  57. // * ManualScaling or BasicScaling: `B1`, `B2`, `B4`, `B8`, `B4_1G`
  58. //
  59. // Defaults to `F1` for AutomaticScaling and `B1` for ManualScaling or
  60. // BasicScaling.
  61. string instance_class = 7;
  62. // Extra network settings. Only applicable for VM runtimes.
  63. Network network = 8;
  64. // Machine resources for this version. Only applicable for VM runtimes.
  65. Resources resources = 9;
  66. // Desired runtime. Example: `python27`.
  67. string runtime = 10;
  68. // Whether multiple requests can be dispatched to this version at once.
  69. bool threadsafe = 11;
  70. // Whether to deploy this version in a container on a virtual machine.
  71. bool vm = 12;
  72. // Metadata settings that are supplied to this version to enable
  73. // beta runtime features.
  74. map<string, string> beta_settings = 13;
  75. // App Engine execution environment for this version.
  76. //
  77. // Defaults to `standard`.
  78. string env = 14;
  79. // Current serving status of this version. Only the versions with a
  80. // `SERVING` status create instances and can be billed.
  81. //
  82. // `SERVING_STATUS_UNSPECIFIED` is an invalid value. Defaults to `SERVING`.
  83. ServingStatus serving_status = 15;
  84. // Email address of the user who created this version.
  85. //
  86. // @OutputOnly
  87. string created_by = 16;
  88. // Time that this version was created.
  89. //
  90. // @OutputOnly
  91. google.protobuf.Timestamp create_time = 17;
  92. // Total size in bytes of all the files that are included in this version
  93. // and curerntly hosted on the App Engine disk.
  94. //
  95. // @OutputOnly
  96. int64 disk_usage_bytes = 18;
  97. // An ordered list of URL-matching patterns that should be applied to incoming
  98. // requests. The first matching URL handles the request and other request
  99. // handlers are not attempted.
  100. //
  101. // Only returned in `GET` requests if `view=FULL` is set.
  102. repeated UrlMap handlers = 100;
  103. // Custom static error pages. Limited to 10KB per page.
  104. //
  105. // Only returned in `GET` requests if `view=FULL` is set.
  106. repeated ErrorHandler error_handlers = 101;
  107. // Configuration for third-party Python runtime libraries that are required
  108. // by the application.
  109. //
  110. // Only returned in `GET` requests if `view=FULL` is set.
  111. repeated Library libraries = 102;
  112. // Serving configuration for
  113. // [Google Cloud Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/).
  114. //
  115. // Only returned in `GET` requests if `view=FULL` is set.
  116. ApiConfigHandler api_config = 103;
  117. // Environment variables available to the application.
  118. //
  119. // Only returned in `GET` requests if `view=FULL` is set.
  120. map<string, string> env_variables = 104;
  121. // Duration that static files should be cached by web proxies and browsers.
  122. // Only applicable if the corresponding
  123. // [StaticFilesHandler](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler)
  124. // does not specify its own expiration time.
  125. //
  126. // Only returned in `GET` requests if `view=FULL` is set.
  127. google.protobuf.Duration default_expiration = 105;
  128. // Configures health checking for VM instances. Unhealthy instances are
  129. // stopped and replaced with new instances. Only applicable for VM
  130. // runtimes.
  131. //
  132. // Only returned in `GET` requests if `view=FULL` is set.
  133. HealthCheck health_check = 106;
  134. // Files that match this pattern will not be built into this version.
  135. // Only applicable for Go runtimes.
  136. //
  137. // Only returned in `GET` requests if `view=FULL` is set.
  138. string nobuild_files_regex = 107;
  139. // Code and application artifacts that make up this version.
  140. //
  141. // Only returned in `GET` requests if `view=FULL` is set.
  142. Deployment deployment = 108;
  143. // Serving URL for this version. Example:
  144. // "https://myversion-dot-myservice-dot-myapp.appspot.com"
  145. //
  146. // @OutputOnly
  147. string version_url = 109;
  148. }
  149. // Automatic scaling is based on request rate, response latencies, and other
  150. // application metrics.
  151. message AutomaticScaling {
  152. // Amount of time that the
  153. // [Autoscaler](https://cloud.google.com/compute/docs/autoscaler/)
  154. // should wait between changes to the number of virtual machines.
  155. // Only applicable for VM runtimes.
  156. google.protobuf.Duration cool_down_period = 1;
  157. // Target scaling by CPU usage.
  158. CpuUtilization cpu_utilization = 2;
  159. // Number of concurrent requests an automatic scaling instance can accept
  160. // before the scheduler spawns a new instance.
  161. //
  162. // Defaults to a runtime-specific value.
  163. int32 max_concurrent_requests = 3;
  164. // Maximum number of idle instances that should be maintained for this
  165. // version.
  166. int32 max_idle_instances = 4;
  167. // Maximum number of instances that should be started to handle requests.
  168. int32 max_total_instances = 5;
  169. // Maximum amount of time that a request should wait in the pending queue
  170. // before starting a new instance to handle it.
  171. google.protobuf.Duration max_pending_latency = 6;
  172. // Minimum number of idle instances that should be maintained for
  173. // this version. Only applicable for the default version of a service.
  174. int32 min_idle_instances = 7;
  175. // Minimum number of instances that should be maintained for this version.
  176. int32 min_total_instances = 8;
  177. // Minimum amount of time a request should wait in the pending queue before
  178. // starting a new instance to handle it.
  179. google.protobuf.Duration min_pending_latency = 9;
  180. // Target scaling by request utilization.
  181. RequestUtilization request_utilization = 10;
  182. // Target scaling by disk usage.
  183. DiskUtilization disk_utilization = 11;
  184. // Target scaling by network usage.
  185. NetworkUtilization network_utilization = 12;
  186. }
  187. // A service with basic scaling will create an instance when the application
  188. // receives a request. The instance will be turned down when the app becomes
  189. // idle. Basic scaling is ideal for work that is intermittent or driven by
  190. // user activity.
  191. message BasicScaling {
  192. // Duration of time after the last request that an instance must wait before
  193. // the instance is shut down.
  194. google.protobuf.Duration idle_timeout = 1;
  195. // Maximum number of instances to create for this version.
  196. int32 max_instances = 2;
  197. }
  198. // A service with manual scaling runs continuously, allowing you to perform
  199. // complex initialization and rely on the state of its memory over time.
  200. message ManualScaling {
  201. // Number of instances to assign to the service at the start. This number
  202. // can later be altered by using the
  203. // [Modules API](https://cloud.google.com/appengine/docs/python/modules/functions)
  204. // `set_num_instances()` function.
  205. int32 instances = 1;
  206. }
  207. // Target scaling by CPU usage.
  208. message CpuUtilization {
  209. // Period of time over which CPU utilization is calculated.
  210. google.protobuf.Duration aggregation_window_length = 1;
  211. // Target CPU utilization ratio to maintain when scaling. Must be between 0
  212. // and 1.
  213. double target_utilization = 2;
  214. }
  215. // Target scaling by request utilization. Only applicable for VM runtimes.
  216. message RequestUtilization {
  217. // Target requests per second.
  218. int32 target_request_count_per_second = 1;
  219. // Target number of concurrent requests.
  220. int32 target_concurrent_requests = 2;
  221. }
  222. // Target scaling by disk usage. Only applicable for VM runtimes.
  223. message DiskUtilization {
  224. // Target bytes written per second.
  225. int32 target_write_bytes_per_second = 14;
  226. // Target ops written per second.
  227. int32 target_write_ops_per_second = 15;
  228. // Target bytes read per second.
  229. int32 target_read_bytes_per_second = 16;
  230. // Target ops read per seconds.
  231. int32 target_read_ops_per_second = 17;
  232. }
  233. // Target scaling by network usage. Only applicable for VM runtimes.
  234. message NetworkUtilization {
  235. // Target bytes sent per second.
  236. int32 target_sent_bytes_per_second = 1;
  237. // Target packets sent per second.
  238. int32 target_sent_packets_per_second = 11;
  239. // Target bytes received per second.
  240. int32 target_received_bytes_per_second = 12;
  241. // Target packets received per second.
  242. int32 target_received_packets_per_second = 13;
  243. }
  244. // Extra network settings. Only applicable for VM runtimes.
  245. message Network {
  246. // List of ports, or port pairs, to forward from the virtual machine to the
  247. // application container.
  248. repeated string forwarded_ports = 1;
  249. // Tag to apply to the VM instance during creation.
  250. string instance_tag = 2;
  251. // Google Cloud Platform network where the virtual machines are created.
  252. // Specify the short name, not the resource path.
  253. //
  254. // Defaults to `default`.
  255. string name = 3;
  256. }
  257. // Machine resources for a version.
  258. message Resources {
  259. // Number of CPU cores needed.
  260. double cpu = 1;
  261. // Disk size (GB) needed.
  262. double disk_gb = 2;
  263. // Memory (GB) needed.
  264. double memory_gb = 3;
  265. }
  266. // Available inbound services.
  267. enum InboundServiceType {
  268. // Not specified.
  269. INBOUND_SERVICE_UNSPECIFIED = 0;
  270. // Allows an application to receive mail.
  271. INBOUND_SERVICE_MAIL = 1;
  272. // Allows an application to receive email-bound notifications.
  273. INBOUND_SERVICE_MAIL_BOUNCE = 2;
  274. // Allows an application to receive error stanzas.
  275. INBOUND_SERVICE_XMPP_ERROR = 3;
  276. // Allows an application to receive instant messages.
  277. INBOUND_SERVICE_XMPP_MESSAGE = 4;
  278. // Allows an application to receive user subscription POSTs.
  279. INBOUND_SERVICE_XMPP_SUBSCRIBE = 5;
  280. // Allows an application to receive a user's chat presence.
  281. INBOUND_SERVICE_XMPP_PRESENCE = 6;
  282. // Registers an application for notifications when a client connects or
  283. // disconnects from a channel.
  284. INBOUND_SERVICE_CHANNEL_PRESENCE = 7;
  285. // Enables warmup requests.
  286. INBOUND_SERVICE_WARMUP = 9;
  287. }
  288. // Run states of a version.
  289. enum ServingStatus {
  290. // Not specified.
  291. SERVING_STATUS_UNSPECIFIED = 0;
  292. // Currently serving. Instances are created according to the
  293. // scaling settings of the version.
  294. SERVING = 1;
  295. // Disabled. No instances will be created and the scaling
  296. // settings are ignored until the state of the version changes
  297. // to `SERVING`.
  298. STOPPED = 2;
  299. }