delete-watch.asciidoc 982 B

12345678910111213141516171819202122
  1. [float]
  2. [[api-java-delete-watch]]
  3. === Delete Watch API
  4. The DELETE watch API removes a watch (identified by its `id`) from {watcher}.
  5. Once removed, the document representing the watch in the `.watches` index is
  6. gone and it will never be executed again.
  7. Please note that deleting a watch **does not** delete any watch execution records
  8. related to this watch from the watch history.
  9. IMPORTANT: Deleting a watch must be done via this API only. Do not delete the
  10. watch directly from the `.watches` index using Elasticsearch's DELETE
  11. Document API. If the {es} {security-features} are enabled, make sure
  12. no `write` privileges are granted to anyone over the `.watches` index.
  13. The following example deletes a watch with the `my-watch` id:
  14. [source,java]
  15. --------------------------------------------------
  16. DeleteWatchResponse deleteWatchResponse = watcherClient.prepareDeleteWatch("my-watch").get();
  17. --------------------------------------------------