외부 함수 실행¶
POST /api/v1/outer_function/execute
개요¶
지정된 Func 함수에 대한 실행 요청을 시작합니다.
본문 요청 매개변수¶
| 매개변수명 | 유형 | 필수 | 설명 |
|---|---|---|---|
| funcId | string | Y | 함수 ID 예시: hello_world_msg Null 허용: False |
| funcBody | json | 함수 요청 본문 Null 허용: False |
|
| funcBody.kwargs | json | 함수 호출 사전 매개변수 (**kwargs) 예시: {'msg': 'tom'} Null 허용: False |
|
| funcBody.options | json | 반환 유형 (기본값 raw) Null 허용: False |
|
| funcBody.options.returnType | custom_enum | 반환 유형 (기본값 raw) 예시: jsonDumps Null 허용: 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"
}