All Products
Search
Document Center

Elastic Compute Service:DescribeTasks

Last Updated:Sep 20, 2026

Queries the progress of one or more asynchronous requests.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:DescribeTasks

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

PageNumber

integer

No

The page number of the query results.

Minimum value: 1.

Default value: 1.

1

PageSize

integer

No

The number of entries per page for a paged query.

Maximum value: 100.

Default value: 10.

10

RegionId

string

Yes

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

cn-hangzhou

TaskIds

string

No

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

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

TaskAction

string

No

The name of the API operation associated with the task. Valid values:

  • ImportImage: import an image.

  • ExportImage: export an image.

  • RedeployInstance: redeploy an ECS instance.

  • ModifyDiskSpec: change the type of a cloud disk.

  • ArchiveSnapshot: archive a snapshot.

ImportImage

TaskStatus

string

No

The task status. Valid values:

  • Finished: The task is complete.

  • Processing: The task is running.

  • Failed: The task has failed.

Default value: null.

Note

Only tasks in the Finished, Processing, or Failed state can be queried. Other values do not take effect.

Finished

StartTime

string

No

The beginning of the creation time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

2020-11-23T15:10:00Z

EndTime

string

No

The end of the creation time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

2020-11-23T15:16:00Z

ResourceIds

array

No

The resource IDs. Valid values of N: 1 to 100.

string

No

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

  • If TaskAction is set to ImportImage or ExportImage, the resource ID is an image ID.

  • If TaskAction is set to RedeployInstance, the resource ID is an ECS instance ID.

  • If TaskAction is set to ModifyDiskSpec, the resource ID is a cloud disk ID.

m-bp1i8huqm5u7****

TaskGroupId

string

No

The task group ID.

Note

This parameter is in invitational preview. When this parameter is specified, other query conditions do not take effect.

g-2ze2op2grqpclwu7****

Response elements

Element

Type

Description

Example

object

PageSize

integer

The number of entries per page.

10

PageNumber

integer

The page number of the current page in the paging query.

1

RequestId

string

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

TotalCount

integer

The total number of entries returned.

1

RegionId

string

The region ID.

cn-hangzhou

TaskSet

object

Task

array<object>

The collection of tasks.

object

CreationTime

string

The creation time. The time is displayed in ISO 8601 format in UTC.

2020-11-24T12:50Z

TaskStatus

string

The task status.

Finished

FinishedTime

string

The time when the task was completed. The time is displayed in ISO 8601 format in UTC.

2020-11-24T12:50Z

SupportCancel

string

Indicates whether the task can be canceled.

true

TaskId

string

The task ID.

t-bp1hvgwromzv32iq****

TaskAction

string

The task name.

ImportImage

ResourceId

string

The resource ID.

m-bp1i8huqm5u7****

Examples

Success response

JSON format

{
  "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 code

Error code

Error message

Description

400 MissingParameter An input parameter "RegionId" that is mandatory for processing the request is not supplied.
400 InvalidRegionId.NotFound The specified RegionId does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.