version.proto 20 KB

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