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
|
|
|
|
2020-07-23 12:42:33 -04:00
|
|
|
[discrete]
|
2017-03-28 17:23:01 -04:00
|
|
|
[[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
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
Deprecate REST access to System Indices (#63274) (Original #60945)
This PR adds deprecation warnings when accessing System Indices via the REST layer. At this time, these warnings are only enabled for Snapshot builds by default, to allow projects external to Elasticsearch additional time to adjust their access patterns.
Deprecation warnings will be triggered by all REST requests which access registered System Indices, except for purpose-specific APIs which access System Indices as an implementation detail a few specific APIs which will continue to allow access to system indices by default:
- `GET _cluster/health`
- `GET {index}/_recovery`
- `GET _cluster/allocation/explain`
- `GET _cluster/state`
- `POST _cluster/reroute`
- `GET {index}/_stats`
- `GET {index}/_segments`
- `GET {index}/_shard_stores`
- `GET _cat/[indices,aliases,health,recovery,shards,segments]`
Deprecation warnings for accessing system indices take the form:
```
this request accesses system indices: [.some_system_index], but in a future major version, direct access to system indices will be prevented by default
```
2020-10-06 15:41:40 -04:00
|
|
|
// TEST[skip:deprecation warning]
|