OpenSearch/rest-api-spec/test/execute_watch/20_minimal_body.yaml

51 lines
1.3 KiB
YAML
Raw Normal View History

---
"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" }