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.
Returns: Union of two possible responses:
Success (
in_progress):
Precondition required (
precondition_required):
Example — PHALA KMS:
safeUpdateDockerCompose
Safe variant that returns aSafeResult instead of throwing on errors.
