Help Center> FunctionGraph> API Reference> Function Data Zone API> Implementing Asynchronous Function Execution

Implementing Asynchronous Function Execution

Function

This API is used to implement asynchronous function execution. To ensure compatibility between v1 and v2 APIs, request_id in both snake and camel cases will be returned.

URI

POST /v2/{project_id}/fgs/functions/{function_urn}/invocations-async

Table 1 Path parameters

Parameter

Mandatory

Type

Description

function_urn

Yes

String

Function URN.

project_id

Yes

String

Tenant's project ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

{User defined key}

Yes

Map<String,>

Request body of the asynchronous function (JSON)

Response Parameters

Status code: 202

Table 3 Response body parameters

Parameter

Type

Description

request_id

String

Request ID of the asynchronous function.

Example Requests

POST https://{functiongraph_endpoint}/v2/7aad83af3e8d42e99ac194e8419e2c9b/fgs/functions/urn:fss:xxxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test:latest/invocations-async

{
  "message" : "Hello World"
}

Example Responses

Status code: 202

Accepted

{
  "request_id" : "1167bf8c-87b0-43ab-8f5f-26b16c64f252"
}

Status code: 404

Not Found

{
  "error_code" : "FSS.1051",
  "error_msg" : "Not found the function"
}

Status Codes

Status Code

Description

202

Accepted

404

Not Found

Error Codes

See Error Codes.