You can call this operation to cancel a running task.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CancelTask

The operation that you want to perform. Set the value to CancelTask.

TaskNo String Yes 7f217ae0-61f5-42e2-a1c3-42bad0124****

The ID of the task that you want to cancel.

Note You can call the QueryTaskList operation to query the task ID.
UserClientIp String No 127.0.0.1

The IP address of the client used by the user to initiate the request.

Lang String No en

The language of the error message to return. Valid values:

  • zh: Chinese
  • en: English

Default value: en

Response parameters

Parameter Type Example Description
RequestId String 010E55C9-C64C-4C85-9BB2-7C225ADA6C86

The ID of the request. Request IDs are unique.

Examples

Sample requests

http(s)://[Endpoint]/? Action=CancelTask
&TaskNo=7f217ae0-61f5-42e2-a1c3-42bad0124****
&<Common request parameters>

Sample success responses

XML format

<CancelTaskResponse>
  <code>200</code>
  <data>
        <RequestId>010E55C9-C64C-4C85-9BB2-7C225ADA6C86</RequestId>
        <HostId>domain.aliyuncs.com</HostId>
        <Code>200</Code>
        <Message>success</Message>
  </data>
  <name>TaskCancellSuccess</name>
  <message>success</message>
  <url>http://127.0.0.1/?AccessKeyId=gZzDFpukHf6ecLAq&amp;Action=CancelTask&amp;Format=JSON&amp;SignatureMethod=HMAC-SHA1&amp;SignatureNonce=25e7f0e5b399081ea10f874e399997f9&amp;SignatureVersion=1.0&amp;TaskNo=43ddadb0-29bc-4183-a0a3-2bede0d8c2e5&amp;Timestamp=2020-01-09T05%3A35%3A05Z&amp;Version=2018-01-29&amp;Signature=ag%2BU7yjbWdkJHC%2FNlbv5sjC6CfU%3D</url>
</CancelTaskResponse>

JSON format

{
  "code": "200",
  "data": {
    "RequestId": "010E55C9-C64C-4C85-9BB2-7C225ADA6C86",
    "HostId": "domain.aliyuncs.com",
    "Code": "200",
    "Message": "success"
  },
  "name": "TaskCancellSuccess",
  "message": "success",
  "url": "http://127.0.0.1/?AccessKeyId=gZzDFpukHf6ecLAq&Action=CancelTask&Format=JSON&SignatureMethod=HMAC-SHA1&SignatureNonce=25e7f0e5b399081ea10f874e399997f9&SignatureVersion=1.0&TaskNo=43ddadb0-29bc-4183-a0a3-2bede0d8c2e5&Timestamp=2020-01-09T05%3A35%3A05Z&Version=2018-01-29&Signature=ag%2BU7yjbWdkJHC%2FNlbv5sjC6CfU%3D"
}

Error codes

For a list of error codes, visit the API Error Center.