Brian Murphy 7d98358012 Change the ManualTriggerEvent to wrap a TriggerEvent
This change changes the manual trigger event to be a wrapper for another `TriggerEvent`.
TriggerEvent is required field for the execute API either via setTriggerEvent on the request or requestBuilder in the java API or `trigger_event` in the REST API

Original commit: elastic/x-pack-elasticsearch@790bdb96a5
2015-05-06 16:59:26 -04:00

51 lines
1.3 KiB
YAML

---
"Test execute watch api with empty body":
- do:
cluster.health:
wait_for_status: green
- do:
watcher.put_watch:
id: "my_logging_watch"
body: >
{
"trigger" : {
"schedule" : { "cron" : "0 0 0 1 * ? 2099" }
},
"input" : {
"simple" : {
"count" : 1
}
},
"condition" : {
"script" : "ctx.payload.count == 1"
},
"actions" : {
"Logging" : {
"logging" : {
"text" : "foobar"
}
}
}
}
- match: { _id: "my_logging_watch" }
- do:
watcher.execute_watch:
id: "my_logging_watch"
body: >
{
"trigger_event" : {
"schedule" : {
"scheduled_time" : "2015-05-05T20:58:02.443Z",
"triggered_time" : "2015-05-05T20:58:02.443Z"
}
}
}
- match: { "watch_id": "my_logging_watch" }
- match: { "watch_execution.condition_result.script.met": true }
- match: { "state": "executed" }
- match: { "watch_execution.actions_results.Logging.logging.success" : true }
- match: { "watch_execution.actions_results.Logging.logging.logged_text" : "foobar" }