Skip to content

Outer Func Execution



post /api/v1/outer_function/execute

Overview

Initiate an execution request for the specified Func.

Body Request Parameter

Parameter Name Type Required Description
funcId string Y Function ID
Example: hello_world_msg
Allow null: False
funcBody json Function request body
Allow null: False
funcBody.kwargs json Function call dictionary parameters(**kwargs)
Example: {'msg': 'tom'}
Allow null: False
funcBody.options json Return type (default raw)
Allow null: False
funcBody.options.returnType enum Return type (default raw)
Example: jsonDumps
Allow null: False
Optional value: ['ALL', 'raw', 'repr', 'jsonDumps']

Supplementary Description of Parameters

Request Example

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": "guance__openapi.test",\n  "funcBody": {\n    "kwargs": {\n      "workspace_token": {},\n        "workspace_uuid": {},\n        "your_name": {\n          "default": "OpenAPI 用户"\n        }\n    }\n  }\n}' \
  --compressed

Response

{
    "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 用户\\\"\n    }\n  }\n}",
            "method": "POST",
            "url": "/api/v1/func/guance__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"
} 

Feedback

Is this page helpful? ×