CancelTask

Last Updated: Dec 20, 2017

Description

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

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: CancelTask.
RegionId String Yes Region ID. See Regions and zones for region IDs.
TaskId String Yes Task ID.

Response parameters

The return parameters are all common response parameters. For more information, see Common parameters.

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

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. }
Thank you! We've received your feedback.