Change an app
A JSON Merge Patch. A change of what a version is made of (image, start_command, port, ready, env, secrets, size) deploys a new version of an app that has an image; a change of the rest (name, regions, scale, keys, egress, metadata) holds at once and makes none: the nodes that serve the app are told of its scale and its labels. null takes a field back to what it is when nothing is said; image and name cannot be taken away. A patch that changes nothing writes nothing. Takes write; giving the app a secret it does not have takes admin besides. Of the project's default sandbox app (sbx-sandbox, managed_by of the Sandboxes product) the patch takes image alone, a reference or null for the base template: a new version made of it (answered 200 with the app, current_version the new one; the same image again is none), of which the project's creates that name no image are made from then on; anything else is 409 managed_by_sandboxes, as every change of an image's app is.
https://api.glac.ai/v1/apps/{app}Autorización
Parámetros de ruta
Cuerpo de la solicitudJSONopcional
- nameoptionalstring | null
1 to 40 lower-case letters, digits and hyphens, beginning with a letter, with no hyphen at its end or two in a row, not beginning with
app-orsbx-, and notlocalhost,internalorshared. It is the name the project's sandboxes on its network find the app by (private), and no other app'snetwork.aliases(409name_taken). Not given: one is made up. - image_pull_secretoptionalstring | null
The name of one of the project's secrets (
/v1/secrets) that holds the credentials of the image's registry, for an image that is not public:username:passwordin printable ASCII, the user name ending at the first colon; a registry that takes a token alone documents the user name that goes with it (AWSfor ECR,oauth2accesstokenfor Google's, any name for GHCR). The value goes to each node that builds a version, with the image, and there to the tool that pulls it and to nothing else: nothing of it is in an instance, in a template, in an event or in a log, and what a registry says when it refuses it is the version'serror, without it (registry_auth_failed). Naming it takeswrite, and noadmin. The secret has to exist (404secret_not_found) and to hold such a pair (400invalid_field) when a version is made; a deploy reads it when it asks a node. In aPATCH,nulltakes it away. Not given: none, and the image is asked of its registry without a login.maxLength: 128 - start_argsoptional
The arguments that follow the image's ENTRYPOINT in the place of its CMD, as a Compose service's
commanddoes: the node puts the image's ENTRYPOINT in front of them (an image with none runs them alone). Not withstart_command, which is the whole start command (400invalid_field). Not given: the image's CMD. - envoptionalobject | null
The environment of the start command, after the image's own. A value may refer to a variable of another service of the project, or of the app itself, or to one of the project's shared variables, alone or in other text:
${{ db.POSTGRES_USER }},${{ shared.REGION }}. A service's variables are itsenv(whose own references are followed), itssecrets, and the four the platform gives it (SBX_SERVICE, its name;SBX_PRIVATE_DOMAIN,<name>.internal;SBX_PRIVATE_ADDRESS, its address on the project's network;SBX_PROJECT, the project's id). A version holds what they come to when it is made: the app keeps what was written. A reference to a secret makes the variable that secret, assecretsdoes: it is the whole of a value, and it takesadminwhere the app does not have the secret. Every${{begins a reference (400invalid_reference,paramat the variable); one that goes round, or refers to a service or a variable that is not there, is refused when a version is made (400invalid_reference), and one to a secret that is gone too (404secret_not_found). - drivesoptionalarray | null
The Drives its instance mounts read-write (slice D8), kept with each version made after: Drives of the project's, by name or id as written, each looked up when the app is made or changed and when a version is deployed (404
drive_not_found; a volume of another kind is none). A service with a Drive is stateful, as one with a volume of its own is (volumes): one instance, which has its Drives, made on the node that holds them, or on another of their region they are brought to. A Drive has one writer: an app of many instances (scale.max_instancesother than 1 or null,scale.min_instancesabove 1, orkeys) is refused, 409drive_single_writer; read-only mounts of a Drive's snapshots, which many may have, are a sandbox's (modesnapshot, slice D7) and no app's version mounts one yet, and a keyed app gives each key a Drive of its own (key_drives). No two of its volumes and Drives at one path; an instance mounts 8 Drives and volumes of its own at the most (409too_many_drives). Not given: none. - key_drivesoptionalarray | null
The Drives each key's instance has of its own (slice D8; reports/workers/keyed-upgrade.md, where they were
key_volumes), of a keyed app alone (keys; 400invalid_fieldotherwise), kept with each version made after. A key's Drives are made when its first instance is made, on the node it is made on and in its region, and mounted before its start command runs (its versions are built with the command held back); every instance the key has after (its first deleted idle, or by its id) mounts the same Drives, by their names; an upgrade of its instance to a version that names other ones mounts them by their names too: one the version names that the key has none of is made then, one it no longer names is left off and kept (POST /v1/apps/{app}/instances/{key}/upgrade); they are deleted with the key (DELETE /v1/apps/{app}/instances/{key}) or with the app. A key's Drive is shown inGET /v1/volumeswith itsapp_idandkey, is billed as any Drive, counts toward what the project's Drives hold together and not toward their number, and is not the project's to delete or to mount elsewhere (409key_drive). Not given: none. - volumesoptionalarray | null
What its instances mount, kept with each version made after: volumes of the project's (
POST /v1/volumes), by name or id as written, each looked up when the app is made or changed and when a version is deployed (404volume_not_found). No two at one path. A service with a volume of its own (one that is not shared) is stateful: it has one instance, which has the volume (scale.max_instances1 or null,scale.min_instances0 or 1, nokeys: 400volume_single_instance), on the machine of its volumes, which are on one machine (409volumes_apart). Its versions are built there with the start command held back; the instance is made at the service's address on the project's network, named as the service is (or ashostnamesays), mounts the volumes first (a new one given what the image has there, unlessnocopy), then starts the command and takes connections once it is up asreadysays; every start of it from its disk does the same. It sleeps as any keyed instance does (scale.sleep_after_ms; never with a floor of 1), is woken by a connection on the project's network, and is deleted by its owner alone, or with the app. A version deployed later replaces it: the old one's command is stopped asstopsays, the new one is made with the same volumes at the same address, and the traffic is the new one's when it is up; one that does not come up has the version before made again with the volumes as they were left, and the deploy fails with what the new one said (app.deploy_failed). Not given: none.
Returns
200
The app after the change, and made_version: the version the change made, null if it made none.
- managed_byobject | nullrequired
What changes it alone, where something does.
objectdatabase: the database it is under (id,/v1/databases); every other call that would change it is refused, 409managed_by_database.objectsandboxes(idnull): the Sandboxes product's, made by the creates of the project's sandboxes (POST /v1/sandboxes): the project's default sandbox app,sbx-sandbox(itsimagenull: each sandbox is made from the base template of the node it goes to, until the project names an image for it,PATCHwithimagealone, a new version made of that image, of which the creates that name no image are made from then on), or the app of an image a create named (image, as the create named it;sbx-<the image's name>-<12 hex digits>, one version). A version is ready from when it is made, and the app's instances are the project's sandboxes; every call of it but reading it and its versions, naming the default sandbox app's image and deleting it (its versions' templates go with it; the next create of its image, or of none, makes it again) is refused, 409managed_by_sandboxes. Null: none's.objectinstallation: the installation of a Managed Application it is part of (id,/v1/installations), which changes it alone: every other call that would change it is refused, 409managed_by_installation. - privateobjectrequired
Where the project's sandboxes on its network find the app: its address there, which it keeps for as long as it is there, renamed or not; and its name under
internal. A sandbox of the project on the network finds it by its name, bydomain, and by each of itsnetwork.aliaseswith and without.internal. - egressobject | nullrequired
Egress rules as a sandbox has them (
default,allow,deny,http,inject), null when there are none; kept as the calls gave them (aPATCHmerges them key by key, as a node does). They hold at once and make no version: the nodes that serve the app put them on every instance of its group, the ones there are (one that runs for the connections it has too) and the ones made after; a keyed instance does not have them. The control plane checks only that they are an object of those keys of at most 256 KiB: what the rules say is a node's to check, when it applies them, and an instance whose rules its node cannot read is refused everything (the node's log says why). - urlstring | nullrequired
Where the app answers:
https://and its default domain,<name>-<the project's short name>.<the zone>. It is the app's from the moment it is made (503app_not_deployeduntil its first version is ready) and for as long as the app has its name.nullon a control plane that is told no zone for apps (--app-zone). - checkpointrequired
Checkpoints of its keyed instances while they run: every
every_seconds(10 unless said, 1 to 600) an instance's memory and disk as they are at one instant go to its node's object store, and when its node's host is lost the instance is taken over on another node from its newest checkpoint with its processes, losing at most what it did since (an instance that sleeps is taken over from its sleep, which loses nothing). Its node pauses it for a few milliseconds for each; what it wrote since the last one is what is sent, compressed, and one that writes more than its node's link for checkpoints takes falls behind instead of filling it (the instance'scheckpoint:last_at,behind_seconds,bytes_per_second,stored_bytes). What the store keeps of an instance's newest checkpoint is billed as sleeping state (state) while it runs; nothing for what is sent. Holds at once and makes no version: the instances that are there are given it, those made later are made with it. Not a stateful service's instance: its volume has no copy in the store. An instance's Drives (its ownkey_drivestoo) are pinned with its disk at the same instant, and a takeover brings them back as they were then; an instance with a volume that is not a Drive takes none, and itscheckpoint.errorsays so. Null: none (the default). - build_failuresarray deobjectrequired
The nodes that are to serve the version the app's traffic goes to and could not build it when they were asked to after its deploy (a node that joined, one whose template of it is of no use any more, one that came back), one an item, by the node's id; empty where there are none. A node whose build failed is asked again ten minutes after its last try, and is no longer here once it has built the version; the other nodes serve the version meanwhile. Each failure is also an event,
app.build_failed, once. - made_versionstring | nullrequired
The id of the version this call made: a change of what a version is made of, of an app that has an image, makes one, and it is the one the app is
deployingwhen the call answers.nullwhen the call made none (it changed what holds at once, or nothing).deployingalone does not say that: it may be a version another call made.