Update calculation instance

Update the modifiable configuration of a computing instance in the current workspace. Serverless instances do not deploy workers immediately due to configuration updates. Workers are activated based on subsequent workload demand.

HTTP
PUT $CLOUDSIGMA_API_BASE/compute-resources/{resource_id}

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First Query the computing instance details to confirm the instance to be updated. Prepare the personal access token, target workspace ID, and computing instance ID that can access the target workspace.

Request body

Shell
curl -X PUT "$CLOUDSIGMA_API_BASE/compute-resources/$RESOURCE_ID" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "description": "updated",
    "max_replicas": 3,
    "auto_suspend_minutes": 30
  }'

When the optional field is omitted or filled in with null, the original value will not be modified. description When filling in a blank string, clear the description. Submitting {} will still update the time and clear the status description.

When the specification or resource type is modified, the old capacity value in the same request will be overwritten. Only modifying the old capacity field may not change the actual running configuration. This operation does not start or restart the worker.

Filling in worker_images will replace the image configuration as a whole and must include each currently registered Worker type. If you fill in [], it will fail. If you fill in null, the original value will be retained.

Each item must be filled with a non-empty image ID and platform. Fill in at least one of worker_type and kind, and both must be consistent when filled in at the same time. The same type cannot be repeated.

Path parameters

Field

Type

Required

Description

resource_id

string

Yes

Calculate the instance ID.

Request body

Field

Type

Required

Description

name

string or null

No

Instance name.

description

string or null

No

Example description.

kind

string or null

No

Compatible with aliases. When passed in, it should be consistent with worker_type.

spec_id

string or null

No

Calculate the spec ID.

cpu

integer or null

No

CPU configuration.

memory_gib

integer or null

No

Memory GiB configuration.

gpu

integer or null

No

GPU configuration.

worker_images

array of object or null

No

Worker image selection. When submitting this field, you must replace the original configuration with the complete list and overwrite all currently active worker_type.

worker_images[].worker_type

string

No

Worker type.

worker_images[].kind

string

No

Resource type. Compatible with aliases. When passed in, it should be consistent with worker_type.

worker_images[].image_id

string

Yes

Image ID. Required image ID for each image item.

worker_images[].platform

string

Yes

Run the platform. A single required platform value for each image entry, which must match the platforms supported by the image.

min_replicas

integer or null

No

Only 0 is accepted.

max_replicas

integer or null

No

The upper limit of copies must be greater than 0.

go_worker_image_id

string or null

No

Compatible Go Worker image ID.

python_worker_image_id

string or null

No

Compatible Python Worker image ID.

platform

string or null

Yes

A single required platform value for each image entry, which must match the platforms supported by the image.

auto_suspend_minutes

integer or null

No

Automatic pause waiting time.

Submit only the fields you want to modify.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "id": "cr-001",
    "name": "data-processing",
    "description": "updated",
    "spec_id": "task-standard-small",
    "min_replicas": 0,
    "max_replicas": 3,
    "current_replicas": 0,
    "status": "IDLE",
    "status_message": "",
    "workspace_id": "ws_01",
    "kind": "task",
    "cpu": 0,
    "memory_gib": 0,
    "gpu": 0,
    "cpu_milli": 0,
    "memory_mib": 0,
    "gpu_count": 0,
    "gpu_memory_mib": 0,
    "gpu_cores": 0,
    "desired_replicas": 0,
    "go_worker_image_id": "",
    "python_worker_image_id": "",
    "platform": "",
    "auto_suspend_minutes": 0,
    "scale_reason": "",
    "is_default": false,
    "created_by": "user_01",
    "allowed_actions": [],
    "created_at": "2026-10-14T00:00:00Z",
    "updated_at": "2026-10-14T00:00:00Z"
  }
}

Field

Type

Description

code

string

success code.

msg

string

Response information.

data

object

The data returned by this operation.

data.id

string

Calculate the instance ID.

data.workspace_id

string

The workspace ID to which it belongs.

data.name

string

Compute instance name.

data.description

string

Example description.

data.kind

string

Instance type. The values are task, query

data.spec_id

string

Current compute specification ID.

data.cpu

integer

CPU configuration value.

data.memory_gib

integer

Configuration value in GiB of memory.

data.gpu

integer

GPU configuration values.

data.cpu_milli

integer

CPU configuration value in millicores.

data.memory_mib

integer

Configuration value in MiB of memory.

data.gpu_count

integer

Number of GPUs.

data.gpu_memory_mib

integer

MiB of video memory for a single GPU.

data.gpu_cores

integer

Number of GPU cores.

data.min_replicas

integer

Serverless instance is fixed to 0

data.max_replicas

integer

Maximum number of copies.

data.current_replicas

integer

The current number of replicas.

data.desired_replicas

integer

Target number of copies.

data.go_worker_image_id

string

Go Worker image ID.

data.python_worker_image_id

string

Python Worker image ID.

data.worker_images

array of object

Worker image selection.

data.worker_images[].worker_type

string

Worker type.

data.worker_images[].kind

string

Resource type.

data.worker_images[].image_id

string

Image ID.

data.worker_images[].platform

string

Run the platform.

data.platform

string

Instance running platform.

data.auto_suspend_minutes

integer

Automatic pause waiting time.

data.scale_reason

string

The scaling reason provided by the server.

data.is_default

boolean

Whether it is the default computing instance of the workspace.

data.status

string

The updated current lifecycle state. The value is IAM_CREATE_PENDING, IDLE, DEPLOYING, SCALING, ACTIVE , DRAINING, SUSPENDED, TERMINATING, ERROR, DELETED

data.status_message

string

Supplementary status information.

data.created_by

string

Creator ID.

data.allowed_actions

array of string

Operation hints available for the current read identity.

data.last_activation_at

string or null

Last activation time.

data.last_active_at

string or null

Last active time.

data.created_at

string

Creation time. In RFC 3339 format.

data.updated_at

string

Last updated. In RFC 3339 format.

Error response

JSON
{
  "code": "UPDATE_FAILED",
  "msg": "服务器内部错误",
  "data": null
}

Field

Type

Description

code

string

error code.

msg

string

Error description.

data

null

Empty on error.

Common HTTP errors

HTTP status

Error code

Common cause

Recommended action

400

INVALID_PARAMS

Invalid request field, workspace, or operation precondition.

Fix the request parameters and submit again.

401

Unauthorized

Missing or invalid authentication credentials.

Check the credential type, expiration, and authentication header.

404

NOT_FOUND

The target object or required reference was not found.

Verify the object identifier, workspace, and current status.

409

COMPUTE_RESOURCE_NAME_EXISTS

Conflict in resource state, request payload, or concurrent modification.

Re-read the current state and version, then handle according to the latest result.

500

UPDATE_FAILED

Internal processing failed; write operations may have been partially applied.

Retain request and trace details, and verify the current state before retrying.

Last updated on