UpdateXxxx method targets a single aspect of the CVM (compose file, resources, visibility, etc.) and calls a dedicated API endpoint. PatchCVM is the unified method that can update multiple fields in a single request — internally it calls PATCH /cvms/{cvmId}. Use PatchCVM when you need to change several settings atomically; use the individual UpdateXxxx methods when you only need to change one thing.
For CVMs using on-chain KMS, updates that affect the compose hash require an additional on-chain confirmation step.
UpdateDockerCompose
PATCH /cvms/{cvmId}/docker-compose
Replaces the Docker Compose YAML for a CVM. The compose content is sent as text/yaml. For on-chain KMS CVMs, pass compose hash and transaction hash via the options parameter.
ComposeUpdateOptions fields:
Returns:
*UpdateResult which may indicate that on-chain confirmation is needed.
UpdatePreLaunchScript
PATCH /cvms/{cvmId}/pre-launch-script
Updates the shell script that runs before CVM containers start. Sent as text/plain.
Returns:
*UpdateResult
UpdateCVMResources
PATCH /cvms/{cvmId}/resources
Updates the resource allocation (vCPUs, memory, disk) for a CVM. All fields are optional; only the fields you include will be changed.
Returns:
error (no response body on success)
Resource changes may require a CVM restart. Set
AllowRestart to true if you want the restart to happen automatically.UpdateCVMVisibility
PATCH /cvms/{cvmId}/visibility
Controls which information about a CVM is publicly accessible. All fields are optional.
Returns:
*CVMVisibility with the updated visibility settings.
UpdateCVMEnvs
PATCH /cvms/{cvmId}/envs
Updates the encrypted environment variables for a CVM. Environment variables are encrypted client-side before being sent to the API.
Returns:
*UpdateResult
UpdateOSImage
PATCH /cvms/{cvmId}/os-image
Updates the OS image for a CVM. The CVM will need a restart to apply the new image.
Returns:
error (no response body on success)
PatchCVM
PATCH /cvms/{cvmId}
Applies a multi-field update to a CVM in a single request. This is the most flexible update method — you can change compose, resources, visibility, and more in one call.
Returns:
*PatchCVMResponse — check RequiresOnChainHash to see if on-chain confirmation is needed.
ConfirmCVMPatch
PATCH /cvms/{cvmId}
Confirms a CVM patch that requires on-chain verification. Call this after PatchCVM returns RequiresOnChainHash: true and you have submitted the transaction on-chain.
Returns:
*CVMActionResponse
Compose File Operations
These methods let you provision and commit compose file updates using the two-phase flow, similar to initial CVM provisioning.ProvisionCVMComposeFileUpdate
POST /cvms/{cvmId}/compose_file/provision
Provisions a compose file update without applying it yet. Returns a compose hash for the commit step.
CommitCVMComposeFileUpdate
PATCH /cvms/{cvmId}/compose_file
Commits a previously provisioned compose file update.

