调用云函数
POST/v1/functions/:name
调用指定云函数。
Request
Path Parameters
name stringrequired
Possible values: Value must match regular expression ^[a-zA-Z][a-zA-Z0-9_-]{0,58}[a-zA-Z0-9]$
需要调用的函数名称
Header Parameters
X-Qualifier string
指定调用函数的版本,不填则按灰度规则调用
- application/json
Body
调用函数的请求参数,请求参数需为 JSON 对象
property name* any
Responses
- 200
- 400
- default
调用成功时返回
Response Headers
X-Request-Id string
请求ID
- application/json
- text/plain
- Schema
- Example (from schema)
- Echo
Schema
property name* any
{}
echo
{
"a": 1,
"b": 2
}
- Schema
- Text
Schema
string
text
Hello fn
函数调用出错时返回
Response Headers
X-Request-Id string
请求ID
- application/json
- Schema
- Example (from schema)
- ExecuteFail
Schema
code 错误码 (string)
message 错误信息 (string)
requestId 请求 ID (string)
{
"code": "string",
"message": "string",
"requestId": "string"
}
函数执行失败
{
"code": "FUNCTION_PARAM_INVALID",
"message": "bad http request body (e1xxxxxx-xxxx-xxxx-xxxx-xxxxxxf7yyyy). For more information, please refer to https://docs.cloudbase.net/error-code/service",
"requestId": "yyxxxxxx-yyyy-yyyy-zzzz-xxxxxxzzyyyy"
}
Response Headers
X-Request-Id string
请求ID
- application/json
- Schema
- Example (from schema)
- InvalidHost
Schema
code 错误码 (string)
message 错误信息 (string)
requestId 请求 ID (string)
{
"code": "string",
"message": "string",
"requestId": "string"
}
请求地址异常
{
"code": "INVALID_HOST",
"message": "xxx",
"requestId": "xxx"
}
Loading...