Invoke Cloud Function
POST/v1/functions/:name
Invoke the specified cloud function.
Request
Path Parameters
Possible values: Value must match regular expression ^[a-zA-Z][a-zA-Z0-9_-]{0,58}[a-zA-Z0-9]$
The name of the function to be invoked
Query Parameters
Possible values: [true
]
Set to true when invoking a web function. Choose either this parameter or the header parameter X-Tcb-Webfn=true
.
Header Parameters
Specifies the function version to invoke. If not provided, the function will be invoked according to grayscale rules.
Possible values: [true
]
Set to true when invoking a web function. Choose either this header or the query parameter webfn=true
.
- application/json
Body
Request parameters for invoking the function. The request parameters must be a JSON object.
Responses
- 200
- 400
- default
Returned on success
Response Headers
X-Request-Id string
Request ID
- application/json
- text/plain
- Schema
- Example (from schema)
- Echo
Schema
{}
{
"a": 1,
"b": 2
}
- Schema
- Text
Schema
string
Hello fn
Returned on function invocation error
Response Headers
X-Request-Id string
Request ID
- application/json
- Schema
- Example (from schema)
- ExecuteFail
Schema
{
"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"
}
General error message. See https://docs.cloudbase.net/error-code/service
Response Headers
X-Request-Id string
Request ID
- application/json
- Schema
- Example (from schema)
- InvalidHost
Schema
{
"code": "string",
"message": "string",
"requestId": "string"
}
{
"code": "INVALID_HOST",
"message": "xxx",
"requestId": "xxx"
}