OpenSearch/x-pack/docs/en/watcher/managing-watches.asciidoc

37 lines
1.4 KiB
Plaintext
Raw Normal View History

[[managing-watches]]
== Managing Watches
{watcher} provides as set of APIs you can use to manage your watches:
* Use the {ref}/watcher-api-put-watch.html[Put Watch API] to add or update watches
* Use the {ref}/watcher-api-get-watch.html[Get Watch API] to retrieve watches
* Use the {ref}/watcher-api-delete-watch.html[Delete Watch API] to delete watches
* Use the {ref}/watcher-api-activate-watch.html[Activate Watch API] to activate watches
* Use the {ref}/watcher-api-deactivate-watch.html[Deactivate Watch API] to deactivate watches
* Use the {ref}/watcher-api-ack-watch.html[Ack Watch API] to acknowledge watches
[float]
[[listing-watches]]
=== Listing Watches
Currently there is not dedicated API for listing the stored watches. However,
since {watcher} stores its watches in the `.watches` index, you can list them
by executing a search on this index.
IMPORTANT: You can only perform read actions on the `.watches` index. You must
use the {watcher} APIs to create, update, and delete watches. If {es}
{security-features} are enabled, we recommend you only grant users
`read` privileges on the `.watches` index.
For example, the following returns the first 100 watches:
[source,js]
--------------------------------------------------
GET .watches/_search
{
"size" : 100
}
--------------------------------------------------
// CONSOLE
// TEST[setup:my_active_watch]