All Products
Search
Document Center

Function Compute:ListStatefulAsyncInvocations

Last Updated:Jun 02, 2023

Queries all asynchronous tasks that meet specific conditions.

Operation Description

The name of the service to which the asynchronous task belongs.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

GET /2021-04-06/services/{serviceName}/functions/{functionName}/stateful-async-invocations

Request parameters

ParameterTypeRequiredDescriptionExample
serviceNamestringYes

The error message returned for the asynchronous task.

demo-service
functionNamestringYes

The event triggered by the asynchronous task.

demo-function
qualifierstringNo

The number of retries after the asynchronous task fails.

LATEST
statusstringNo

The request ID of the asynchronous task.

Running
nextTokenstringNo

The ID of the instance that is used to run the asynchronous task.

caeba0****be03f84eb48b699f0a4883
limitintegerNo

The list of events that trigger the asynchronous task.

20
startedTimeBeginlongNo

The structure of the asynchronous task.

1640966400000
startedTimeEndlongNo

The latest version of Function Compute API.

1640966400000
sortOrderByTimestringNo

StatefulAsyncInvocation: asynchronous task. Asynchronous tasks allow you to manage the states on the basis of common asynchronous invocations, which is more suitable for task scenarios.

desc
invocationIdPrefixstringNo

Alibaba Cloud provides SDKs for multiple programming languages to help you integrate Alibaba Cloud services by using APIs. We recommend that you use an SDK to call API operations. This frees you from manual signature verification.

abcxxx
includePayloadbooleanNo

You can search for API operations, call and debug API operations online, and dynamically generate executable sample code for SDKs.

true
X-Fc-Account-IdstringNo

It is a tool used to manage and configure Alibaba Cloud resources. After simple installation and configuration, you can use Alibaba Cloud CLI to manage multiple Alibaba Cloud services and migrate your data and business to the cloud with ease.

188077086902****
X-Fc-Code-ChecksumstringNo

Alibaba Cloud CLI

1506052139770049xxxx
X-Fc-Log-TypestringNo

The time when Function Compute API is called.

Tail
X-Fc-Invocation-TypestringNo

The token used to obtain more results. If this parameter is left empty, all the results are returned.

Async
X-Fc-DatestringNo
  • true: returns the invocationPayload parameter in the response.
  • false: does not return the invocationPayload parameter in the response.
NoteThe invocationPayload parameter indicates the input parameters of an asynchronous task.
Sat, 14 Jul 2017 07:02:38 GMT
X-Fc-Trace-IdstringNo

The CRC-64 value of the function code package. This value is used to check data integrity. The value is automatically calculated by the tool.

abcxxx

Response parameters

ParameterTypeDescriptionExample
object

The order in which the returned asynchronous invocations are sorted. Valid values:

  • asc: in ascending order
  • desc: in descending order
nextTokenstring

The returned data.

8bj81uI8n****
invocationsarray

The version or alias of the service to which the asynchronous task belongs.

StatefulAsyncInvocation

The method used to return logs. Valid values:

  • Tail: returns the last 4 KB of logs that are generated for the current request.
  • None: does not return logs for the current request. This is the default value.
[{"functionName": "demo-function","serviceName": "demo-service","qualifier": "LATEST","invocationId": "id","status": "Succeeded","startedTime": 1640966400000,"endTime": 1640966500000,"destinationStatus": "Succeeded","invocationErrorMessage": "","invocationPayload": "","requestId": "id","alreadyRetriedTimes": 0,}]

Examples

Sample success responses

JSONformat

{
  "nextToken": "8bj81uI8n****",
  "invocations": [
    {
      "functionName": "functionName",
      "serviceName": "serviceName",
      "qualifier": "LATEST",
      "invocationId": "demo-id",
      "status": "Running",
      "startedTime": 1633449590000,
      "endTime": 1633449599000,
      "destinationStatus": "Succeeded",
      "invocationErrorMessage": "UnhandledInvocationError",
      "invocationPayload": "\"body\"",
      "alreadyRetriedTimes": 3,
      "requestId": "ABA740D4-********-882707EADC37",
      "instanceId": "D4-*******9FD1-882707E",
      "events": [
        {
          "eventId": 1,
          "status": "Enqueued",
          "timestamp": 1647420449721,
          "eventDetail": "{\"Error\":\"UnhandledInvocationError\"}"
        }
      ]
    }
  ]
}

Error codes

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

Change history

Change timeSummary of changesOperation
2021-06-30The input parameters of the API operation change.
Change itemChange content
Input ParametersThe input parameters of the API operation change.
    Added Input Parameters: X-Fc-Account-Id
    Added Input Parameters: X-Fc-Code-Checksum
    Added Input Parameters: X-Fc-Log-Type
    Added Input Parameters: X-Fc-Invocation-Type
    Added Input Parameters: X-Fc-Date
    Added Input Parameters: X-Fc-Trace-Id
2021-06-30The input parameters of the API operation change.
Change itemChange content
Input ParametersThe input parameters of the API operation change.
    Added Input Parameters: X-Fc-Account-Id
2021-06-30The input parameters of the API operation change.
Change itemChange content
Input ParametersThe input parameters of the API operation change.
    delete Input Parameters: X-Fc-Account-Id