Watcher: Fix acknowledgement REST API endpoints

Add new REST API endpoint to acknoweldging actions. The old endpoints
have not been removed as part of this PR, but can be in the next major
version.

Update the documentation to remove the parameter based example, and
mention that the old endpoints are going to be removed in the future.

Closes elastic/elasticsearch#2517

Original commit: elastic/x-pack-elasticsearch@e2558e9e1f
This commit is contained in:
Alexander Reelsen 2016-06-24 16:50:35 +02:00
parent 6ed9f50457
commit f78f848681
2 changed files with 4 additions and 1 deletions

View File

@ -33,6 +33,9 @@ public class RestAckWatchAction extends WatcherRestHandler {
super(settings, client);
controller.registerHandler(RestRequest.Method.PUT, URI_BASE + "/watch/{id}/_ack", this);
controller.registerHandler(RestRequest.Method.POST, URI_BASE + "/watch/{id}/_ack", this);
controller.registerHandler(RestRequest.Method.POST, URI_BASE + "/watch/{id}/_ack/{actions}", this);
controller.registerHandler(RestRequest.Method.PUT, URI_BASE + "/watch/{id}/_ack/{actions}", this);
// these are going to be removed in 6.0
controller.registerHandler(RestRequest.Method.PUT, URI_BASE + "/watch/{id}/{actions}/_ack", this);
controller.registerHandler(RestRequest.Method.POST, URI_BASE + "/watch/{id}/{actions}/_ack", this);
}

View File

@ -4,7 +4,7 @@
"methods": [ "PUT", "POST" ],
"url": {
"path": "/_xpack/watcher/watch/{watch_id}/_ack",
"paths": [ "/_xpack/watcher/watch/{watch_id}/_ack", "/_xpack/watcher/watch/{watch_id}/{action_id}/_ack"],
"paths": [ "/_xpack/watcher/watch/{watch_id}/_ack", "/_xpack/watcher/watch/{watch_id}/_ack/{action_id}"],
"parts": {
"watch_id": {
"type" : "string",