Queries the progress of one or more asynchronous requests.

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 DescribeTasks

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

PageNumber Integer No 1

The page number of the page to return.

Pages start from page 1.

Default value: 1.

PageSize Integer No 10

The number of entries to return on each page.

Maximum value: 100.

Default value: 10.

RegionId String Yes cn-hangzhou

The region ID of the task. You can call the DescribeRegions operation to query the most recent region list.

TaskIds String No t-bp1hvgwromzv32iq****,t-bp179lofu2pv768w****

The IDs of the tasks. You can specify up to 100 tasks at a time. Separate multiple task IDs with commas (,).

TaskAction String No ImportImage

The name of the operation that generates the task. Valid values:

  • ImportImage
  • ExportImage
  • RedeployInstance
  • ModifyDiskSpec
TaskStatus String No Finished

The status of the task. Valid values:

  • Finished
  • Processing
  • Failed

This parameter has no default value.

Note The system only retrieves tasks in the Finished, Processing, and Failed states and ignores other values.
StartTime String No 2020-11-23T15:10:00Z

The start point of the time period for which to query created tasks. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

EndTime String No 2020-11-23T15:16:00Z

The end point of the time period for which to query created tasks. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

Response parameters

Parameter Type Example Description
PageSize Integer 10

The number of entries returned per page.

PageNumber Integer 1

The page number of the returned page.

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

TotalCount Integer 1

The total number of entries returned.

RegionId String cn-hangzhou

The region ID of the task.

TaskSet Array of Task

Details about the tasks.

Task
CreationTime String 2020-11-24T12:50Z

The time when the task was created.

TaskStatus String Finished

The status of the task.

FinishedTime String 2020-11-24T12:50Z

The time when the task was completed.

SupportCancel String true

Indicates whether the task can be canceled.

TaskId String t-bp1hvgwromzv32iq****

The ID of the task.

TaskAction String ImportImage

The name of the task.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=DescribeTasks
&RegionId=cn-hangzhou
&PageNumber=1
&PageSize=10
&TaskIds=t-bp1hvgwromzv32iq****
&TaskAction=ImportImage
&TaskStatus=Finished
&StartTime=2020-11-23T15:10:00Z
&EndTime=2020-11-23T15:16:00Z
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeTasksResponse>
    <TotalCount>1</TotalCount>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
    <PageSize>10</PageSize>
    <PageNumber>1</PageNumber>
    <TaskSet>
        <Task>
            <TaskId>t-bp1hvgwromzv32iq****</TaskId>
            <TaskAction>ImportImage</TaskAction>
            <SupportCancel>true</SupportCancel>
            <CreationTime>2020-11-24T12:50Z</CreationTime>
            <TaskStatus>Finished</TaskStatus>
            <FinishedTime>2020-11-24T12:50Z</FinishedTime>
        </Task>
    </TaskSet>
    <RegionId>cn-hangzhou</RegionId>
</DescribeTasksResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "TotalCount" : 1,
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "PageSize" : 10,
  "PageNumber" : 1,
  "TaskSet" : {
    "Task" : [ {
      "TaskId" : "t-bp1hvgwromzv32iq****",
      "TaskAction" : "ImportImage",
      "SupportCancel" : true,
      "CreationTime" : "2020-11-24T12:50Z",
      "TaskStatus" : "Finished",
      "FinishedTime" : "2020-11-24T12:50Z"
    } ]
  },
  "RegionId" : "cn-hangzhou"
}

Error codes

HttpCode Error code Error message Description
400 MissingParameter An input parameter "RegionId" that is mandatory for processing the request is not supplied. The error message returned because the RegionId parameter is not specified.
400 InvalidRegionId.NotFound The specified RegionId does not exist. The error message returned because the specified value of the RegionId parameter does not exist.

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