2017-06-27 20:16:51 -04:00
|
|
|
[role="xpack"]
|
2017-03-29 12:07:55 -04:00
|
|
|
[[watcher-api-delete-watch]]
|
2018-12-20 13:23:28 -05:00
|
|
|
=== Delete watch API
|
|
|
|
++++
|
|
|
|
<titleabbrev>Delete watch</titleabbrev>
|
|
|
|
++++
|
2017-03-29 12:07:55 -04:00
|
|
|
|
2019-09-05 14:19:35 -04:00
|
|
|
Removes a watch from {watcher}.
|
2017-09-14 16:01:47 -04:00
|
|
|
|
2019-09-05 14:19:35 -04:00
|
|
|
[[watcher-api-delete-watch-request]]
|
|
|
|
==== {api-request-title}
|
2017-09-14 16:01:47 -04:00
|
|
|
|
2018-12-08 13:57:16 -05:00
|
|
|
`DELETE _watcher/watch/<watch_id>`
|
2017-09-14 16:01:47 -04:00
|
|
|
|
2019-09-05 14:19:35 -04:00
|
|
|
[[watcher-api-delete-watch-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
|
|
|
|
|
|
|
* You must have `manage_watcher` cluster privileges to use this API. For more
|
|
|
|
information, see {stack-ov}/security-privileges.html[Security privileges].
|
|
|
|
|
|
|
|
[[watcher-api-delete-watch-desc]]
|
|
|
|
==== {api-description-title}
|
2017-09-14 16:01:47 -04:00
|
|
|
|
|
|
|
When the watch is removed, the document representing the watch in the `.watches`
|
|
|
|
index is gone and it will never be run again.
|
2017-03-29 12:07:55 -04:00
|
|
|
|
|
|
|
Please note that deleting a watch **does not** delete any watch execution records
|
|
|
|
related to this watch from the watch history.
|
|
|
|
|
|
|
|
IMPORTANT: Deleting a watch must be done via this API only. Do not delete the
|
2017-09-14 16:01:47 -04:00
|
|
|
watch directly from the `.watches` index using the Elasticsearch
|
2018-12-19 17:53:37 -05:00
|
|
|
DELETE Document API. When {es} {security-features} are enabled, make
|
|
|
|
sure no `write` privileges are granted to anyone over the `.watches`
|
|
|
|
index.
|
2017-03-29 12:07:55 -04:00
|
|
|
|
2019-09-05 14:19:35 -04:00
|
|
|
[[watcher-api-delete-watch-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
|
|
|
`<watch_id>`::
|
|
|
|
(Required, string) Identifier for the watch.
|
|
|
|
|
|
|
|
//[[watcher-api-delete-watch-query-params]]
|
|
|
|
//==== {api-query-parms-title}
|
2017-09-14 16:01:47 -04:00
|
|
|
|
2019-09-05 14:19:35 -04:00
|
|
|
//[[watcher-api-delete-watch-request-body]]
|
|
|
|
//==== {api-request-body-title}
|
2017-09-14 16:01:47 -04:00
|
|
|
|
2019-09-05 14:19:35 -04:00
|
|
|
//[[watcher-api-delete-watch-response-body]]
|
|
|
|
//==== {api-response-body-title}
|
2017-09-14 16:01:47 -04:00
|
|
|
|
2019-09-05 14:19:35 -04:00
|
|
|
//[[watcher-api-delete-watch-response-codes]]
|
|
|
|
//==== {api-response-codes-title}
|
2017-09-14 16:01:47 -04:00
|
|
|
|
2019-09-05 14:19:35 -04:00
|
|
|
[[watcher-api-delete-watch-example]]
|
|
|
|
==== {api-examples-title}
|
2017-09-14 16:01:47 -04:00
|
|
|
|
2017-03-29 12:07:55 -04:00
|
|
|
The following example deletes a watch with the `my-watch` id:
|
|
|
|
|
2019-09-09 12:35:50 -04:00
|
|
|
[source,console]
|
2017-03-29 12:07:55 -04:00
|
|
|
--------------------------------------------------
|
2018-12-08 13:57:16 -05:00
|
|
|
DELETE _watcher/watch/my_watch
|
2017-03-29 12:07:55 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[setup:my_active_watch]
|
|
|
|
|
|
|
|
Response:
|
|
|
|
|
2019-09-06 09:22:08 -04:00
|
|
|
[source,console-result]
|
2017-03-29 12:07:55 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"found": true,
|
|
|
|
"_id": "my_watch",
|
|
|
|
"_version": 2
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|