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 $CLOUDSIGMA_API_BASE/compute-resources/{resource_id}/preflight-delete
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First query the computing instance details and confirm the instance to be deleted.
Set the operation-specific values used in the request:
$RESOURCE_ID: The computing instance ID to be deleted.
Deletions are not reversible and this check should always be performed first.
Request¶
curl "$CLOUDSIGMA_API_BASE/compute-resources/$RESOURCE_ID/preflight-delete" \
-H "X-API-Key: $CLOUDSIGMA_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 the regional endpoint, API key, and workspace ID. |
|
|
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.