API получения watch
Возвращает watch по его ID.
Запрос
GET _watcher/watch/<watch_id>
Предварительные условия
- У вас должны быть
manage_watcherилиmonitor_watcherпривилегии кластера для использования этого API. Дополнительная информация в Привилегии безопасности.
Параметры пути
-
<watch_id> - (Обязательный, строка) Идентификатор watch.
Примеры
Следующий пример получает watch с my_watch id:
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"
}
}
}
}
} | Текущее состояние watch |
© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/7.17/watcher-api-get-watch.html