Open chosun41 opened 6 years ago
Once the trigger is defined as alarm type, the trigger inputs are not propagated to actions:
I modified manifest to:
triggers:
meetPerson:
feed: /whisk.system/alarms/alarm
inputs:
name: string
place: string
children: integer
height: float
deployment to:
inputs:
name: Elrond
place: Rivendell
children: 3
height: 1.88
cron: "0 7 29,30 6 *"
wsk
activation returns:
"result": {
"details": "You have 0 children and are 0 m. tall.",
"greeting": "Hello, from "
}
instead of:
"result": {
"details": "You have 3 children and are 1.88 m. tall.",
"greeting": "Hello, Elrond from Rivendell"
}
the same behavior is seen with wsk
CLI:
wsk trigger create my-alarm-trigger-1 --feed /whisk.system/alarms/alarm --param name Priti --param place Home --param cron "* * * * *"
Creating rule:
wsk rule create my-rule-1 my-alarm-trigger-1 hello_world_package/hello_world_triggerrule
Fire trigger:
wsk trigger fire my-alarm-trigger-1
Result had no name and place assigned:
wsk activation get 1b150c7339ab4074950c7339ab40741a ... "result": {
"details": "You have 0 children and are 0 m. tall.",
"greeting": "Hello, from "
V/S Non Feed Trigger:
wsk trigger create my-no-alarm-trigger --param name Priti --param place Home
Creating rule with:
wsk rule create my-rule-2 my-no-alarm-trigger hello_world_package/hello_world_triggerrule
Fire trigger and check the result:
"details": "You have 0 children and are 0 m. tall.",
"greeting": "Hello, Priti from Home"
}
Confirmed with @beemarie that it does work through IBM Cloud Functions UI.
@pritidesai @beemarie
With alarm feed you need to use the parameter trigger_payload
For example:
wsk trigger create my-alarm-trigger-1 --feed /whisk.system/alarms/alarm --param cron "30 2 * * *" --param trigger_payload "{\"name\":\"Priti\",\"place\":\"Home\"}"
More info in the alarm docs: https://github.com/apache/incubator-openwhisk-package-alarms#firing-a-trigger-on-a-time-based-schedule-using-cron
thanks @csantanapr I talked to @dubee and tried the same with trigger_payload
without any success:
Trigger create with:
wsk trigger create locationUpdate --param name Odin --param place Asgard
Creates parameters under Parameters section in UI
But when I create alarm trigger with:
wsk trigger create periodic --feed /whisk.system/alarms/alarm --param cron "*/2 * * * *" --param trigger_payload "{\"name\":\"Odin\",\"place\":\"Asgard\"}"
doesnt show any parameters in UI
It does show payload on trigger with:
wsk trigger get periodic
"response": {
"result": {
"config": {
"cron": "*/2 * * * *",
"name": "periodic",
"namespace": "",
"payload": {
"name": "Odin",
"place": "Asgard"
}
},
the action should also show the trigger_payload. It will be under a param called payload
though just as it shows for trigger get.
@jasonpet nope action doesn't show such parameter, also, @dubee referenced couple of issues from CLI repo ...
basically have two triggers tied to same action, where i am trying to pass the inputs from triggers to the action. right now the action doesn't recognize the value of these trigger arguments.
followed the pattern on this site.
https://github.com/apache/incubator-openwhisk-wskdeploy/blob/master/docs/wskdeploy_triggerrule_trigger_bindings.md#triggers-and-rules
also this is what it says as far as my packages when i run "bx wsk package list"
packages /adam-johnson-sandbox_walmart-watering-dev/walmart_watering private /adam-johnson-sandbox_walmart-watering-dev/Bluemix_walmart-watering-dev-db_wsk private
can't attach yamls so stored in zip file the manifest and deploy.yml files yamls.zip