fun functions new
Create a new function
Synopsis
This command creates a function. The function definition can be provided as a json file. If omitted, –project, –language and –description flags are required. Use –ask to provide missing parameters interactively. Optional parameters (connectors, variables, etc.) can be specified via flags (e.g. –connector, –variable).
It will locally link the created function with the name specified. That link will refer to the context specified with environment variables, or the context specified with the –context option, or ‘default’ if not specified. If the name already exists, it will return an error, unless the –override flag is specified.
fun functions new [name] (path/to/definition) [flags]
Options
--ask ask for missing parameters interactively
--connector stringArray IoT connector in inputTopicId:outputTopicId format (repeatable)
--context string context (default "default")
--description string function description (required without --ask or definition file)
-h, --help help for new
--language string function language (e.g. go, typescript) (required without --ask or definition file)
--override override existing configuration
--project int project ID
--variable stringArray function variable in KEY=VALUE format (repeatable)
Options inherited from parent commands
--config string config directory
SEE ALSO
- fun functions - Commands to interact with Functions API
Fundamentum