diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestAckWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestAckWatchAction.java index 491d3ca9077bc..2384e321c523c 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestAckWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestAckWatchAction.java @@ -37,15 +37,15 @@ public class RestAckWatchAction extends WatcherRestHandler { public RestAckWatchAction(Settings settings, RestController controller) { super(settings); - // @deprecated Remove deprecations in 6.0 - controller.registerWithDeprecatedHandler(POST, URI_BASE + "/watch/{id}/_ack", this, - POST, "/_watcher/watch/{id}/_ack", deprecationLogger); - controller.registerWithDeprecatedHandler(PUT, URI_BASE + "/watch/{id}/_ack", this, - PUT, "/_watcher/watch/{id}/_ack", deprecationLogger); - controller.registerWithDeprecatedHandler(POST, URI_BASE + "/watch/{id}/_ack/{actions}", this, - POST, "/_watcher/watch/{id}/_ack/{actions}", deprecationLogger); - controller.registerWithDeprecatedHandler(PUT, URI_BASE + "/watch/{id}/_ack/{actions}", this, - PUT, "/_watcher/watch/{id}/_ack/{actions}", deprecationLogger); + + controller.registerHandler(POST, URI_BASE + "/watch/{id}/_ack", this); + controller.registerHandler(POST, "/_watcher/watch/{id}/_ack", this); + controller.registerHandler(PUT, URI_BASE + "/watch/{id}/_ack", this); + controller.registerHandler(PUT, "/_watcher/watch/{id}/_ack", this); + controller.registerHandler(POST, URI_BASE + "/watch/{id}/_ack/{actions}", this); + controller.registerHandler(POST, "/_watcher/watch/{id}/_ack/{actions}", this); + controller.registerHandler(PUT, URI_BASE + "/watch/{id}/_ack/{actions}", this); + controller.registerHandler(PUT, "/_watcher/watch/{id}/_ack/{actions}", this); // @deprecated The following can be totally dropped in 6.0 // Note: we deprecated "/{actions}/_ack" totally; so we don't replace it with a matching _xpack variant diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestActivateWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestActivateWatchAction.java index 5afd0976eb9a5..027398f2664f8 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestActivateWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestActivateWatchAction.java @@ -40,15 +40,14 @@ public RestActivateWatchAction(Settings settings, RestController controller) { final DeactivateRestHandler deactivateRestHandler = new DeactivateRestHandler(settings); - // @deprecated Remove deprecations in 6.0 - controller.registerWithDeprecatedHandler(POST, URI_BASE + "/watch/{id}/_activate", this, - POST, "/_watcher/watch/{id}/_activate", deprecationLogger); - controller.registerWithDeprecatedHandler(PUT, URI_BASE + "/watch/{id}/_activate", this, - PUT, "/_watcher/watch/{id}/_activate", deprecationLogger); - controller.registerWithDeprecatedHandler(POST, URI_BASE + "/watch/{id}/_deactivate", deactivateRestHandler, - POST, "/_watcher/watch/{id}/_deactivate", deprecationLogger); - controller.registerWithDeprecatedHandler(PUT, URI_BASE + "/watch/{id}/_deactivate", deactivateRestHandler, - PUT, "/_watcher/watch/{id}/_deactivate", deprecationLogger); + controller.registerHandler(POST, URI_BASE + "/watch/{id}/_activate", this); + controller.registerHandler(POST, "/_watcher/watch/{id}/_activate", this); + controller.registerHandler(PUT, URI_BASE + "/watch/{id}/_activate", this); + controller.registerHandler(PUT, "/_watcher/watch/{id}/_activate", this); + controller.registerHandler(POST, URI_BASE + "/watch/{id}/_deactivate", deactivateRestHandler); + controller.registerHandler(POST, "/_watcher/watch/{id}/_deactivate", deactivateRestHandler); + controller.registerHandler(PUT, URI_BASE + "/watch/{id}/_deactivate", deactivateRestHandler); + controller.registerHandler(PUT, "/_watcher/watch/{id}/_deactivate", deactivateRestHandler); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestDeleteWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestDeleteWatchAction.java index f087f24791414..05abdba4f5068 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestDeleteWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestDeleteWatchAction.java @@ -33,9 +33,9 @@ public class RestDeleteWatchAction extends WatcherRestHandler { public RestDeleteWatchAction(Settings settings, RestController controller) { super(settings); - // @deprecated Remove deprecations in 6.0 - controller.registerWithDeprecatedHandler(DELETE, URI_BASE + "/watch/{id}", this, - DELETE, "/_watcher/watch/{id}", deprecationLogger); + + controller.registerHandler(DELETE, URI_BASE + "/watch/{id}", this); + controller.registerHandler(DELETE, "/_watcher/watch/{id}", this); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchAction.java index f32d62cd2b128..a198eb458b18f 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchAction.java @@ -56,15 +56,14 @@ public class RestExecuteWatchAction extends WatcherRestHandler implements RestRe public RestExecuteWatchAction(Settings settings, RestController controller) { super(settings); - // @deprecated Remove deprecations in 6.0 - controller.registerWithDeprecatedHandler(POST, URI_BASE + "/watch/{id}/_execute", this, - POST, "/_watcher/watch/{id}/_execute", deprecationLogger); - controller.registerWithDeprecatedHandler(PUT, URI_BASE + "/watch/{id}/_execute", this, - PUT, "/_watcher/watch/{id}/_execute", deprecationLogger); - controller.registerWithDeprecatedHandler(POST, URI_BASE + "/watch/_execute", this, - POST, "/_watcher/watch/_execute", deprecationLogger); - controller.registerWithDeprecatedHandler(PUT, URI_BASE + "/watch/_execute", this, - PUT, "/_watcher/watch/_execute", deprecationLogger); + controller.registerHandler(POST, URI_BASE + "/watch/{id}/_execute", this); + controller.registerHandler(POST, "/_watcher/watch/{id}/_execute", this); + controller.registerHandler(PUT, URI_BASE + "/watch/{id}/_execute", this); + controller.registerHandler(PUT, "/_watcher/watch/{id}/_execute", this); + controller.registerHandler(POST, URI_BASE + "/watch/_execute", this); + controller.registerHandler(POST, "/_watcher/watch/_execute", this); + controller.registerHandler(PUT, URI_BASE + "/watch/_execute", this); + controller.registerHandler(PUT, "/_watcher/watch/_execute", this); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestGetWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestGetWatchAction.java index a50096c713933..c0e4b325fb384 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestGetWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestGetWatchAction.java @@ -34,9 +34,8 @@ public class RestGetWatchAction extends WatcherRestHandler { public RestGetWatchAction(Settings settings, RestController controller) { super(settings); - // @deprecated Remove deprecations in 6.0 - controller.registerWithDeprecatedHandler(GET, URI_BASE + "/watch/{id}", this, - GET, "/_watcher/watch/{id}", deprecationLogger); + controller.registerHandler(GET, URI_BASE + "/watch/{id}", this); + controller.registerHandler(GET, "/_watcher/watch/{id}", this); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestPutWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestPutWatchAction.java index 814c8aed962b1..409298daecdf3 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestPutWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestPutWatchAction.java @@ -40,11 +40,10 @@ public class RestPutWatchAction extends WatcherRestHandler implements RestReques public RestPutWatchAction(Settings settings, RestController controller) { super(settings); - // @deprecated Remove deprecations in 6.0 - controller.registerWithDeprecatedHandler(POST, URI_BASE + "/watch/{id}", this, - POST, "/_watcher/watch/{id}", deprecationLogger); - controller.registerWithDeprecatedHandler(PUT, URI_BASE + "/watch/{id}", this, - PUT, "/_watcher/watch/{id}", deprecationLogger); + controller.registerHandler(POST, URI_BASE + "/watch/{id}", this); + controller.registerHandler(POST, "/_watcher/watch/{id}", this); + controller.registerHandler(PUT, URI_BASE + "/watch/{id}", this); + controller.registerHandler(PUT, "/_watcher/watch/{id}", this); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatchServiceAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatchServiceAction.java index ce30cb7a43c93..483d10cba3e3a 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatchServiceAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatchServiceAction.java @@ -28,14 +28,18 @@ public class RestWatchServiceAction extends WatcherRestHandler { public RestWatchServiceAction(Settings settings, RestController controller) { super(settings); - // @deprecated Remove in 6.0 // NOTE: we switched from PUT in 2.x to POST in 5.x + // NOTE: We added back the old URL with the new VERB (POST) since we are deprecating _xpack/* URIs in 7.0 controller.registerWithDeprecatedHandler(POST, URI_BASE + "/_restart", this, PUT, "/_watcher/_restart", deprecationLogger); + StartRestHandler startRestHandler = new StartRestHandler(settings); controller.registerWithDeprecatedHandler(POST, URI_BASE + "/_start", - new StartRestHandler(settings), PUT, "/_watcher/_start", deprecationLogger); + startRestHandler, PUT, "/_watcher/_start", deprecationLogger); + controller.registerHandler(POST, "/_watcher/_start", startRestHandler); + StopRestHandler stopRestHandler = new StopRestHandler(settings); controller.registerWithDeprecatedHandler(POST, URI_BASE + "/_stop", - new StopRestHandler(settings), PUT, "/_watcher/_stop", deprecationLogger); + stopRestHandler, PUT, "/_watcher/_stop", deprecationLogger); + controller.registerHandler(POST, "/_watcher/_stop", stopRestHandler); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatcherStatsAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatcherStatsAction.java index dd84dcb1d086b..5cff5da1518a2 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatcherStatsAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatcherStatsAction.java @@ -30,11 +30,10 @@ public class RestWatcherStatsAction extends WatcherRestHandler { public RestWatcherStatsAction(Settings settings, RestController controller) { super(settings); - // @deprecated Remove deprecations in 6.0 - controller.registerWithDeprecatedHandler(GET, URI_BASE + "/stats", this, - GET, "/_watcher/stats", deprecationLogger); - controller.registerWithDeprecatedHandler(GET, URI_BASE + "/stats/{metric}", this, - GET, "/_watcher/stats/{metric}", deprecationLogger); + controller.registerHandler(GET, URI_BASE + "/stats", this); + controller.registerHandler(GET, "/_watcher/stats", this); + controller.registerHandler(GET, URI_BASE + "/stats/{metric}", this); + controller.registerHandler(GET, "/_watcher/stats/{metric}", this); } @Override