Resume a compute resource¶
Resume a target compute instance as a configured administrator and return the instance reread after the operation.
POST https://api.moi.matrixorigin.cn/v5/admin/compute-resources/{id}/resume
Before you call this API¶
Prepare a valid identity for this deployment, configured compute specification administrator privileges, and an accessible authentication Workspace. Workspace Owner status or a Genesis administration scope is insufficient. Replace example IDs with targets you are authorized to read or operate on. See Compute Instances.
First confirm that the parent instance is SUSPENDED. CAS against the expected previous state resets the parent target state to IDLE, followed by a separate read-back. This call does not start Workers. Concurrent operations may change the read-back result; verify the response and subsequent runtime state. Current typed compute resource models in all three clients omit nonempty py_requirements_txt/sha response fields; separately verify compatibility for instances with custom dependencies. Retain the raw HTTP status and response. If client decoding fails, query the state first rather than assuming that the operation did not occur.
Request parameters¶
curl -X POST "https://api.moi.matrixorigin.cn/v5/admin/compute-resources/cr-example/resume" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $AUTH_WORKSPACE_ID"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes in this example |
A valid personal access token for an identity configured as a compute specification administrator in this deployment. |
|
string |
Yes |
One nonempty authentication Workspace accessible to the current principal; not a target instance Workspace filter. |
|
string |
Yes |
Target instance ID. The service resolves its actual Workspace from this ID. |
This API does not read a business request body. Do not submit the target Workspace or state through the body.
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"id": "cr-example",
"workspace_id": "target-workspace",
"name": "示例实例",
"description": "",
"kind": "task",
"spec_id": "spec-example",
"cpu": 1,
"memory_gib": 4,
"gpu": 0,
"cpu_milli": 1000,
"memory_mib": 4096,
"gpu_count": 0,
"gpu_memory_mib": 0,
"gpu_cores": 0,
"min_replicas": 0,
"max_replicas": 2,
"current_replicas": 0,
"desired_replicas": 0,
"go_worker_image_id": "",
"python_worker_image_id": "",
"worker_images": [
{
"worker_type": "python-worker",
"image_id": "image-example",
"platform": "linux"
}
],
"platform": "linux",
"auto_suspend_minutes": 30,
"scale_reason": "manual_resume",
"is_default": false,
"status": "IDLE",
"status_message": "",
"created_by": "creator-example",
"allowed_actions": [],
"created_at": "2026-11-12T07:00:00Z",
"updated_at": "2026-11-12T07:00:00Z"
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
OK on success. |
|
string |
OK on success. |
|
object |
Data read now or after the operation. |
|
string |
Compute instance ID. |
|
string |
The instance’s actual Workspace, separate from the authentication header. |
|
string |
Instance name. |
|
string |
Instance description; may be an empty string. |
|
string |
task or query. |
|
string |
Associated specification ID. |
|
integer |
Legacy CPU specification field, in cores; do not confuse it with cpu_milli. |
|
integer |
Legacy memory specification field, in GiB. |
|
integer |
Legacy GPU specification field. |
|
integer |
Specification CPU, in millicores. |
|
integer |
Specification memory, in MiB. |
|
integer |
Specification GPU count. |
|
integer |
Specification GPU memory, in MiB. |
|
integer |
Specification GPU core field. |
|
integer |
Configured minimum replica field; not the currently observed replica count. |
|
integer |
Replica limit for each Worker type, not a combined limit across all types. |
|
integer |
Aggregate current instance replica field; separate from per-type observations. |
|
integer |
Target instance replica field; does not indicate readiness. |
|
string |
Legacy Go Worker image ID; may be empty. |
|
string |
Legacy Python Worker image ID; may be empty. |
|
object (array of objects), optional |
Optional images selected by Worker type. See the item fields below. |
|
string |
Worker platform configuration. |
|
integer |
Configured automatic suspension delay in minutes; not a duration guarantee for this operation. |
|
string |
Most recent scaling or lifecycle reason. |
|
boolean |
Whether this is the default instance; may be false. |
|
string |
Parent instance state. Current models include IDLE, DEPLOYING, SCALING, ACTIVE, DRAINING, SUSPENDED, TERMINATING, ERROR, and others. Do not conflate this with Worker states. |
|
string |
Status text; may be empty. |
|
string, optional |
Optional saved Python dependency text. May be returned when nonempty; not declared in current typed SDK models. |
|
string, optional |
Optional saved dependency content hash; not declared in current typed SDK models. |
|
object, optional |
The DTO declares an optional observation object, but the current converters for these three lifecycle operations do not populate it. Do not rely on this field for installation progress. |
|
string |
Creating principal. |
|
string (array of strings) |
Allowed-action projection. These three lifecycle operations do not construct actions separately; an empty array does not determine administrator eligibility. |
|
string, optional |
Most recent activation time in RFC3339; omitted when unrecorded. |
|
string, optional |
Most recent activity time in RFC3339; omitted when unrecorded. |
|
string |
Creation time in RFC3339. |
|
string |
Update time in RFC3339; not a caller-supplied concurrency version. |
See Shared objects for nested images, declared observation objects, and parent/Worker state relationships.
Error responses¶
{"code":"INVALID_PARAMS","msg":"invalid compute resource request","data":null}
Field |
Type |
Description |
|---|---|---|
|
string |
Distinguished by failure stage and operation. |
|
string |
Error text; some branches are localized and do not expose unclassified underlying errors. |
|
null |
This example uses null; shared authentication error branches may omit it. |
HTTP / code |
Conditions and handling |
|---|---|
400 / INVALID_PARAMS |
Missing authentication Workspace, principal, or resource ID. |
403 / ErrForbidden |
The authorization boundary rejects administrator eligibility, the current principal, or Workspace access. |
503 / ErrServiceUnavailable |
Classified shared authorization unavailability; does not apply to every directory failure. |
404 / RESUME_ADMIN_FAILED |
Target instance not found. This branch uses a different machine code from the runtime query’s NOT_FOUND. |
409 / CANNOT_RESUME |
The parent instance does not satisfy the SUSPENDED prerequisite. |
409 / LIFECYCLE_CONFLICT |
Resume/retry CAS against the expected state conflicts with a concurrent change. |
409 / RESOURCE_BUSY |
Classified lifecycle lease loss or ongoing Cloud teardown. Check the original operation first. |
503 / RESUME_ADMIN_FAILED |
Classified as runtime service not configured. |
500 / RESUME_ADMIN_FAILED |
An unclassified stop, state write, read-back, or directory fact failure. Check the actual state after the error. |
See Errors and recovery for differences between handlers, identities, and recovery stages.