Cancel execution¶
Requests the cancellation of a SQL query that is still running for the current identity. After calling, check the execution status to confirm the results.
POST $CLOUDSIGMA_API_BASE/query/kill
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region.
Prepare personal access token and target workspace ID that can access the target workspace.
With an execution mode that returns the query ID while the query is still running Execute SQL, logging
query_idin the response.Query the SQL execution status to confirm that the query is still running.
Request body¶
Replace $CLOUDSIGMA_API_KEY, $WORKSPACE_ID and $QUERY_ID with actual values.
curl -X POST "$CLOUDSIGMA_API_BASE/query/kill" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d "{\"query_id\": \"$QUERY_ID\"}"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Query ID to cancel. |
Successful response¶
{
"code": 200,
"data": null
}
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
null |
This operation returns no data. |
Error response¶
{
"code": 500,
"message": "SQL 查询不存在"
}
Field |
Type |
Description |
|---|---|---|
|
integer or string |
SQL processing errors may be numeric status codes. Authentication or general service errors may be string error codes. |
|
string |
error message. |
Errors are encapsulated in two ways: The SQL processing path uses {“code”:400,”message”:”…”}. Authentication or general service error using {“code”:”ErrServer”,”msg”:”…”}. Both message and msg are readable error messages, which should be read based on the actual fields and cannot be judged only by the numerical code.