version.proto 21 KB

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