updateDockerCompose
PATCH /cvms/{cvmId}/docker-compose
Updates the Docker Compose file for a running CVM. The request body is sent as text/yaml.
This function uses a two-phase flow for CVMs with on-chain KMS:
- Phase 1: Call with the new
docker_compose_file. If the CVM uses on-chain KMS, the API returnsprecondition_requiredwith acompose_hash. - Register on-chain: Call
addComposeHashto register the new compose hash on the blockchain. - Phase 2: Retry the call with the original YAML plus
compose_hashandtransaction_hash.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | CVM identifier |
docker_compose_file | string | Yes | New Docker Compose YAML content |
compose_hash | string | No | Compose hash (Phase 2, sent via X-Compose-Hash header) |
transaction_hash | string | No | On-chain transaction hash (Phase 2, sent via X-Transaction-Hash header) |
in_progress):
| Field | Type | Description |
|---|---|---|
status | "in_progress" | Update accepted |
message | string | Status message |
correlation_id | string | Tracking ID |
precondition_required):
| Field | Type | Description |
|---|---|---|
status | "precondition_required" | On-chain registration needed |
message | string | Instructions |
compose_hash | string | Hash to register on-chain |
app_id | string | App ID for contract interaction |
device_id | string | Device ID |
kms_info | KmsInfo | KMS details for chain interaction |
safeUpdateDockerCompose
Safe variant that returns aSafeResult instead of throwing on errors.
