函数工作流 FUNCTIONGRAPH-函数:执行入口签名

时间:2025-02-18 14:55:40

执行入口签名

事件执行入口的签名如下:
function (event, context) { }
  • event

    如果函数由指定的APIG事件触发,则传递给执行入口的event如下:

    // JSON.parse(event)
    {
      events: {
        "body": "",
        "requestContext": {
            "apiId": "xxx",
            "requestId": "xxx",
            "stage": "RELEASE"
        },
        "queryStringParameters": {
            "responseType": "html"
        },
        "httpMethod": "GET",
        "pathParameters": {},
        "headers": {
            "accept-language": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2",
            "accept-encoding": "gzip, deflate, br",
            "x-forwarded-port": "443",
            "x-forwarded-for": "xxx",
            "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
            "upgrade-insecure-requests": "1",
            "host": "xxx",
            "x-forwarded-proto": "https",
            "pragma": "no-cache",
            "cache-control": "no-cache",
            "x-real-ip": "xxx",
            "user-agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0"
        },
        "path": "/apig-event-template",
        "isBase64Encoded": true
      }
    }
  • context

    context参数包含有关函数的运行时信息。例如:请求ID、临时AK、函数元数据。具体详情请参见开发事件函数

support.huaweicloud.com/devg-functiongraph/functiongraph_02_0741.html