SandboxesLifecycle

Resize a sandbox

Change the CPU, memory, or disk allocation of a sandbox. Only provided fields change.

  • Disk only grows, and grows at once.
  • CPU and memory grow live on a running sandbox that supports it. Otherwise they apply on the next reboot.
  • Set mode to live to fail instead of waiting, or to deferred to always wait for the reboot.
  • A live resize only grows. To shrink memory, set force. The change applies on the next reboot.

A refusal carries its cause code in the problem type:

  • 409 for no_capacity, claim_failed, resize_in_flight and disk_resize_failed. Nothing changed.
  • 422 for shrink_unsupported, not_running, no_hotplug_limits, above_hotplug_limit or another runner code.
  • 502 for live_resize_unknown: the dispatch came back without a decision, and the change waits as pending.
PUT
/v1/sandboxes/{idOrName}/resize
AuthorizationBearer <token>

API key starting with tektona_. Create one at app-dev.tektona.ai under API Keys.

In: header

Path Parameters

idOrName*string

Sandbox ID (ULID) or name

Query Parameters

org?string

Required when the path names the sandbox by name.

project?string

Required when the path names the sandbox by name.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

cpu?integer

CPU cores. Limited per installation: read the limits from GET /v1/sandbox-limits.

Formatint64
Range1 <= value
disk?integer

Total root disk in GiB. Limited per installation: read the limits from GET /v1/sandbox-limits.

Formatint64
Range1 <= value
force?boolean

Permit downsizing memory, which can disrupt a running workload.

memory?integer

Memory in GiB. Limited per installation: read the limits from GET /v1/sandbox-limits.

Formatint64
Range1 <= value
mode?string

When a CPU or memory change applies. live: apply it to the running sandbox now, or fail; a refusal leaves CPU and memory as they are (a disk that the runner grew stays grown), and an unknown outcome (live_resize_unknown) leaves the change for the next reboot. deferred: apply it on the next reboot. Omitted: apply it now when the sandbox can grow live, else on the next reboot; deferred_reason then says why.

Value in

  • "live"
  • "deferred"

Response Body

application/json

application/problem+json

curl -X PUT "https://example.com/v1/sandboxes/string/resize" \  -H "Content-Type: application/json" \  -d '{}'
{  "after": {    "cpu": 2,    "disk": 10,    "memory": 2  },  "applies_immediately": true,  "before": {    "cpu": 2,    "disk": 10,    "memory": 2  },  "deferred_reason": "string",  "id": "string",  "note": "string"}