Canceling the Execution of a SparkSql Job
Function
This API is used to cancel a running or queued SparkSql job. It is synchronous. Only jobs in the QUEUED or RUNNING state can be canceled. After a successful call, the cancellation result is returned directly.
Calling Method
For details, see Calling APIs.
URI
POST /v2/workspaces/{workspace_id}/spark-sqls/{statement_id}/cancel
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| workspace_id | Yes | String | Definition: Workspace ID, used for resource isolation. This can be viewed on the workspace page of the console. Constraints: N/A Range: 32 to 36 characters. Only letters, digits, and hyphens (-) are allowed. Default Value: N/A |
| statement_id | Yes | String | Definition: Spark SQL job ID, used to uniquely identify a SparkSql job execution. It can be obtained from the statement_id in the response of the API for executing a Spark SQL job or from the API for listing Spark SQL jobs. Constraints: N/A Range: 1 to 64 characters. Only hexadecimal characters, hyphens (-), and underscores (_) are allowed. Default Value: N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition: User token. It is obtained by calling the Obtaining an IAM User Token API. Constraints: N/A Range: The value can contain a maximum of 65,534 characters, with no character type restrictions. Default Value: N/A |
Response Parameters
Status code: 204
None
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code, used to identify a specific error type. Range: 0 to 64 characters. |
| error_msg | String | Definition: Error description, used to explain the cause of an error. Range: 0 to 512 characters. |
| solution_msg | String | Definition: Solution description. Range: 0 to 4,096 characters. |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code, used to identify a specific error type. Range: 0 to 64 characters. |
| error_msg | String | Definition: Error description, used to explain the cause of an error. Range: 0 to 512 characters. |
| solution_msg | String | Definition: Solution description. Range: 0 to 4,096 characters. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code, used to identify a specific error type. Range: 0 to 64 characters. |
| error_msg | String | Definition: Error description, used to explain the cause of an error. Range: 0 to 512 characters. |
| solution_msg | String | Definition: Solution description. Range: 0 to 4,096 characters. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code, used to identify a specific error type. Range: 0 to 64 characters. |
| error_msg | String | Definition: Error description, used to explain the cause of an error. Range: 0 to 512 characters. |
| solution_msg | String | Definition: Solution description. Range: 0 to 4,096 characters. |
Example Requests
Cancel a specified Spark SQL job by specifying the statement_id.
POST /v2/workspaces/{workspace_id}/spark-sqls/{statement_id}/cancel Example Responses
Status code: 204
None
Status code: 400
{
"error_code" : "AIDataLake.01011001",
"error_msg" : "Invalid parameter statement_id",
"solution_msg" : "Please check the input parameters according to the documentation(statement_id for spark sql)."
} Status code: 401
{
"error_code" : "AIDataLake.01011003",
"error_msg" : "auth token not exists in header",
"solution_msg" : "Please check if auth token is included in the request header."
} Status code: 403
{
"error_code" : "AIDataLake.01011005",
"error_msg" : "current account has no permission",
"solution_msg" : "Please connect administrators to add permission."
} Status code: 500
{
"error_code" : "AIDataLake.01010001",
"error_msg" : "Internal system error",
"solution_msg" : "Contact operations for analysis."
} Status Codes
| Status Code | Description |
|---|---|
| 204 | The SparkSql job is canceled. No response parameters are returned. |
| 400 | Invalid request parameter. |
| 401 | Authentication failed. |
| 403 | Insufficient permissions. |
| 500 | Internal server error. |
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot