2019-09-10 13:32:51 -04:00
|
|
|
[role="xpack"]
|
2017-03-28 17:23:01 -04:00
|
|
|
[[managing-watches]]
|
2019-09-30 13:18:50 -04:00
|
|
|
== Managing watches
|
2017-03-28 17:23:01 -04:00
|
|
|
|
|
|
|
{watcher} provides as set of APIs you can use to manage your watches:
|
|
|
|
|
2019-09-30 13:18:50 -04:00
|
|
|
* Use the <<watcher-api-put-watch,put watch API>> to add or update watches
|
|
|
|
* Use the <<watcher-api-get-watch,get watch API>> to retrieve watches
|
|
|
|
* Use the <<watcher-api-delete-watch,delete watch API>> to delete watches
|
|
|
|
* Use the <<watcher-api-activate-watch,activate watch API>> to activate watches
|
|
|
|
* Use the <<watcher-api-deactivate-watch,deactivate watch API>> to deactivate watches
|
|
|
|
* Use the <<watcher-api-ack-watch,ack watch API>> to acknowledge watches
|
2017-03-28 17:23:01 -04:00
|
|
|
|
|
|
|
[float]
|
|
|
|
[[listing-watches]]
|
2019-09-30 13:18:50 -04:00
|
|
|
=== Listing watches
|
2017-03-28 17:23:01 -04:00
|
|
|
|
|
|
|
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]
|