Skip to main content
Configuration methods let you modify a CVM after it has been provisioned. You can update the Docker Compose file, environment variables, resource allocation, visibility settings, and OS image independently.
Some configuration updates restart a running CVM. A change applied through PATCH /cvms/{cvmId} or the compose, environment and OS image endpoints stops the CVM, applies the change and starts it again. A stopped CVM stays stopped and runs the new configuration at its next start. A compose change that matches what the CVM already runs does not restart it: the API answers no_change and does nothing. Annotations (update_cvm_annotations) never restart the CVM, and SSH key changes without apply_now stay pending until the next power-on.
patch_cvm sends any set of changes in one request to PATCH /cvms/{cvmId}. update_cvm_resources and update_cvm_visibility send a subset of fields to the same endpoint. The other update_* methods call their own endpoints. See Update CVM Configuration for what each field does and which settings cannot change after create.

update_docker_compose

PATCH /cvms/{cvmId}/docker-compose Updates the Docker Compose configuration for a CVM. If the CVM has on-chain hash verification enabled, you need to pass compose_hash and transaction_hash. Parameters: Returns: A CloudModel with the API response when the update is accepted. For an on-chain KMS CVM whose new compose hash is not registered yet, the API answers HTTP 465 and the method returns a CloudModel with status="precondition_required" and compose_hash, app_id, device_id and kms_info, instead of raising. The sync and async clients behave the same. Example:

update_cvm_envs

PATCH /cvms/{cvmId}/envs Updates encrypted environment variables for a CVM. Environment variables must be encrypted using the KMS public key before being sent. Parameters: Returns: InProgressResponse on success, or precondition response if on-chain verification is needed. Example:

update_pre_launch_script

PATCH /cvms/{cvmId}/pre-launch-script Updates the pre-launch script that runs before Docker containers start. Parameters: Returns: InProgressResponse on success.

get_cvm_docker_compose

GET /cvms/{cvmId}/docker-compose.yml Retrieves the current Docker Compose YAML for a CVM as a raw string. Parameters: Returns: str — Docker Compose YAML content. Example:

get_cvm_compose_file

GET /cvms/{cvmId}/compose_file Retrieves the compose file with metadata (including hash info and structure). Parameters: Returns: Compose file response with metadata.

commit_cvm_update

POST /cvms/{cvmId}/commit-update Commit a prepared update using its token. compose_hash and transaction_hash are optional request fields. The returned CommitCvmUpdateResult contains correlation_id and status.
The async client supports await client.commit_cvm_update(...). A safe_commit_cvm_update variant is also available.

update_cvm_resources

PATCH /cvms/{cvmId} Changes the resource allocation (CPU, memory, disk, instance type) for a CVM. Parameters: Returns: The API response, {"message", "correlation_id", "status"}. Example:

update_cvm_visibility

PATCH /cvms/{cvmId} Controls which CVM information is publicly accessible. Parameters: Returns: {"message", "correlation_id", "status"}. status is "in_progress", or "no_change" with an empty correlation_id when the settings already match. These settings are part of the compose hash. For a CVM on Onchain KMS, the request fails with HTTP 465 until the new hash is registered on-chain. Use patch_cvm, which returns the hash to register. The Trust Center listing is not a visibility setting; it has its own endpoint, PATCH /cvms/{cvmId}/listed. Example:

update_os_image

PATCH /cvms/{cvmId}/os-image Changes the OS image for a CVM. Parameters: Returns: None Example:

get_available_os_images

GET /cvms/{cvmId}/available-os-images Lists OS images available for a specific CVM. The available images depend on the CVM’s node and configuration. Parameters: Returns: List of available OS image objects.

patch_cvm

PATCH /cvms/{cvmId} A batch update method that can modify multiple CVM fields in a single request. This is useful when you need to change several settings atomically. compose is a JSON Merge Patch of the app compose, typed as ComposePatch. Only the keys you set are sent, and a key set to None is sent as null, which removes it. See How does the compose patch work? for the keys. To change a bash runner’s script, set ComposePatch(bash_script=...). Parameters: Returns: A dict with requires_on_chain_hash (bool). When it is False, the dict has correlation_id, which is empty when the API answers no_change. When it is True, it has compose_hash, app_id, device_id and kms_info, plus commit_token, commit_url, api_commit_url and onchain_status for a prepare_only call.
On Onchain KMS, a change to the compose returns requires_on_chain_hash: True only when the new compose hash is not on the app contract yet (HTTP 465). If the hash is already allowed, or the patch does not change the compose (for example a resize), the update starts at once and you get correlation_id. After a 465, register compose_hash on-chain, then call confirm_cvm_patch with the compose hash and transaction hash. With prepare_only, the 465 result also carries commit_token, and anyone holding it can finish the update. prepare_only is not a dry run: an update that needs no registration starts right away. See Multisig and Governance.

get_cvm_init_scripts

GET /cvms/{cvmId}/init-scripts Lists the platform init scripts, in run order, and for each one whether the CVM runs it (selected), whether you can pick it for this CVM (selectable) and, if not, why (reason). Change the selection with patch_cvm’s init_scripts. See Init scripts. Parameters: id (CVM identifier). Returns: CvmInitScriptsResponse with items.

get_cvm_annotations / update_cvm_annotations

GET /cvms/{cvmId}/annotations / PUT /cvms/{cvmId}/annotations Reads or replaces the CVM’s annotations: key/value settings for tools on the host. They are not measured and attestation does not cover them. update_cvm_annotations replaces every annotation, and {} clears them. It does not restart the CVM. Annotations sit behind a feature flag; without it, both calls fail with ERR-03-049. See Annotations. Parameters: id (CVM identifier), plus annotations (dict[str, str]) for update_cvm_annotations. Returns: CvmAnnotationsResponse with annotations, the annotations the node now stores.

Compose File Update Flow

For updates that require on-chain hash verification, the SDK provides a two-step flow similar to CVM provisioning:

provision_cvm_compose_file_update

POST /cvms/{cvmId}/compose_file/provision Provisions a compose file update and returns the new compose hash.

commit_cvm_compose_file_update

PATCH /cvms/{cvmId}/compose_file Commits the compose file update with the verified hash.
  • CVM Lifecycle — provisioning and managing CVMs
  • KMS — encryption keys for environment variables