Help Center> FunctionGraph> API Reference (ME-Abu Dhabi Region)> Function Data Zone APIs> Implementing Asynchronous Function Invocation
Updated on 2022-02-22 GMT+08:00

Implementing Asynchronous Function Invocation

Function

This API is used to implement asynchronous function invocation.

URI

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

Table 1 describes the URI parameters.

Table 1 URI parameters

Parameter

Type

Mandatory

Description

project_id

String

Yes

Tenant's project ID.

function_urn

String

Yes

Function URN. See Function Model.

Request

Event in JSON format

Parameter

Type

Mandatory

Description

{Customized_key}

Map<String,String>

No

Function execution request body in JSON format.

Response

Table 2 describes the response parameter.

Table 2 Response parameter

Parameter

Type

Description

Body

JSON

Request ID.

Example

Example request

POST /v2/7aad83af3e8d42e99ac194e8419e2c9b/fgs/functions/urn:fss:xxxxxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test:latest/invocations-async HTTP/1.1

Example response

The format of the response for a successful request is as follows:

HTTP/1.1 202 Accepted
{"request_id": "e834cb5b-1b2b-4c6b-b41c-8bd10fd41826"}

The format of the response for a failed request is as follows:

HTTP/1.1 404 Not Found 
{"error_code":"FSS.0404","error_msg":"function 'test' not exist"}

The format of the response for disabling a function is as follows:

HTTP / 1.1 429  Disabled
{
	"error_code": "FSS.0429",
	"error_msg": "Function Disabled"
}

Status Code

See Status Codes.