Lists asynchronous tasks.
Debugging
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:
- The required resource types are displayed in bold characters.
- 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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
fc:ListAsyncTasks | list | *All Resources * |
| none |
Request syntax
GET /2023-03-30/functions/{functionName}/async-tasks HTTP/1.1
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
functionName | string | Yes | The function name. | my-func |
prefix | string | No | The ID prefix of asynchronous tasks. If this parameter is specified, a list of asynchronous tasks whose IDs match the prefix is returned. | job- |
nextToken | string | No | 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. | MTIzNCNhYmM= |
limit | integer | No | The number of asynchronous tasks to return. The default value is 20. Valid values: [1,100]. | 10 |
qualifier | string | No | The version or alias of the function. | LATEST |
status | string | No | The state of asynchronous tasks. The following items list the states of an asynchronous task:
| Running |
startedTimeBegin | long | No | The start time of the period during which the asynchronous tasks are initiated. | 1640966400000 |
startedTimeEnd | long | No | The end time of the period during which the asynchronous tasks are initiated. | 1640966400000 |
sortOrderByTime | string | No | The order in which the returned asynchronous tasks are sorted.
| asc |
includePayload | boolean | No | Specifies whether to return input parameters of the asynchronous tasks. Valid values:
Note
The invocationPayload parameter indicates the input parameters of an asynchronous task.
| true |
Response parameters
Examples
Sample success responses
JSON
format
{
"nextToken": "",
"tasks": [
{
"alreadyRetriedTimes": 3,
"destinationStatus": "Succeeded",
"durationMs": 1000,
"endTime": 1633449590000,
"events": [
{
"eventDetail": "body",
"eventId": 1,
"status": "Succeeded",
"timestamp": 1647420449721
}
],
"functionArn": "acs:fc:cn-shanghai:1234/functions/my-func",
"instanceId": "D4-*******9FD1-882707E",
"qualifier": "prod",
"requestId": "e026ae92-61e5-472f-b32d-1c9e3c4e****",
"returnPayload": "result",
"startedTime": 1633449590000,
"status": "Running",
"taskErrorMessage": "UnhandledInvocationError",
"taskId": "e026ae92-61e5-472f-b32d-1c9e3c4e****",
"taskPayload": "body"
}
]
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-10-23 | The internal configuration of the API is changed, but the call is not affected | View Change Details |