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.

HTTP
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.

  1. Prepare personal access token and target workspace ID that can access the target workspace.

  2. With an execution mode that returns the query ID while the query is still running Execute SQL, logging query_id in the response.

  3. 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.

Shell
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

query_id

string

Yes

Query ID to cancel.

Successful response

JSON
{
  "code": 200,
  "data": null
}

Field

Type

Description

code

integer

200 on success.

data

null

This operation returns no data.

Error response

JSON
{
  "code": 500,
  "message": "SQL 查询不存在"
}

Field

Type

Description

code

integer or string

SQL processing errors may be numeric status codes. Authentication or general service errors may be string error codes.

message

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.

Last updated on