2019-09-10 13:32:51 -04:00
|
|
|
[role="xpack"]
|
2017-03-28 17:23:01 -04:00
|
|
|
[[managing-watches]]
|
|
|
|
== Managing Watches
|
|
|
|
|
|
|
|
{watcher} provides as set of APIs you can use to manage your watches:
|
|
|
|
|
2017-06-27 20:16:51 -04:00
|
|
|
* 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
|
2017-03-28 17:23:01 -04:00
|
|
|
|
|
|
|
[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
|
2018-12-19 17:53:37 -05:00
|
|
|
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.
|
2017-03-28 17:23:01 -04:00
|
|
|
|
|
|
|
For example, the following returns the first 100 watches:
|
|
|
|
|
2019-09-09 12:35:50 -04:00
|
|
|
[source,console]
|
2017-03-28 17:23:01 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
GET .watches/_search
|
|
|
|
{
|
|
|
|
"size" : 100
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[setup:my_active_watch]
|