Queries the information about an asynchronous task that meets specific conditions.
StatefulAsyncInvocation represents asynchronous tasks. Asynchronous tasks (StatefulAsyncInvocation) allow you to manage the states of asynchronous invocations. The asynchronous task feature is more suitable for task scenarios.
Request headers
This operation uses only common request headers. For more information, see Common parameters.
Request syntax
GET /services/{serviceName[.qualifier]}/functions/{functionName}/stateful-async-invocations/{statefulAsyncInvocationId} HTTP/1.1
Request parameters
Parameter | Type | Position | Required | Example | Description |
---|---|---|---|---|---|
serviceName | String | Path | Yes | service_name | The name of the service to which the asynchronous task belongs. |
functionName | String | Path | Yes | function_name | The name of the function whose asynchronous tasks you want to query. |
qualifier | String | Path | No | alias | The version or alias of the service to which the asynchronous task belongs. |
statefulAsyncInvocationId | String | Path | Yes | e026ae92-61e5-472f-b32d-1c9e3c4e**** | The ID of the asynchronous task. Note When you use an SDK to invoke a function, we recommend that you specify a business-related ID to facilitate subsequent operations. For example, you can use the video name as the invocation ID for a video-processing function. After that, you can use the ID to check whether the video is processed or terminate the processing of the video. The ID must start with a letter or an underscore (_), and can contain letters, digits, underscores (_), and hyphens (-). The ID can be up to 128 characters in length. Function Compute generates an ID for the asynchronous task if it is not specified. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
startedTime | Long | 2020-08-20T02:28:21Z | The start time of the asynchronous task. |
endTime | Long | 2020-08-20T02:38:21Z | The end time of the asynchronous task. |
functionName | String | function_name | The name of the function to which the asynchronous task belongs. |
qualifier | String | alias | The version or alias of the service to which the asynchronous task belongs. |
serviceName | String | service_name | The name of the service to which the asynchronous task belongs. |
invocationId | String | e026ae92-61e5-472f-b32d-1c9e3c4e**** | The ID of the asynchronous task. |
requestId | String | 403fcbd6-ec41-401f-9fa7-386f3d3d**** | The request ID of the asynchronous task. |
status | String | Succeeded | The state of the asynchronous task.
|
destinationStatus | String | Succeeded | The destination status of the asynchronous task. |
invocationErrorMessage | String | UnhandledException | The error message for the failed asynchronous task. |
InvocationPayload | String | hello world | The input of the asynchronous invocation task. |
alreadyRetriedTimes | Long | 3 | The maximum number of retries that is allowed after the asynchronous task fails. Default value: 3. Valid values: [0,8]. |
Examples
Sample requests
GET /2016-08-15/services/{serviceName[.qualifier]}/functions/function_name/stateful-async-invocations/e026ae92-61e5-472f-b32d-1c9e3c4e**** HTTP/1.1
Common request header
Sample success responses
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"functionName" : "function_name",
"qualifier" : "alias",
"serviceName" : "service_name",
"invocationId" : "e026ae92-61e5-472f-b32d-1c9e3c4e****",
"requestId" : "403fcbd6-ec41-401f-9fa7-386f3d3d****",
"status" : "Succeeded",
"destinationStatus" : "Succeeded",
"invocationErrorMessage" : "UnhandledException",
"InvocationPayload" : "function_name",
"alreadyRetriedTimes" : 3
}