HLRC: Add get watch API (#35531)

This changes adds the support for the get watch API in the high level rest client.
This commit is contained in:
Jim Ferenczi 2018-11-30 11:02:46 +01:00 committed by GitHub
parent fa3d365ee8
commit 5c7b2c5f9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 676 additions and 15 deletions

View file

@ -422,6 +422,7 @@ The Java High Level REST Client supports the following Watcher APIs:
* <<{upid}-start-watch-service>>
* <<{upid}-stop-watch-service>>
* <<java-rest-high-x-pack-watcher-put-watch>>
* <<java-rest-high-x-pack-watcher-get-watch>>
* <<java-rest-high-x-pack-watcher-delete-watch>>
* <<java-rest-high-watcher-deactivate-watch>>
* <<{upid}-ack-watch>>
@ -431,6 +432,7 @@ The Java High Level REST Client supports the following Watcher APIs:
include::watcher/start-watch-service.asciidoc[]
include::watcher/stop-watch-service.asciidoc[]
include::watcher/put-watch.asciidoc[]
include::watcher/get-watch.asciidoc[]
include::watcher/delete-watch.asciidoc[]
include::watcher/ack-watch.asciidoc[]
include::watcher/deactivate-watch.asciidoc[]

View file

@ -0,0 +1,36 @@
--
:api: get-watch
:request: GetWatchRequest
:response: GetWatchResponse
--
[id="{upid}-{api}"]
=== Get Watch API
[id="{upid}-{api}-request"]
==== Execution
A watch can be retrieved as follows:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-request]
--------------------------------------------------
[id="{upid}-{api}-response"]
==== Response
The returned +{response}+ contains `id`, `version`, `status` and `source`
information.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-response]
--------------------------------------------------
<1> `_id`, id of the watch
<2> `found` is a boolean indicating whether the watch was found
<2> `_version` returns the version of the watch
<3> `status` contains status of the watch
<4> `source` the source of the watch
include::../execution.asciidoc[]