Delete calculation instance¶
Delete the compute instance in the current workspace.
DELETE https://moi.matrixorigin.cn/newmoi/compute-resources/{resource_id}
Preparation before calling¶
Check before deleting to confirm the instance to be deleted. 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 be deleted.
force=true will require the server to forcibly handle dependencies, and its impact should be confirmed before use.
Request example¶
curl -X DELETE "https://moi.matrixorigin.cn/newmoi/compute-resources/$RESOURCE_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The ID of the computing instance to be deleted. |
Query parameters¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
boolean |
No |
Request forced deletion when passing |
Successful response¶
Returns 200 on success, data is null.
{
"code": "OK",
"msg": "OK",
"data": null
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
null |
Fixed to |
Error response¶
{
"code": "DELETE_FAILED",
"msg": "请求参数无效",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
|
First execute CHECK before deleting. |
|
— |
Missing or invalid access credentials. |
Check API Key and Workspace Header. |
|
|
The current identity does not have the permission to delete the instance. |
Use valid credentials, or contact your administrator for authorization. |
|
|
The instance does not exist or does not belong to the current workspace. |
Check |
|
|
There are still active tasks or binding relationships, and they cannot be deleted based on the current conditions. |
Retry after processing check results; only use |
|
|
The server failed to delete the instance. |
Record the request time and error message and try again. |
Follow-up operations¶
Re-List calculation instances to confirm that the resource is no longer visible.