Skip to main content

ListAsyncTasks

Retrieves a list of asynchronous tasks.

Try it now

You can run this API directly in OpenAPI Explorer, sparing you the trouble of calculating signatures. After a successful run, OpenAPI Explorer can automatically generate SDK code examples. Try it now

RAM authorization

The following table describes the authorization information for this API. You can use it in the Action element of a RAM permission policy statement to grant a RAM user or RAM role the permission to call this API. Details are as follows:
  • Action: The specific permission point.
  • Access level: The access level of each action. Valid values: Write, Read, or List.
  • Resource type: The resource types that support authorization for the action. Details are as follows:
    • Required resource types are marked with a leading *.
    • For actions that do not support resource-level authorization, All Resources is used.
  • Condition key: The condition keys defined by the cloud service itself.
  • Dependent action: The other permissions required to successfully perform the action. The caller must have the permissions of all dependent actions before the action can succeed.
ActionAccess levelResource typeCondition keyDependent action
aimiaobi:ListAsyncTaskslist
*All Resources
*
    None
None

Request parameters

NameTypeRequiredDescriptionExample
AgentKeystringYes

Workspace unique identifier: AgentKey

cd327c3d5d5e44159cc716e23bfa530e_p_beebot_public
TaskNamestringNo

A term query for the task name.

Task name
TaskCodestringNo

A term query for the task code.

MaterialDocumentUpload
TaskTypestringNo

A term query for the task type.

None
TaskStatusintegerNo

A term query for the task status (0: Pending, 1: Running, 2: Succeeded, 3: Paused, 4: Failed and retriable, 5: Failed and not retriable, 6: Canceled)

1
TaskStatusListarrayNo

A term query for a list of task statuses (0: Pending, 1: Running, 2: Succeeded, 3: Paused, 4: Failed and retriable, 5: Failed and not retriable, 6: Canceled)

TaskStatusListintegerNo

The task status.

1
TaskTypeListarrayNo

A term query for a list of task types.

TaskTypeListstringNo

The task category.

test
CreateTimeStartstringNo

The start time for querying task creation. Format: YYYY-MM-DD HH:mm:ss

2023-02-19 07:28:11
CreateTimeEndstringNo

The end time for querying task creation. Format: YYYY-MM-DD HH:mm:ss

2023-03-18 02:00:00
CurrentintegerNo

The current page number.

1
SizeintegerNo

The number of entries per page. Default value: 10.

10

Response elements

NameTypeDescriptionExample
object

PageResult

Codestring

The status code.

successful
Currentinteger

The current page.

1
Dataarray<object>

The returned data.

Dataobject

The list of tasks.

CreateTimestring

Creation date

2020-12-23 15:41:58
CreateUserstring

Created by

1111
Idlong

The primary key ID of the task.

1
TaskCodestring

The task identifier, which specifies the task.

MaterialDocumentUpload
TaskDefinitionstring

The optional task definition configuration in JSON format. These parameters overwrite the system's default configuration.

{}
TaskEndTimestring

The actual end time of the task.

2023-03-09 00:00:00
TaskErrorMessagestring

The error message from the task execution for the client.

Internal system error
TaskExecuteTimestring

The time when the task is scheduled to run. The system polls only for tasks that are due. If this parameter is empty, the task runs immediately.

2023-10-14 14:30:00
TaskIdstring

The unique task ID. It is equivalent to the Id parameter.

3f7045e099474ba28ceca1b4eb6d6e21
TaskInnerErrorMessagestring

The internal error message from the task execution. Sensitive information, such as exception stacks and internal thread stacks, is recorded here.

System error
TaskIntermediateResultstring

The intermediate result of the task execution. If a task consists of multiple steps, the output of each step can be saved here. When the task resumes from a paused state, it can read this intermediate result and continue execution.

{}
TaskNamestring

The task name.

Task name
TaskParamstring

The input parameters for the task execution, in JSON format.

{}
TaskProgressMessagestring

The progress information of the task execution.

{}
TaskResultstring

The result information of the task execution.

{}
TaskRetryCountstring

The number of times the task has been retried.

1
TaskStartTimestring

The actual start time of the task.

2023-03-20 10:53:00
TaskStatusinteger

The execution status of the task. Valid values: 0 (Pending), 1 (Running), 2 (Succeeded), 3 (Paused), 4 (Failed and retriable), 5 (Failed and not retriable), 6 (Canceled).

1
TaskTypestring

The task category. Multiple task categories are separated by commas.

test
UpdateTimestring

Update date

2023-02-16 10:29:16
UpdateUserstring

Updated by

111
HttpStatusCodeinteger

The HTTP status code.

200
Messagestring

The error description.

successful
RequestIdstring

The unique ID of the request.

428DCC0D-3C63-5306-BD1B-124396AB97BE
Sizeinteger

The number of records per page.

10
Successboolean

Indicates whether the request was successful: true for success, false for failure.

true
Totalinteger

The total number of records.

20

Examples

Success response JSON format
{
  "Code": "successful",
  "Current": 1,
  "Data": [
    {
      "CreateTime": "2020-12-23 15:41:58",
      "CreateUser": 1111,
      "Id": 1,
      "TaskCode": "MaterialDocumentUpload",
      "TaskDefinition": {},
      "TaskEndTime": "2023-03-09 00:00:00",
      "TaskErrorMessage": "系统内部错误",
      "TaskExecuteTime": "2023-10-14 14:30:00",
      "TaskId": "3f7045e099474ba28ceca1b4eb6d6e21",
      "TaskInnerErrorMessage": "系统错误",
      "TaskIntermediateResult": {},
      "TaskName": "任务名",
      "TaskParam": {},
      "TaskProgressMessage": {},
      "TaskResult": {},
      "TaskRetryCount": 1,
      "TaskStartTime": "2023-03-20 10:53:00",
      "TaskStatus": 1,
      "TaskType": "test",
      "UpdateTime": "2023-02-16 10:29:16",
      "UpdateUser": 111
    }
  ],
  "HttpStatusCode": 200,
  "Message": "successful",
  "RequestId": "428DCC0D-3C63-5306-BD1B-124396AB97BE",
  "Size": 10,
  "Success": true,
  "Total": 20
}

Error codes

For more error codes, visit Error Center.