updateCvmEnvs
PATCH /cvms/{cvmId}/envs
Updates the encrypted environment variables for a running CVM.
This function uses a two-phase flow when the set of allowed env keys changes on a CVM with on-chain KMS:
- Phase 1: Call with
encrypted_envandenv_keys. If the env keys changed and 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 parameters plus
compose_hashandtransaction_hash.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | CVM identifier |
encrypted_env | string | Yes | Hex-encoded encrypted environment variables |
env_keys | string[] | No | Allowed environment variable keys |
compose_hash | string | No | Compose hash (Phase 2, after on-chain registration) |
transaction_hash | string | No | On-chain transaction hash (Phase 2) |
in_progress):
| Field | Type | Description |
|---|---|---|
status | "in_progress" | Update accepted |
message | string | Status message |
correlation_id | string | Tracking ID |
allowed_envs_changed | boolean | Whether env keys changed |
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 |
safeUpdateCvmEnvs
Safe variant that returns aSafeResult instead of throwing on errors.
