This example builds upon the previous “hello world” example and shows how fixed values can be supplied to the input parameters of an Action.
It shows how to:
- declare input parameters on the action ‘
hello_world
’ using a single-line grammar. - add ‘
name
’ and ‘place
’ as input parameters with the fixed values “Sam
” and “the Shire
” respectively.
packages:
hello_world_package:
version: 1.0
license: Apache-2.0
actions:
hello_world_fixed_parms:
function: src/hello.js
inputs:
name: Sam
place: the Shire
$ wskdeploy -m docs/examples/manifest_hello_world_fixed_parms.yaml
$ wsk action invoke hello_world_package/hello_world_fixed_parms --blocking
The invocation should return an 'ok' with a response that includes this result:
"result": {
"greeting": "Hello, Sam from the Shire"
},
In this example:
- The value for the ‘
name
’ input parameter would be set to “Sam
”. - The value for the ‘
place
’ input parameter would be set to “the Shire
”. - The wskdeploy utility would infer that both ‘
name
’ and ‘place
’ input parameters to be of type ‘string
’.
The manifest file for this example can be found here:
For convenience, the Actions and Parameters grammar can be found here: