All Products
Search
Document Center

Resource Orchestration Service:ListAITasks

Last Updated:May 14, 2025

Queries a list of AI tasks.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ros:ListAITaskslist
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.

U12WEI6Ro2ol3wA54rBNS3Cltv2VJyA+7hP4GqbIOhmWU5mWU9ZE3cXLgDaH4KSMRfIYcIVrvtHaAzCoyfo7VQ==
MaxResultsintegerNo

The maximum number of data entries to return.

50
TaskTypestringNo

The type of the AI task. You can filter AI tasks by task type.

  • GenerateTemplate: The AI task is used to generate a template.
  • FixTemplate: The AI task is used to fix a template.

If you leave this parameter empty, all task types are queried.

GenerateTemplate
TaskIdstringNo

The ID of the AI task. You can filter AI tasks by task ID.

t-asasas*****

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

B288A0BE-D927-4888-B0F7-B35EF84****
NextTokenstring

A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.

U12WEI6Ro2ol3wA54rBNS3Cltv2VJyA+7hP4GqbIOhmWU5mWU9ZE3cXLgDaH4KSMRfIYcIVrvtHaAzCoyfo7VQ==
Tasksarray<object>

The AI tasks.

object

The AI task.

TaskIdstring

The ID of the AI task.

t-asasas*****
TaskTypestring

The type of the AI task.

  • GenerateTemplate: The AI task is used to generate a template.
  • FixTemplate: The AI task is used to fix a template.
GenerateTemplate
Statusstring

The state of the AI task.

  • PENDING
  • WAITING
  • RUNNING
  • SUCCESS
  • FAILURE
RUNNING
StatusReasonstring

The reason why the AI task is in the state.

Handler execution unexpected failure
CreateTimestring

The time when the AI task was created. The time is displayed in UTC. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format.

2023-03-15T03:15:53
UpdateTimestring

The time when the AI task was updated. The time is displayed in UTC. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format.

2023-11-20T22:00:50
Promptstring

The description of the AI task.

Create an ECS instance and deploy the Nginx service.
HttpStatusCodeinteger

The HTTP status code.

200
Messagestring

The error message.

You are not authorized to complete this action.
Successstring

Indicates whether the request was successful. Valid values:

  • true
  • false
true

Examples

Sample success responses

JSONformat

{
  "RequestId": "B288A0BE-D927-4888-B0F7-B35EF84****",
  "NextToken": "U12WEI6Ro2ol3wA54rBNS3Cltv2VJyA+7hP4GqbIOhmWU5mWU9ZE3cXLgDaH4KSMRfIYcIVrvtHaAzCoyfo7VQ==",
  "Tasks": [
    {
      "TaskId": "t-asasas*****\n",
      "TaskType": "GenerateTemplate",
      "Status": "RUNNING",
      "StatusReason": "Handler execution unexpected failure\n",
      "CreateTime": "2023-03-15T03:15:53",
      "UpdateTime": "2023-11-20T22:00:50",
      "Prompt": "Create an ECS instance and deploy the Nginx service.\n"
    }
  ],
  "HttpStatusCode": 200,
  "Message": "You are not authorized to complete this action.",
  "Success": true
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history