version.proto 20 KB

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