2015-04-14 17:04:48 -04:00
|
|
|
---
|
|
|
|
"Test execute watch api with empty body":
|
|
|
|
- do:
|
|
|
|
cluster.health:
|
|
|
|
wait_for_status: green
|
|
|
|
|
|
|
|
- do:
|
2015-04-28 19:08:28 -04:00
|
|
|
watcher.put_watch:
|
2015-04-14 17:04:48 -04:00
|
|
|
id: "my_logging_watch"
|
|
|
|
body: >
|
|
|
|
{
|
2015-05-05 12:37:44 -04:00
|
|
|
"trigger" : {
|
|
|
|
"schedule" : { "cron" : "0 0 0 1 * ? 2099" }
|
2015-04-14 17:04:48 -04:00
|
|
|
},
|
|
|
|
"input" : {
|
2015-05-03 09:03:28 -04:00
|
|
|
"simple" : {
|
|
|
|
"count" : 1
|
2015-04-14 17:04:48 -04:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"condition" : {
|
2015-05-03 09:03:28 -04:00
|
|
|
"script" : "ctx.payload.count == 1"
|
2015-04-14 17:04:48 -04:00
|
|
|
},
|
|
|
|
"actions" : {
|
|
|
|
"Logging" : {
|
|
|
|
"logging" : {
|
|
|
|
"text" : "foobar"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- match: { _id: "my_logging_watch" }
|
|
|
|
|
|
|
|
- do:
|
2015-04-28 19:08:28 -04:00
|
|
|
watcher.execute_watch:
|
2015-04-14 17:04:48 -04:00
|
|
|
id: "my_logging_watch"
|
2015-05-06 11:51:10 -04:00
|
|
|
body: >
|
|
|
|
{
|
|
|
|
"trigger_event" : {
|
|
|
|
"schedule" : {
|
|
|
|
"scheduled_time" : "2015-05-05T20:58:02.443Z",
|
|
|
|
"triggered_time" : "2015-05-05T20:58:02.443Z"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-04-14 17:04:48 -04:00
|
|
|
|
|
|
|
- match: { "watch_id": "my_logging_watch" }
|
2015-05-03 09:03:28 -04:00
|
|
|
- match: { "watch_execution.condition_result.script.met": true }
|
2015-04-14 17:04:48 -04:00
|
|
|
- match: { "state": "executed" }
|
|
|
|
- match: { "watch_execution.actions_results.Logging.logging.success" : true }
|
|
|
|
- match: { "watch_execution.actions_results.Logging.logging.logged_text" : "foobar" }
|