获取监控 API
编辑获取监控 API
编辑根据 ID 检索监控。
请求
编辑GET _watcher/watch/<watch_id>
路径参数
编辑-
<watch_id>
- (必需,字符串) 监控的标识符。
示例
编辑以下示例获取 ID 为 my_watch
的监控
resp = client.watcher.get_watch( id="my_watch", ) print(resp)
const response = await client.watcher.getWatch({ id: "my_watch", }); console.log(response);
GET _watcher/watch/my_watch
响应
{ "found": true, "_id": "my_watch", "_seq_no": 0, "_primary_term": 1, "_version": 1, "status": { "version": 1, "state": { "active": true, "timestamp": "2015-05-26T18:21:08.630Z" }, "actions": { "test_index": { "ack": { "timestamp": "2015-05-26T18:21:08.630Z", "state": "awaits_successful_execution" } } } }, "watch": { "input": { "simple": { "payload": { "send": "yes" } } }, "condition": { "always": {} }, "trigger": { "schedule": { "hourly": { "minute": [0, 5] } } }, "actions": { "test_index": { "index": { "index": "test" } } } } }