CVMs
cvms-draft

Stage CVM changes

Changed on

Adds an update to the CVM's staged changes without restarting it. The body is the PATCH /cvms/{cvm_id} body. Applying runs the staged compose changes in order on the CVM's compose; other fields take the last staged value. Scripts this change sends are reviewed as the draft would leave them. The first staged change records the CVM's compose hash.

patch/api/v1/cvms/{cvm_id}/draft

Request

Path parameters

cvm_idstring required

Request body

docker_compose_filestring nullable

Docker Compose YAML content

pre_launch_scriptstring nullable

Shell script executed before containers start

allowed_envsstring[] nullable

Allowed environment variable names (env_keys)

public_logsboolean nullable

Expose container logs publicly

public_sysinfoboolean nullable

Expose system info publicly

public_tcbinfoboolean nullable

Expose TCB attestation info publicly

init_scriptsstring[] nullable

Platform init scripts this CVM runs, replacing the current set. Enabling docker_cleanup requires confirm_data_wipe.

confirm_data_wipeboolean

Confirms turning on docker_cleanup or requirements.ephemeral_data_disk, which erase data on every boot.

encrypted_envstring nullable

Encrypted environment variables as hex string

user_configstring nullable

User configuration string

vcpuinteger nullable

Number of vCPUs

memoryinteger nullable

Memory in MB

disk_sizeinteger nullable

Disk size in GB

instance_typestring nullable

Instance type identifier (e.g. tdx.medium)

imagestring nullable

OS image name or slug from available-os-images

shutdown_timeoutinteger nullable

Timeout in seconds for graceful shutdown. null uses the platform default.

allow_force_stopboolean

When true, skips graceful shutdown and force stops the CVM immediately.

Response

Successful Response

base_compose_hashstring nullable required

The CVM's compose hash when the first change was staged

current_compose_hashstring nullable required

The CVM's compose hash now; apply is rejected while it differs from the base

preview_compose_hashstring required

The compose hash the CVM runs after apply. For contract-owned KMS, register it on-chain before applying.

patchobject required

The one PATCH /cvms/{cvm_id} body the apply sends: the entries applied in order to the CVM's current compose

Example response

{
  "entries": [
    {
      "user_id": "usr_0123abcd"
    }
  ]
}

Changes