Spec-Zone.ru › Elasticsearch 8
›Elasticsearch Guide [8.17] ›REST APIs ›Watcher APIs

Delete watch API

New API reference

For the most up-to-date API details, refer to Watcher APIs.

Removes a watch from Watcher.

Request

DELETE _watcher/watch/<watch_id>

Prerequisites

  • You must have manage_watcher cluster privileges to use this API. For more information, see Security privileges.

Description

When the watch is removed, the document representing the watch in the .watches index is gone and it will never be run again.

Please note that deleting a watch does not delete any watch execution records related to this watch from the watch history.

Deleting a watch must be done via this API only. Do not delete the watch directly from the .watches index using the Elasticsearch DELETE Document API. When Elasticsearch security features are enabled, make sure no write privileges are granted to anyone over the .watches index.

Path parameters

<watch_id>
(Required, string) Identifier for the watch.

Examples

The following example deletes a watch with the my-watch id:

resp = client.watcher.delete_watch(
    id="my_watch",
)
print(resp)
response = client.watcher.delete_watch(
  id: 'my_watch'
)
puts response
const response = await client.watcher.deleteWatch({
  id: "my_watch",
});
console.log(response);
DELETE _watcher/watch/my_watch

Response:

{
   "found": true,
   "_id": "my_watch",
   "_version": 2
}

© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-delete-watch.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API