{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/withruntime-com/json-schema/withruntime-com-machine-update-schema.json",
  "title": "MachineUpdate",
  "description": "A change to a machine's settings: each field left out stays as it is.",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/withruntime-com-openapi.json#/components/schemas/MachineUpdate",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Its name, unique in its project."
    },
    "labels": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Its labels, in place of its own; those under `runtime.` are kept."
    },
    "idlePauseSeconds": {
      "type": "integer",
      "description": "Seconds with nothing happening before it pauses, 60 to 86400; 0 never. Nothing happening means no call or command running, no traffic, almost no CPU, and no outbound connection it opened still open."
    },
    "vcpu": {
      "type": "integer",
      "description": "Its vCPUs, grown while it runs; a running machine's vCPUs only grow.",
      "minimum": 1
    },
    "memoryGB": {
      "type": "number",
      "description": "Its memory in GB (1 GB is 1,024 MiB), grown while it runs; a running machine's memory only grows.",
      "minimum": 1
    },
    "diskGB": {
      "type": "number",
      "description": "Its disk in GB (1 GB is 1,024 MiB), grown while it runs, its file system with it; a disk only grows.",
      "minimum": 1
    },
    "user": {
      "type": "string",
      "enum": [
        "runtime",
        "root"
      ],
      "description": "Who its commands run as from now when a call names no `user`: `runtime` or `root`. Running ones keep theirs."
    },
    "env": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Environment variables to set, each over its own value, the others kept: the update answers once a running one holds the change (a paused one is given it at its wake), so each process, command and terminal it starts after the answer has them; processes already running keep the environment they started with. At most 32 variables and 32768 bytes of names and values in all, as a create's; values are never answered."
    },
    "removeEnv": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Names of environment variables to take out, the same way: gone from the next process it starts; processes already running keep them."
    },
    "maxCost": {
      "type": "string",
      "format": "decimal",
      "pattern": "^(0|[1-9][0-9]{0,11})(\\.[0-9]{1,9})?$",
      "description": "The most it may cost in all, in US dollars (`\"5.00\"`), in place of its own: one paused at its old maxCost wakes at its next call under a higher one."
    },
    "autoWake": {
      "type": "boolean",
      "description": "Whether a call that reaches it paused (an exec, a file, a terminal, a preview's visitor) resumes it from now. false: such a call answers 409 sandbox_paused and it stays paused until its own `:resume`."
    },
    "deleteAfterSeconds": {
      "type": "integer",
      "description": "Seconds from now until Runtime deletes it, as its delete does: final, and it can't be undone. Sent again before then, it renews it; 0 takes its end off (kept until deleted).",
      "minimum": 0,
      "maximum": 315360000
    },
    "deleteProtection": {
      "type": "boolean",
      "description": "true refuses its delete (409 `delete_protected`) until an update sends false; while true, its time limit pauses it instead of deleting it. Not while it has a `deleteAt`, unless the same update sends `deleteAfterSeconds` 0."
    }
  }
}