GetTask
Queries the details of a task by task ID, or by resource information and task category.
Operation description
Supports two query methods:
By task ID: Pass TaskId. This method takes precedence over resource information queries.
By resource: Omit TaskId, and pass EntityId, EntityType, and TaskCategory. You can use EntityVersionId to specify the resource version.
The API returns the current task status and recorded step information. Determine the overall task result based on Status. The success of a single step does not mean the entire task is successful. You can call ListTaskStep to query the names and categories of image creation and application adaptation steps.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
appstreaming:GetTask |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| TaskId |
string |
No |
The task ID. If specified, the query prioritizes this ID, and resource information query conditions are no longer used for locating the task. |
tid-bp1example**** |
| EntityId |
string |
No |
The associated resource ID. If TaskId is not specified, you must provide EntityId, EntityType, and TaskCategory at the same time. The resource ID must match the selected resource type. |
imgc-bp1example**** |
| EntityVersionId |
string |
No |
The associated resource version ID. Used to specify the version when querying by resource. For image resources, enter the image version ID. |
iv-bp1example**** |
| EntityType |
string |
No |
The associated resource type. Required if TaskId is not specified. Valid values:
You must also select the applicable TaskCategory. The resource type itself does not mean that all task categories can be queried by resource. |
IMAGE |
| TaskType |
string |
No |
Not enabled. Do not pass this parameter. When querying a task, locate the task by using TaskId or resource information and TaskCategory. This parameter is not used for task filtering. The example "Not applicable (not enabled)" is only a description of the field status, not a valid parameter value. |
Not applicable (not enabled) |
| TaskCategory |
string |
No |
The task category when querying by resource. Required if TaskId is not specified. Valid values:
|
IMAGE_BUILDER |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response of the API call. |
||
| Data |
object |
The task details. |
|
| GmtCreate |
string |
The time when the task was created. The time is in ISO 8601 format, accurate to milliseconds, and the time zone offset is +00:00. |
2026-09-23T02:28:10.000+00:00 |
| GmtModified |
string |
The time when the task was last modified. The time is in ISO 8601 format, accurate to milliseconds, and the time zone offset is +00:00. |
2026-09-23T02:32:43.000+00:00 |
| AliUid |
integer |
The ID of the Alibaba Cloud account to which the resource belongs. |
100931896542**** |
| TaskId |
string |
The task ID. You can use it to call GetTask to query the task status. |
tid-bp1example**** |
| TaskType |
string |
The actual type of the task. Valid values:
|
IMAGE_MANUAL |
| SystemDiskSize |
integer |
The system cloud disk capacity of the task creation environment. Unit: GiB. |
80 |
| PerformanceType |
string |
The compute type of the task creation resource. Valid values:
|
CPU |
| Progress |
string |
Not enabled. Currently, no valid task progress is returned. Determine the task execution status based on Status, CurrentTaskStep, and TaskStepList. The example "Not applicable (not enabled)" is only a description of the field status, not an actual API return sample. |
Not applicable (not enabled) |
| CurrentTaskStep |
string |
The identifier of the step currently being executed in the task. You can call ListTaskStep to query the image creation and application adaptation steps. |
CREATE_BUILDER_ENV |
| CurrentTaskMessage |
string |
The prompt or execution result description of the current task step. |
[code=Builder.Failed,httpStatusCode= |
| TaskStepList |
array<object> |
The list of recorded task execution steps and results. |
|
|
object |
|||
| StartTime |
integer |
The start time of the step. It is a UNIX timestamp calculated from 1970-01-01T00:00:00Z. Unit: milliseconds. |
1790130490000 |
| EndTime |
integer |
The end time of the step. It is a UNIX timestamp calculated from 1970-01-01T00:00:00Z. Unit: milliseconds. This field may not be returned if the step has not ended. |
1790130491000 |
| TaskStep |
string |
The task step identifier corresponding to this record. You can call ListTaskStep to query the image creation and application adaptation steps. |
CREATE_BUILDER_ENV |
| TaskMessage |
string |
The prompt or execution result description of this step. |
[code=Builder.Failed,httpStatusCode= |
| Status |
string |
The execution status of the step. Valid values:
|
RUNNING |
| StepStartTime |
string |
The ISO 8601 string of the step start time, including the time zone offset. In the example, +08:00 indicates UTC+8. It represents the same time as StartTime and is parsed according to the offset in the return value. |
2026-09-23T10:28:10+08:00 |
| StepEndTime |
string |
The ISO 8601 string of the step end time, including the time zone offset. In the example, +08:00 indicates UTC+8. It represents the same time as EndTime and is parsed according to the offset in the return value. This field may not be returned if the step has not ended. |
2026-09-23T10:28:11+08:00 |
| SystemImageId |
string |
The ID of the base system image used in the task creation environment. |
imgc-bp1parent**** |
| ResourceList |
array<object> |
The list of resources used for task creation, which corresponds to the creation resources submitted when the task is created. |
|
|
object |
|||
| ResourceType |
string |
The provision method of the resource content. Valid values:
|
URL |
| Resource |
string |
The resource content corresponding to ResourceType. For the URL type, enter or return an accessible resource address. |
https://example.com/apps/business/setup.exe |
| Status |
string |
The overall status of the task. Valid values:
Deleted tasks are not included in the regular valid task query scope. |
START |
| RunMode |
string |
The running mode of the task creation environment. Valid values:
|
NORMAL |
| ExecuteRegion |
string |
The ID of the region where the task is actually executed. |
cn-hangzhou |
| Success |
boolean |
Indicates whether the request is processed successfully. A value of true indicates that the request is processed successfully. To determine whether an asynchronous task is completed, you must query the task status separately. |
|
| Code |
string |
The error code. Returned when the request fails. A successful response may not contain this field. |
InternalError |
| Message |
string |
The error or result message. Used to explain the cause when the request fails. A successful response may not contain this field. |
Internal error. |
| RequestId |
string |
The unique identifier of this request. You can provide this value for troubleshooting. |
01A1A962-5503-107B-AC8F-EBA85DF905AC |
Examples
Success response
JSON format
{
"Data": {
"GmtCreate": "2026-09-23T02:28:10.000+00:00",
"GmtModified": "2026-09-23T02:32:43.000+00:00",
"AliUid": 0,
"TaskId": "tid-bp1example****",
"TaskType": "IMAGE_MANUAL",
"SystemDiskSize": 80,
"PerformanceType": "CPU",
"Progress": "Not applicable (not enabled)",
"CurrentTaskStep": "CREATE_BUILDER_ENV",
"CurrentTaskMessage": "[code=Builder.Failed,httpStatusCode=,message=Builder environment deploy failed.]",
"TaskStepList": [
{
"StartTime": 1790130490000,
"EndTime": 1790130491000,
"TaskStep": "CREATE_BUILDER_ENV",
"TaskMessage": "[code=Builder.Failed,httpStatusCode=,message=Builder environment deploy failed.]",
"Status": "RUNNING",
"StepStartTime": "2026-09-23T10:28:10+08:00",
"StepEndTime": "2026-09-23T10:28:11+08:00"
}
],
"SystemImageId": "imgc-bp1parent****",
"ResourceList": [
{
"ResourceType": "URL",
"Resource": "https://example.com/apps/business/setup.exe"
}
],
"Status": "START",
"RunMode": "NORMAL",
"ExecuteRegion": "cn-hangzhou"
},
"Success": false,
"Code": "InternalError",
"Message": "Internal error.",
"RequestId": "01A1A962-5503-107B-AC8F-EBA85DF905AC"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.