Check the calculation instance before deleting it¶
Check the active tasks and workflow bindings that need to be processed before deleting the compute instance.
GET https://moi.matrixorigin.cn/newmoi/compute-resources/{resource_id}/preflight-delete
Preparation before calling¶
First query the computing instance details and 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 computing instance ID to be deleted.
Deletions are not reversible and this check should always be performed first.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/compute-resources/$RESOURCE_ID/preflight-delete" \
-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. |
Successful response¶
Returns 200 on success, data lists active tasks and workflow bindings that still need to be processed.
{
"code": "OK",
"msg": "OK",
"data": {
"active_tasks": 1,
"active_task_ids": ["task-001"],
"bound_workflows": 1,
"bound_workflow_details": [
{
"id": "wf-001",
"name": "daily-load"
}
]
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
integer |
Number of active tasks. |
|
string[] |
Active task IDs; returned when active tasks exist. |
|
integer |
Number of bound workflows. |
|
object[] |
Bound workflow details; returned when bindings exist. |
|
string |
Workflow ID. |
|
string |
Workflow name. |
|
string[] |
The name of the node bound to this instance; returned if there is a value. |
In this document, [] after a type means an array; for example, string[] is an array of strings. In field paths, [] means each item in an array; for example, data.bound_workflow_details[].id is the id field of each item in data.bound_workflow_details.
Error response¶
{
"code": "PREFLIGHT_FAILED",
"msg": "Server error",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
— |
Missing or invalid access credentials. |
Check API Key and Workspace Header. |
|
|
The current identity does not have permission to query or delete instances. |
Use valid credentials, or contact your administrator for authorization. |
|
|
The instance does not exist or does not belong to the current workspace. |
Check |
|
|
The service was unable to complete dependency checking. |
Try again later; don’t skip checking before deleting. |
Follow-up operations¶
Process active tasks and workflow bindings first; pre-check again after there are no dependencies, and then Delete calculation instance.