mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
**Problem:** For historical reasons, source files for the Elasticsearch Guide's security, watcher, and Logstash API docs are housed in the `x-pack/docs` directory. This can confuse new contributors who expect Elasticsearch Guide docs to be located in `docs/reference`. **Solution:** - Move the security, watcher, and Logstash API doc source files to the `docs/reference` directory - Update doc snippet tests to use security Rel: https://github.com/elastic/platform-docs-team/issues/208
25 lines
948 B
Text
25 lines
948 B
Text
[discrete]
|
|
[[api-java-service]]
|
|
=== {watcher} service API
|
|
|
|
The {watcher} `service` API allows the control the lifecycle of the {watcher}
|
|
service. The following example starts the watcher service:
|
|
|
|
[source,java]
|
|
--------------------------------------------------
|
|
WatcherServiceResponse watcherServiceResponse = watcherClient.prepareWatchService().start().get();
|
|
--------------------------------------------------
|
|
|
|
The following example stops the watcher service:
|
|
|
|
[source,java]
|
|
--------------------------------------------------
|
|
WatcherServiceResponse watcherServiceResponse = watcherClient.prepareWatchService().stop().get();
|
|
--------------------------------------------------
|
|
|
|
The following example restarts the watcher service:
|
|
|
|
[source,java]
|
|
--------------------------------------------------
|
|
WatcherServiceResponse watcherServiceResponse = watcherClient.prepareWatchService().restart().get();
|
|
--------------------------------------------------
|