All Products
Search
Document Center

Resource Orchestration Service:GetAITask

Last Updated:Aug 28, 2026

Queries the details of an AI task by task ID.

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

ros:GetAITask

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

TaskId

string

No

The ID of the AI task.

t-asasas*****

OutputOption

string

No

Specifies whether to return the TaskOutput parameter in the response. Valid values:

  • Enabled

  • Disabled (default)

Note

The TaskOutput value may be excessively long. If you do not need the task outputs, set OutputOption to Disabled to improve API response speed.

Disabled

Response elements

Element

Type

Description

Example

object

The response parameters.

TaskId

string

The ID of the AI task.

t-asasas*****

RequestId

string

The request ID.

14A07460-EBE7-47CA-9757-12CC4761D47A

TaskType

string

The type of the AI task.

  • GenerateTemplate: generates a template.

  • FixTemplate: fixes a template.

Valid values:

  • GenerateTemplate :

    GenerateTemplate

  • FixTemplate :

    FixTemplate

GenerateTemplate

Status

string

The state of the AI task.

  • PENDING

  • WAITING

  • RUNNING

  • SUCCESS

  • FAILURE

Valid values:

  • SUCCESS :

    SUCCESS

  • RUNNING :

    RUNNING

  • WAITING :

    WAITING

  • PENDING :

    PENDING

  • FAILURE :

    FAILURE

FAILURE

StatusReason

string

The reason why the AI task is in its current state.

Handler execution unexpected failure

TaskOutput

object

The outputs of the AI task, including the generated template.

"Result": { "ROSTemplateFormatVersion": "2015-09-01", }

Code

string

The error code.

Forbidden

HttpStatusCode

integer

The HTTP status code.

200

Message

string

The error message.

You are not authorized to complete this action.

Success

string

Whether the request was successful. Valid values:

  • true

  • false

true

Examples

Success response

JSON format

{
  "TaskId": "t-asasas*****\n",
  "RequestId": "14A07460-EBE7-47CA-9757-12CC4761D47A",
  "TaskType": "GenerateTemplate",
  "Status": "FAILURE",
  "StatusReason": "Handler execution unexpected failure",
  "TaskOutput": {
    "test": "test",
    "test2": 1
  },
  "Code": "Forbidden",
  "HttpStatusCode": 200,
  "Message": "You are not authorized to complete this action.",
  "Success": "true"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.