Retry the compute instance operation¶
Retry the compute instance in the ERROR state. After success, the instance returns to IDLE and the Worker will not be redeployed immediately.
POST https://moi.matrixorigin.cn/newmoi/compute-resources/{resource_id}/retry
Preparation before calling¶
First query the calculation instance details and confirm that the instance status is ERROR. Prepare a personal access token with access to the target workspace, the target workspace ID, and the compute instance ID.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$RESOURCE_ID: The compute instance ID to retry the operation.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/compute-resources/$RESOURCE_ID/retry" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Compute instance ID. |
Successful response¶
When successful, 200 is returned, and data is the calculation instance object.
{
"code": "OK",
"msg": "OK",
"data": {
"id": "cr-001",
"name": "data-processing",
"spec_id": "task-standard-small",
"status": "IDLE",
"status_message": "",
"min_replicas": 0,
"max_replicas": 2,
"current_replicas": 0
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
string |
Compute instance ID. |
|
string |
ID of the workspace to which it belongs. |
|
string |
Compute instance name. |
|
string |
Example description; returned when there is a value. |
|
string |
Compute spec ID. |
|
string |
Instance type. |
|
integer |
CPU configuration value. |
|
integer |
Configuration value expressed in GiB of memory. |
|
integer |
GPU configuration value. |
|
integer |
CPU configuration value in millicores. |
|
integer |
Configuration value expressed in MiB of memory. |
|
integer |
Number of GPUs. |
|
integer |
MiB of video memory for a single GPU. |
|
integer |
Number of GPU cores. |
|
integer |
Serverless instances are fixed to |
|
integer |
Maximum number of copies. |
|
integer |
Number of target copies. |
|
integer |
The current number of copies. |
|
string |
Go Worker image ID; returned if there is a value. |
|
string |
Python Worker image ID; returned if there is a value. |
|
object[] |
Worker image selection; returned when there is a value. |
|
string |
Worker type. |
|
string |
Image ID. |
|
string |
Running platform. |
|
string |
Instance running platform; returned if there is a value. |
|
integer |
Automatic pause waiting time. |
|
boolean |
Whether it is the default computing instance of the workspace. |
|
string |
|
|
string |
Supplementary status information; returned if there is a value. |
|
string |
The scaling reason provided by the server; returned if there is a value. |
|
string |
Last activation time; returned if there is a value. |
|
string |
Last active time; returned if there is a value. |
|
string |
Creator ID; returned if there is a value. |
|
string |
Creation time; returned if there is a value. |
|
string |
Last updated time; returned if there is a value. |
In this document, [] after a type means an array; for example, object[] is an array of objects. In field paths, [] means each item in an array; for example, data.worker_images[].worker_type is the worker_type field of each item in data.worker_images.
Error response¶
{
"code": "RETRY_FAILED",
"msg": "请求参数无效",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The instance ID is invalid or the current status does not allow retry. |
Check the details first to confirm the failure reason and current status. |
|
— |
Missing or invalid access credentials. |
Check API Key and Workspace Header. |
|
|
The current identity does not have instance operation permissions. |
Requesting permission to |
|
|
The instance does not exist or does not belong to the current workspace. |
Check |
|
|
The instance state conflicts with the retry operation. |
Read the latest status before operating. |
|
|
The server failed to handle the retry. |
Try again later. |
Follow-up operations¶
Query calculation instance details and Query Worker runtime.