外部関数の実行¶
POST /api/v1/outer_function/execute
概要¶
指定されたFunc関数に対して実行リクエストを送信します
Body リクエストパラメータ¶
| パラメータ名 | タイプ | 必須 | 説明 |
|---|---|---|---|
| funcId | string | Y | 関数ID 例: hello_world_msg 空欄許可: False |
| funcBody | json | 関数リクエストボディ 空欄許可: False |
|
| funcBody.kwargs | json | 関数呼び出しの辞書パラメータ(**kwargs) 例: {'msg': 'tom'} 空欄許可: False |
|
| funcBody.options | json | 戻り値のタイプ(デフォルトはraw) 空欄許可: False |
|
| funcBody.options.returnType | custom_enum | 戻り値のタイプ(デフォルトはraw) 例: jsonDumps 空欄許可: False 選択可能な値: ['ALL', 'raw', 'repr', 'jsonDumps'] |
パラメータ補足説明¶
リクエスト例¶
curl 'https://openapi.guance.com/api/v1/outer_function/execute' \
-H 'Content-Type: application/json' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-raw $'{\n "funcId": "example__openapi.test",\n "funcBody": {\n "kwargs": {\n "workspace_token": {},\n "workspace_uuid": {},\n "your_name": {\n "default": "OpenAPI User"\n }\n }\n }\n}' \
--compressed
レスポンス¶
{
"code": 200,
"content": {
"detail": {
"einfoTEXT": "redis.exceptions.DataError: Invalid input of type: 'dict'. Convert to a bytes, string, int or float first.",
"id": "task-4G5qTZol2lW2"
},
"error": 599.3,
"message": "Calling Function failed",
"ok": false,
"reason": "EFuncFailed",
"reqCost": 41,
"reqDump": {
"bodyDump": "{\n \\\"kwargs\\\": {\n \\\"workspace_token\\\": {},\n \\\"workspace_uuid\\\": {},\n \\\"your_name\\\": {\n \\\"default\\\": \\\"OpenAPI User\\\"\n }\n }\n}",
"method": "POST",
"url": "/api/v1/func/example__openapi.test"
},
"reqTime": "2022-09-08T03:54:24.529Z",
"respTime": "2022-09-08T03:54:24.570Z",
"traceId": "TRACE-16435F71-4C2E-4026-A5D8-0B6B9ADD23AE"
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-16435F71-4C2E-4026-A5D8-0B6B9ADD23AE"
}