OpenSearch/watcher/rest-api-spec/test/activate_watch/10_basic.yaml

82 lines
1.6 KiB
YAML

---
"Test activate watch api":
- do:
cluster.health:
wait_for_status: yellow
- do:
watcher.put_watch:
id: "my_watch"
master_timeout: "40s"
body: >
{
"trigger" : {
"schedule" : { "cron" : "0 0 0 1 * ? 2099" }
},
"input": {
"simple": {
"payload": {
"send": "yes"
}
}
},
"condition": {
"always": {}
},
"actions": {
"test_index": {
"index": {
"index": "test",
"doc_type": "test2"
}
}
}
}
- match: { _id: "my_watch" }
- do:
cluster.health:
wait_for_status: yellow
- do:
watcher.get_watch:
id: "my_watch"
- match: { found : true}
- match: { _id: "my_watch" }
- match: { _status.state.active: true }
- do:
watcher.deactivate_watch:
watch_id: "my_watch"
- match: { "_status.state.active" : false }
- do:
watcher.get_watch:
id: "my_watch"
- match: { found : true}
- match: { _id: "my_watch" }
- match: { _status.state.active: false }
- do:
watcher.activate_watch:
watch_id: "my_watch"
- match: { "_status.state.active" : true }
- do:
watcher.get_watch:
id: "my_watch"
- match: { found : true}
- match: { _id: "my_watch" }
- match: { _status.state.active: true }
- do:
watcher.delete_watch:
id: "my_watch"
- match: { found: true }