All Products
Search
Document Center

Elastic Compute Service:DescribeTasks

Last Updated:Feb 04, 2024

Queries the progress of one or more asynchronous requests.

Operation description

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
PageNumberintegerNo

The number of the page to return.

Page start from page 1.

Default value: 1.

1
PageSizeintegerNo

The number of entries to return on each page.

Maximum value: 100.

Default value: 10.

10
RegionIdstringYes

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

cn-hangzhou
TaskIdsstringNo

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

t-bp1hvgwromzv32iq****,t-bp179lofu2pv768w****
TaskActionstringNo

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

  • ImportImage
  • ExportImage
  • RedeployInstance
  • ModifyDiskSpec
ImportImage
TaskStatusstringNo

The state of the task. Valid values:

  • Finished
  • Processing
  • Failed

This parameter is empty by default.

Note The system only retrieves tasks in the Finished, Processing, and Failed states and ignores other values.
Finished
StartTimestringNo

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.

2020-11-23T15:10:00Z
EndTimestringNo

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.

2020-11-23T15:16:00Z
ResourceIdsarrayNo

The ID of resource N that is associated with the task. Valid values of N: 1 to 100.

  • If TaskAction is set to ImportImage or ExportImage, set the resource ID to an image ID.
  • If TaskAction is set to RedeployInstance, set the resource ID to an Elastic Compute Service (ECS) instance ID.
  • If TaskAction is set to ModifyDiskSpec, set the resource ID to a disk ID.
stringNo

The ID of resource N that is associated with the task. Valid values of N: 1 to 100.

  • If TaskAction is set to ImportImage or ExportImage, set the resource ID to an image ID.
  • If TaskAction is set to RedeployInstance, set the resource ID to an Elastic Compute Service (ECS) instance ID.
  • If TaskAction is set to ModifyDiskSpec, set the resource ID to a disk ID.
m-bp1i8huqm5u7****

Response parameters

ParameterTypeDescriptionExample
object
PageSizeinteger

The number of entries returned per page.

10
PageNumberinteger

The page number of the returned page.

1
RequestIdstring

The ID of the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
TotalCountinteger

The total number of entries returned.

1
RegionIdstring

The region ID of the task.

cn-hangzhou
TaskSetobject []

Details about the tasks.

CreationTimestring

The time when the task was created.

2020-11-24T12:50Z
TaskStatusstring

The state of the task.

Finished
FinishedTimestring

The time when the task was completed.

2020-11-24T12:50Z
SupportCancelstring

Indicates whether the task can be canceled.

true
TaskIdstring

The ID of the task.

t-bp1hvgwromzv32iq****
TaskActionstring

The name of the task.

ImportImage
ResourceIdstring

The ID of the resource.

m-bp1i8huqm5u7****

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400MissingParameterAn input parameter "RegionId" that is mandatory for processing the request is not supplied.-
400InvalidRegionId.NotFoundThe specified RegionId does not exist.The specified region ID does not exist.

For a list of error codes, visit the Service error codes.