Cancel a task

Last Updated: Jul 25, 2017

Description

A running task can be cancelled through this API. Currently, only the tasks of ImportImage and ExportImage type are supported.

Request parameters

Name Type Required Description
Action String Yes Operation interface name; value: CancelTask.
RegionId String Yes Region ID. See Regions and zones for region IDs.
TaskId String Yes Task ID

Return parameters

The return parameters are all public return parameters. For details, refer to Public return parameters.

Error codes

Error code Description HTTP status code Meaning
MissingParameter An input parameter RegionId that is mandatory for processing the request is not supplied. 400 The required parameter RegionId is missing. See Regions and zones for region IDs.
MissingParameter An input parameter TaskId that is mandatory for processing the request is not supplied. 400 The required parameter TaskId is absent.
InvalidRegionId.NotFound The specified region not found. 400 The specified RegionID does not exist. See Regions and zones for region IDs.
InvalidTaskId.NotFound The specified TaskId is not found. 400 The specified TaskId does not exist.
InvalidTaskId.TaskActionNotSupport The specified task action not support. 403 The specified Task cannot be cancelled.
InvalidTaskId.IncorrectTaskStatus The specified task status is not invalid. 403 The specified Task status is incorrect.
CancelTaskFailed The task is failed to cancel, Please contact the administrator. 403 Failed to cancel the task, please contact the administrator.

Example

Request example

  1. https://ecs.aliyuncs.com/?Action=CancelTask
  2. &RegionId=cn-hangzhou
  3. &TaskId=t-23ym6mvro
  4. &<Public Request Parameters>

Return Example

XML format

  1. <CancelTaskResponse>
  2. <RequestId>4BE2C7FE-C7A4-4675-A153-174E032AABFB</RequestId>
  3. </CancelTaskResponse>

JSON format

  1. {"RequestId": "4BE2C7FE-C7A4-4675-A153-174E032AABFB"}
Thank you! We've received your feedback.