mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-07 21:48:39 +00:00
Confirmed with @debadair, going ahead with merge Original commit: elastic/x-pack-elasticsearch@c510ddfe9e
26 lines
935 B
Plaintext
26 lines
935 B
Plaintext
[float]
|
|
[[api-java-service]]
|
|
=== 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();
|
|
--------------------------------------------------
|