mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
1.5 KiB
Executable File
1.5 KiB
Executable File
Read this on the main serverless docs site
Spotinst Functions - Invoke
Invokes deployed function. It allows to send event data to the function, read logs and display other important information of the function invocation.
serverless invoke -f functionName
Pass Body Data
serverless invoke -f functionName --data "{}"
Pass Body data via file
serverless invoke -f functionName --path data.json
Example data.json
$ cat data.json
{
"Key": "Spotinst Functions is Value"
}
Options
--functionor-fThe name of the function in your service that you want to invoke. Required.--dataor-dString data to be passed as an event to your function. By default data is read from standard input.--pathor-pThe path to a json file with input data to be passed to the invoked function. This path is relative to the root directory of the service.--typeor-tThe type of invocation. EitherRequestResponse,EventorDryRun. Default isRequestResponse.--logor-lIf set totrueand invocation type isRequestResponse, it will output logging data of the invocation. Default isfalse.