CancelTask

Last Updated: Mar 28, 2018

Description

Cancels a specified active task. Currently, you can cancel the importing image action (ImportImage) and the exporting image action (ExportImage).

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: CancelTask.
RegionId String Yes The region ID. For more information, see Regions and zones, or call DescribeRegions to obtain the latest region list.
TaskId String Yes The task ID. You can call DescribeTasks to obtain the list of task IDs.

Response parameters

For more information about all the common response parameters, see Common parameters.

Examples

Request example

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

Response example

XML format

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

JSON format

  1. {
  2. "RequestId": "4BE2C7FE-C7A4-4675-A153-174E032AABFB"
  3. }

Error codes

Error code Error message HTTP status code Meaning
MissingParameter An input parameter “RegionId” that is mandatory for processing the request is not supplied. 400 You must specify the RegionId parameter.
MissingParameter An input parameter “TaskId” that is mandatory for processing the request is not supplied. 400 You must specify the TaskId parameter.
InvalidRegionId.NotFound The specified region not found. 400 The specified RegionId does not exist.
InvalidTaskId.NotFound The specified “TaskId” is not found. 400 The specified TaskId does not exist.
CancelTaskFailed The task is failed to cancel, Please contact the administrator. 403 Failed to cancel the task. Please open a ticket to contact us.
InvalidTaskId.IncorrectTaskStatus The specified task status is not invalid. 403 The specified task must be in the running status.
InvalidTaskId.TaskActionNotSupport The specified task action not support. 403 You cannot cancel the specified task.
Thank you! We've received your feedback.