API получения наблюдения
Получает наблюдение по его идентификатору.
Запрос
GET _watcher/watch/<watch_id>
Предварительные условия
- У вас должны быть
manage_watcherилиmonitor_watcherправа доступа к кластеру для использования данного API. Дополнительную информацию см. в Правах доступа к безопасности.
Параметры пути
-
<watch_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"
}
}
}
}
} | Текущее состояние наблюдения |
© 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/8.17/watcher-api-get-watch.html