GetTask

Updated at:

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

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

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:

  • IMAGE: Image resource.

  • APP: Application resource.

  • SNAPSHOT: Snapshot resource.

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: Image creation. Queries tasks for manual creation, automatic creation, or creation based on an instance.

  • IMAGE_DISTRIBUTE: Image region distribution task.

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:

  • AUTO_ADAPT: Automatic adaptation.

  • AUTO_CREATE_IMAGE: Automatic image creation.

  • RETRY_ADAPT: Retry automatic adaptation.

  • RETRY_CREATE_IMAGE: Retry automatic image creation.

  • AUTO_OTA_IMAGE: Automatic image OTA.

  • AUTO_CREATE_VHD: Automatic VHD creation.

  • RETRY_VHD: Retry VHD creation.

  • AUTO_CREATE_IMAGE_VHD: Automatic VHD image creation.

  • RETRY_CREATE_IMAGE_VHD: Retry VHD image creation.

  • AUTO_VALIDATE_VHD: Automatic VHD validation.

  • RETRY_VALIDATE_VHD: Retry VHD validation.

  • SYNCHRONIZE_APP_IMAGE: Synchronize application image.

  • APPLY_VHD_BUILDER: Apply for VHD application recording environment.

  • RETRY_VHD_BUILDER: Retry applying for VHD recording environment.

  • ADAPT_AUTO: Automatic application adaptation creation.

  • ADAPT_AUTO_RETRY: Retry automatic application adaptation creation.

  • ADAPT_MANUAL: Manual application adaptation creation.

  • ADAPT_MANUAL_RETRY: Retry manual application adaptation creation.

  • IMAGE_AUTO: Automatic image creation.

  • IMAGE_AUTO_RETRY: Retry automatic image creation.

  • IMAGE_AUTO_VALIDATE: Automatic image validation.

  • IMAGE_AUTO_VALIDATE_RETRY: Retry automatic image validation.

  • IMAGE_MANUAL: Manual image creation.

  • IMAGE_MANUAL_RETRY: Retry manual image creation.

  • DESKTOP_CUSTOM_IMAGE: Create cloud desktop custom image.

  • DESKTOP_CUSTOM_IMAGE_RETRY: Retry creating cloud desktop custom image.

  • DESKTOP_SYNC_IMAGE: Synchronize cloud desktop image across regions.

  • DESKTOP_SYNC_IMAGE_RETRY: Retry synchronizing cloud desktop image across regions.

  • IMAGE_DISTRIBUTE: Distribute image to multiple regions.

  • IMAGE_DISTRIBUTE_RETRY: Retry image distribution.

  • IMAGE_FROM_INSTANCE: Create image based on instance.

  • IMAGE_FROM_INSTANCE_RETRY: Retry creating image based on instance.

  • SNAPSHOT_DISTRIBUTE: Distribute snapshot to multiple regions.

  • SNAPSHOT_DISTRIBUTE_RETRY: Retry snapshot distribution.

  • SNAPSHOT_FROM_DISK: Create snapshot based on disk.

  • SNAPSHOT_FROM_DISK_RETRY: Retry creating snapshot based on disk.

  • IMAGE_CLEAN_AND_CREATE: Create a temporary instance based on an image, and create the final image after cleanup.

  • IMAGE_CLEAN_AND_CREATE_RETRY: Retry creating the final image after cleanup.

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: CPU compute resource.

  • GPU: GPU compute resource.

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=,message=Builder environment deploy failed.]

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=,message=Builder environment deploy failed.]

Status

string

The execution status of the step.

Valid values:

  • RUNNING: The step is being executed.

  • SUCCESS: The step is executed successfully.

  • FAILED: The step fails to be executed.

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:

  • HOSTED: Hosted resource.

  • TEXT: Text resource.

  • URL: Resource provided through a URL.

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:

  • INIT: The task is initialized.

  • START: The task is being created or executed.

  • SUCCESS: The task is executed successfully.

  • FAILED: The task fails to be executed.

  • DELETED: The task is deleted.

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: Normal running mode.

  • COMPATIBLE: Compatible running mode.

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.