Browse Source

Remove deprecated endpoints containing _xpack. (#48170)

The endpoints with `_xpack` in their path were deprecated in 7.x and can now be
removed. This commit removes deprecated endpoints for the following APIs:
* deprecation
* graph
* license
* monitoring
* rollup
* SQL
* watcher
Julie Tibshirani 6 years ago
parent
commit
a12b4094bf
33 changed files with 69 additions and 347 deletions
  1. 10 0
      docs/reference/migration/migrate_8_0.asciidoc
  2. 1 8
      x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestDeleteLicenseAction.java
  3. 1 8
      x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetBasicStatus.java
  4. 1 8
      x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetLicenseAction.java
  5. 1 8
      x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetTrialStatus.java
  6. 1 8
      x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartBasicLicense.java
  7. 1 8
      x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartTrialLicense.java
  8. 2 12
      x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPutLicenseAction.java
  9. 1 9
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/rest/RestGetCertificateInfoAction.java
  10. 2 8
      x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/RestDeprecationInfoAction.java
  11. 2 12
      x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/rest/action/RestGraphAction.java
  12. 2 10
      x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkAction.java
  13. 1 8
      x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestDeleteRollupJobAction.java
  14. 1 8
      x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupCapsAction.java
  15. 1 9
      x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupIndexCapsAction.java
  16. 1 8
      x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupJobsAction.java
  17. 1 8
      x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestPutRollupJobAction.java
  18. 1 8
      x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStartRollupJobAction.java
  19. 1 8
      x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStopRollupJobAction.java
  20. 0 4
      x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/Protocol.java
  21. 1 8
      x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlClearCursorAction.java
  22. 2 12
      x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlQueryAction.java
  23. 1 8
      x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlStatsAction.java
  24. 2 12
      x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlTranslateAction.java
  25. 4 17
      x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestAckWatchAction.java
  26. 4 17
      x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestActivateWatchAction.java
  27. 1 8
      x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestDeleteWatchAction.java
  28. 4 17
      x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchAction.java
  29. 1 8
      x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestGetWatchAction.java
  30. 2 11
      x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestPutWatchAction.java
  31. 2 11
      x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatchServiceAction.java
  32. 2 7
      x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatcherStatsAction.java
  33. 11 51
      x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java

+ 10 - 0
docs/reference/migration/migrate_8_0.asciidoc

@@ -50,6 +50,16 @@ Indices created in Elasticsearch 6.x or before will need to be reindexed with
 Elasticsearch 7.x in order to be readable by Elasticsearch 8.x.
 
 =========================================
+
+[float]
+==== REST endpoints containing `_xpack`
+
+In 7.0, we deprecated REST endpoints that contain `_xpack` in their path. These
+endpoints are now removed in 8.0. Each endpoint that was deprecated and removed
+is replaced with a new endpoint that does not contain `_xpack`. As an example,
+`/{index}/_xpack/graph/_explore` is replaced by `/{index}/_graph/explore`.
+
+
 // end::notable-breaking-changes[]
 
 include::migrate_8_0/analysis.asciidoc[]

+ 1 - 8
x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestDeleteLicenseAction.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.license;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.protocol.xpack.license.DeleteLicenseRequest;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
@@ -21,13 +19,8 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
 
 public class RestDeleteLicenseAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestDeleteLicenseAction.class));
-
     RestDeleteLicenseAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                DELETE, "/_license", this,
-                DELETE,  "/_xpack/license", deprecationLogger);
+        controller.registerHandler(DELETE, "/_license", this);
     }
 
     @Override

+ 1 - 8
x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetBasicStatus.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.license;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
 import org.elasticsearch.rest.RestRequest;
@@ -18,13 +16,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
 
 public class RestGetBasicStatus extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetBasicStatus.class));
-
     RestGetBasicStatus(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                GET, "/_license/basic_status", this,
-                GET, "/_xpack/license/basic_status", deprecationLogger);
+        controller.registerHandler(GET, "/_license/basic_status", this);
     }
 
     @Override

+ 1 - 8
x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetLicenseAction.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.license;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.xcontent.ToXContent;
 import org.elasticsearch.common.xcontent.XContentBuilder;
 import org.elasticsearch.protocol.xpack.license.GetLicenseRequest;
@@ -29,13 +27,8 @@ import static org.elasticsearch.rest.RestStatus.OK;
 
 public class RestGetLicenseAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetLicenseAction.class));
-
     RestGetLicenseAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                GET, "/_license", this,
-                GET, "/_xpack/license", deprecationLogger);
+        controller.registerHandler(GET, "/_license", this);
     }
 
     @Override

+ 1 - 8
x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetTrialStatus.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.license;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
 import org.elasticsearch.rest.RestRequest;
@@ -18,13 +16,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
 
 public class RestGetTrialStatus extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetTrialStatus.class));
-
     RestGetTrialStatus(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                GET, "/_license/trial_status", this,
-                GET, "/_xpack/license/trial_status", deprecationLogger);
+        controller.registerHandler(GET, "/_license/trial_status", this);
     }
 
     @Override

+ 1 - 8
x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartBasicLicense.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.license;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
 import org.elasticsearch.rest.RestRequest;
@@ -20,13 +18,8 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
 
 public class RestPostStartBasicLicense extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPostStartBasicLicense.class));
-
     RestPostStartBasicLicense(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                POST, "/_license/start_basic", this,
-                POST, "/_xpack/license/start_basic", deprecationLogger);
+        controller.registerHandler(POST, "/_license/start_basic", this);
     }
 
     @Override

+ 1 - 8
x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartTrialLicense.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.license;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.xcontent.XContentBuilder;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.BytesRestResponse;
@@ -24,13 +22,8 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
 
 public class RestPostStartTrialLicense extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPostStartTrialLicense.class));
-
     RestPostStartTrialLicense(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                POST, "/_license/start_trial", this,
-                POST, "/_xpack/license/start_trial", deprecationLogger);
+        controller.registerHandler(POST, "/_license/start_trial", this);
     }
 
     @Override

+ 2 - 12
x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPutLicenseAction.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.license;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
 import org.elasticsearch.rest.RestRequest;
@@ -21,18 +19,10 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
 
 public class RestPutLicenseAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPutLicenseAction.class));
-
     RestPutLicenseAction(RestController controller) {
         // TODO: remove POST endpoint?
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                POST, "/_license", this,
-                POST, "/_xpack/license", deprecationLogger);
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                PUT, "/_license", this,
-                PUT,  "/_xpack/license", deprecationLogger);
+        controller.registerHandler(POST, "/_license", this);
+        controller.registerHandler(PUT, "/_license", this);
     }
 
     @Override

+ 1 - 9
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/rest/RestGetCertificateInfoAction.java

@@ -5,9 +5,7 @@
  */
 package org.elasticsearch.xpack.core.ssl.rest;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.xcontent.XContentBuilder;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.BytesRestResponse;
@@ -27,14 +25,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
  */
 public class RestGetCertificateInfoAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger =
-        new DeprecationLogger(LogManager.getLogger(RestGetCertificateInfoAction.class));
-
     public RestGetCertificateInfoAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-            GET, "/_ssl/certificates", this,
-            GET, "/_xpack/ssl/certificates", deprecationLogger);
+        controller.registerHandler(GET, "/_ssl/certificates", this);
     }
 
     @Override

+ 2 - 8
x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/RestDeprecationInfoAction.java

@@ -9,7 +9,6 @@ import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.elasticsearch.client.node.NodeClient;
 import org.elasticsearch.common.Strings;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
 import org.elasticsearch.rest.RestRequest;
@@ -21,15 +20,10 @@ import java.io.IOException;
 
 public class RestDeprecationInfoAction extends BaseRestHandler {
     private static final Logger logger = LogManager.getLogger(RestDeprecationInfoAction.class);
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
 
     public RestDeprecationInfoAction(RestController controller) {
-        controller.registerWithDeprecatedHandler(
-            RestRequest.Method.GET, "/_migration/deprecations", this,
-            RestRequest.Method.GET, "/_xpack/migration/deprecations", deprecationLogger);
-        controller.registerWithDeprecatedHandler(
-            RestRequest.Method.GET, "/{index}/_migration/deprecations", this,
-            RestRequest.Method.GET, "/{index}/_xpack/migration/deprecations", deprecationLogger);
+        controller.registerHandler(RestRequest.Method.GET, "/_migration/deprecations", this);
+        controller.registerHandler(RestRequest.Method.GET, "/{index}/_migration/deprecations", this);
     }
 
     @Override

+ 2 - 12
x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/rest/action/RestGraphAction.java

@@ -6,13 +6,11 @@
 
 package org.elasticsearch.xpack.graph.rest.action;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.ElasticsearchParseException;
 import org.elasticsearch.action.support.IndicesOptions;
 import org.elasticsearch.client.node.NodeClient;
 import org.elasticsearch.common.ParseField;
 import org.elasticsearch.common.Strings;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.unit.TimeValue;
 import org.elasticsearch.common.xcontent.XContentParser;
 import org.elasticsearch.protocol.xpack.graph.GraphExploreRequest;
@@ -39,8 +37,6 @@ import static org.elasticsearch.xpack.core.graph.action.GraphExploreAction.INSTA
  */
 public class RestGraphAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGraphAction.class));
-
     public static final ParseField TIMEOUT_FIELD = new ParseField("timeout");
     public static final ParseField SIGNIFICANCE_FIELD = new ParseField("use_significance");
     public static final ParseField RETURN_DETAILED_INFO = new ParseField("return_detailed_stats");
@@ -61,14 +57,8 @@ public class RestGraphAction extends BaseRestHandler {
     public static final ParseField TERM_FIELD = new ParseField("term");
 
     public RestGraphAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-            GET, "/{index}/_graph/explore", this,
-            GET, "/{index}/_xpack/graph/_explore", deprecationLogger);
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-            POST, "/{index}/_graph/explore", this,
-            POST, "/{index}/_xpack/graph/_explore", deprecationLogger);
+        controller.registerHandler(GET, "/{index}/_graph/explore", this);
+        controller.registerHandler(POST, "/{index}/_graph/explore", this);
     }
 
     @Override

+ 2 - 10
x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkAction.java

@@ -5,12 +5,9 @@
  */
 package org.elasticsearch.xpack.monitoring.rest.action;
 
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
 import org.elasticsearch.ElasticsearchParseException;
 import org.elasticsearch.client.node.NodeClient;
 import org.elasticsearch.common.Strings;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.xcontent.XContentBuilder;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.BytesRestResponse;
@@ -39,16 +36,11 @@ public class RestMonitoringBulkAction extends BaseRestHandler {
     public static final String MONITORING_ID = "system_id";
     public static final String MONITORING_VERSION = "system_api_version";
     public static final String INTERVAL = "interval";
-    private static final Logger logger = LogManager.getLogger(RestMonitoringBulkAction.class);
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
     private final Map<MonitoredSystem, List<String>> supportedApiVersions;
 
     public RestMonitoringBulkAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(POST, "/_monitoring/bulk", this,
-            POST, "/_xpack/monitoring/_bulk", deprecationLogger);
-        controller.registerWithDeprecatedHandler(PUT, "/_monitoring/bulk", this,
-            PUT, "/_xpack/monitoring/_bulk", deprecationLogger);
+        controller.registerHandler(POST, "/_monitoring/bulk", this);
+        controller.registerHandler(PUT, "/_monitoring/bulk", this);
 
         final List<String> allVersions = Arrays.asList(
                 MonitoringTemplateUtils.TEMPLATE_VERSION,

+ 1 - 8
x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestDeleteRollupJobAction.java

@@ -6,10 +6,8 @@
 
 package org.elasticsearch.xpack.rollup.rest;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
 import org.elasticsearch.common.ParseField;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
 import org.elasticsearch.rest.RestRequest;
@@ -21,15 +19,10 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
 
 public class RestDeleteRollupJobAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestDeleteRollupJobAction.class));
-
     public static final ParseField ID = new ParseField("id");
 
     public RestDeleteRollupJobAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                DELETE, "/_rollup/job/{id}", this,
-                DELETE, "/_xpack/rollup/job/{id}/", deprecationLogger);
+        controller.registerHandler(DELETE, "/_rollup/job/{id}", this);
     }
 
     @Override

+ 1 - 8
x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupCapsAction.java

@@ -6,10 +6,8 @@
 
 package org.elasticsearch.xpack.rollup.rest;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
 import org.elasticsearch.common.ParseField;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
 import org.elasticsearch.rest.RestRequest;
@@ -20,15 +18,10 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
 
 public class RestGetRollupCapsAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetRollupCapsAction.class));
-
     public static final ParseField ID = new ParseField("id");
 
     public RestGetRollupCapsAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                GET, "/_rollup/data/{id}", this,
-                GET, "/_xpack/rollup/data/{id}/", deprecationLogger);
+        controller.registerHandler(GET, "/_rollup/data/{id}", this);
     }
 
     @Override

+ 1 - 9
x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupIndexCapsAction.java

@@ -6,12 +6,10 @@
 
 package org.elasticsearch.xpack.rollup.rest;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.action.support.IndicesOptions;
 import org.elasticsearch.client.node.NodeClient;
 import org.elasticsearch.common.ParseField;
 import org.elasticsearch.common.Strings;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
 import org.elasticsearch.rest.RestRequest;
@@ -22,16 +20,10 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
 
 public class RestGetRollupIndexCapsAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger =
-            new DeprecationLogger(LogManager.getLogger(RestGetRollupIndexCapsAction.class));
-
     static final ParseField INDEX = new ParseField("index");
 
     public RestGetRollupIndexCapsAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                GET, "/{index}/_rollup/data", this,
-                GET, "/{index}/_xpack/rollup/data", deprecationLogger);
+        controller.registerHandler(GET, "/{index}/_rollup/data", this);
     }
 
     @Override

+ 1 - 8
x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupJobsAction.java

@@ -6,10 +6,8 @@
 
 package org.elasticsearch.xpack.rollup.rest;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
 import org.elasticsearch.common.ParseField;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
 import org.elasticsearch.rest.RestRequest;
@@ -20,15 +18,10 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
 
 public class RestGetRollupJobsAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetRollupJobsAction.class));
-
     public static final ParseField ID = new ParseField("id");
 
     public RestGetRollupJobsAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                GET, "/_rollup/job/{id}", this,
-                GET, "/_xpack/rollup/job/{id}/", deprecationLogger);
+        controller.registerHandler(GET, "/_rollup/job/{id}", this);
     }
 
     @Override

+ 1 - 8
x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestPutRollupJobAction.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.xpack.rollup.rest;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
 import org.elasticsearch.rest.RestRequest;
@@ -21,13 +19,8 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
 
 public class RestPutRollupJobAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPutRollupJobAction.class));
-
     public RestPutRollupJobAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                PUT, "/_rollup/job/{id}", this,
-                PUT, "/_xpack/rollup/job/{id}", deprecationLogger);
+        controller.registerHandler(PUT, "/_rollup/job/{id}", this);
     }
 
     @Override

+ 1 - 8
x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStartRollupJobAction.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.xpack.rollup.rest;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
 import org.elasticsearch.rest.RestRequest;
@@ -20,13 +18,8 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
 
 public class RestStartRollupJobAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestStartRollupJobAction.class));
-
     public RestStartRollupJobAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                POST, "/_rollup/job/{id}/_start", this,
-                POST, "/_xpack/rollup/job/{id}/_start", deprecationLogger);
+        controller.registerHandler(POST, "/_rollup/job/{id}/_start", this);
     }
 
     @Override

+ 1 - 8
x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStopRollupJobAction.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.xpack.rollup.rest;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.unit.TimeValue;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
@@ -21,13 +19,8 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
 
 public class RestStopRollupJobAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestStopRollupJobAction.class));
-
     public RestStopRollupJobAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                POST, "/_rollup/job/{id}/_stop", this,
-                POST, "/_xpack/rollup/job/{id}/_stop", deprecationLogger);
+        controller.registerHandler(POST, "/_rollup/job/{id}/_stop", this);
     }
 
     @Override

+ 0 - 4
x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/Protocol.java

@@ -29,11 +29,7 @@ public final class Protocol {
      * SQL-related endpoints
      */
     public static final String CLEAR_CURSOR_REST_ENDPOINT = "/_sql/close";
-    public static final String CLEAR_CURSOR_DEPRECATED_REST_ENDPOINT = "/_xpack/sql/close";
     public static final String SQL_QUERY_REST_ENDPOINT = "/_sql";
-    public static final String SQL_QUERY_DEPRECATED_REST_ENDPOINT = "/_xpack/sql";
     public static final String SQL_TRANSLATE_REST_ENDPOINT = "/_sql/translate";
-    public static final String SQL_TRANSLATE_DEPRECATED_REST_ENDPOINT = "/_xpack/sql/translate";
     public static final String SQL_STATS_REST_ENDPOINT = "/_sql/stats";
-    public static final String SQL_STATS_DEPRECATED_REST_ENDPOINT = "/_xpack/sql/stats";
 }

+ 1 - 8
x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlClearCursorAction.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.xpack.sql.plugin;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.xcontent.XContentParser;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
@@ -24,13 +22,8 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
 
 public class RestSqlClearCursorAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestSqlClearCursorAction.class));
-
     public RestSqlClearCursorAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                POST, Protocol.CLEAR_CURSOR_REST_ENDPOINT, this,
-                POST, Protocol.CLEAR_CURSOR_DEPRECATED_REST_ENDPOINT, deprecationLogger);
+        controller.registerHandler(POST, Protocol.CLEAR_CURSOR_REST_ENDPOINT, this);
     }
 
     @Override

+ 2 - 12
x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlQueryAction.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.xpack.sql.plugin;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.xcontent.XContentBuilder;
 import org.elasticsearch.common.xcontent.XContentParser;
 import org.elasticsearch.common.xcontent.XContentType;
@@ -32,17 +30,9 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
 
 public class RestSqlQueryAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestSqlQueryAction.class));
-
     public RestSqlQueryAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                GET, Protocol.SQL_QUERY_REST_ENDPOINT, this,
-                GET, Protocol.SQL_QUERY_DEPRECATED_REST_ENDPOINT, deprecationLogger);
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                POST, Protocol.SQL_QUERY_REST_ENDPOINT, this,
-                POST, Protocol.SQL_QUERY_DEPRECATED_REST_ENDPOINT, deprecationLogger);
+        controller.registerHandler(GET, Protocol.SQL_QUERY_REST_ENDPOINT, this);
+        controller.registerHandler(POST, Protocol.SQL_QUERY_REST_ENDPOINT, this);
     }
 
     @Override

+ 1 - 8
x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlStatsAction.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.xpack.sql.plugin;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
 import org.elasticsearch.rest.RestRequest;
@@ -19,13 +17,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
 
 public class RestSqlStatsAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestSqlStatsAction.class));
-
     protected RestSqlStatsAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                GET, Protocol.SQL_STATS_REST_ENDPOINT, this,
-                GET, Protocol.SQL_STATS_DEPRECATED_REST_ENDPOINT, deprecationLogger);
+        controller.registerHandler(GET, Protocol.SQL_STATS_REST_ENDPOINT, this);
     }
 
     @Override

+ 2 - 12
x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlTranslateAction.java

@@ -5,9 +5,7 @@
  */
 package org.elasticsearch.xpack.sql.plugin;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.xcontent.XContentParser;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
@@ -27,17 +25,9 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
  */
 public class RestSqlTranslateAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestSqlTranslateAction.class));
-
     public RestSqlTranslateAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                GET, Protocol.SQL_TRANSLATE_REST_ENDPOINT, this,
-                GET, Protocol.SQL_TRANSLATE_DEPRECATED_REST_ENDPOINT, deprecationLogger);
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-                POST, Protocol.SQL_TRANSLATE_REST_ENDPOINT, this,
-                POST, Protocol.SQL_TRANSLATE_DEPRECATED_REST_ENDPOINT, deprecationLogger);
+        controller.registerHandler(GET, Protocol.SQL_TRANSLATE_REST_ENDPOINT, this);
+        controller.registerHandler(POST, Protocol.SQL_TRANSLATE_REST_ENDPOINT, this);
     }
 
     @Override

+ 4 - 17
x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestAckWatchAction.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.xpack.watcher.rest.action;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.xcontent.XContentBuilder;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.BytesRestResponse;
@@ -31,22 +29,11 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
  */
 public class RestAckWatchAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestAckWatchAction.class));
-
     public RestAckWatchAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-            POST, "/_watcher/watch/{id}/_ack", this,
-            POST, "/_xpack/watcher/watch/{id}/_ack", deprecationLogger);
-        controller.registerWithDeprecatedHandler(
-            PUT, "/_watcher/watch/{id}/_ack", this,
-            PUT, "/_xpack/watcher/watch/{id}/_ack", deprecationLogger);
-        controller.registerWithDeprecatedHandler(
-            POST, "/_watcher/watch/{id}/_ack/{actions}", this,
-            POST, "/_xpack/watcher/watch/{id}/_ack/{actions}", deprecationLogger);
-        controller.registerWithDeprecatedHandler(
-            PUT, "/_watcher/watch/{id}/_ack/{actions}", this,
-            PUT, "/_xpack/watcher/watch/{id}/_ack/{actions}", deprecationLogger);
+        controller.registerHandler(POST, "/_watcher/watch/{id}/_ack", this);
+        controller.registerHandler(PUT, "/_watcher/watch/{id}/_ack", this);
+        controller.registerHandler(POST, "/_watcher/watch/{id}/_ack/{actions}", this);
+        controller.registerHandler(PUT, "/_watcher/watch/{id}/_ack/{actions}", this);
     }
 
     @Override

+ 4 - 17
x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestActivateWatchAction.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.xpack.watcher.rest.action;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.xcontent.XContentBuilder;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.BytesRestResponse;
@@ -31,24 +29,13 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
  */
 public class RestActivateWatchAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestActivateWatchAction.class));
-
     public RestActivateWatchAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-            POST, "/_watcher/watch/{id}/_activate", this,
-            POST, "/_xpack/watcher/watch/{id}/_activate", deprecationLogger);
-        controller.registerWithDeprecatedHandler(
-            PUT, "/_watcher/watch/{id}/_activate", this,
-            PUT, "/_xpack/watcher/watch/{id}/_activate", deprecationLogger);
+        controller.registerHandler(POST, "/_watcher/watch/{id}/_activate", this);
+        controller.registerHandler(PUT, "/_watcher/watch/{id}/_activate", this);
 
         final DeactivateRestHandler deactivateRestHandler = new DeactivateRestHandler();
-        controller.registerWithDeprecatedHandler(
-            POST, "/_watcher/watch/{id}/_deactivate", deactivateRestHandler,
-            POST, "/_xpack/watcher/watch/{id}/_deactivate", deprecationLogger);
-        controller.registerWithDeprecatedHandler(
-            PUT, "/_watcher/watch/{id}/_deactivate", deactivateRestHandler,
-            PUT, "/_xpack/watcher/watch/{id}/_deactivate", deprecationLogger);
+        controller.registerHandler(POST, "/_watcher/watch/{id}/_deactivate", deactivateRestHandler);
+        controller.registerHandler(PUT, "/_watcher/watch/{id}/_deactivate", deactivateRestHandler);
     }
 
     @Override

+ 1 - 8
x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestDeleteWatchAction.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.xpack.watcher.rest.action;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.xcontent.XContentBuilder;
 import org.elasticsearch.protocol.xpack.watcher.DeleteWatchRequest;
 import org.elasticsearch.protocol.xpack.watcher.DeleteWatchResponse;
@@ -27,13 +25,8 @@ import static org.elasticsearch.rest.RestStatus.OK;
 
 public class RestDeleteWatchAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestDeleteWatchAction.class));
-
     public RestDeleteWatchAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-            DELETE, "/_watcher/watch/{id}", this,
-            DELETE, "/_xpack/watcher/watch/{id}", deprecationLogger);
+        controller.registerHandler(DELETE, "/_watcher/watch/{id}", this);
     }
 
     @Override

+ 4 - 17
x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchAction.java

@@ -6,12 +6,10 @@
 
 package org.elasticsearch.xpack.watcher.rest.action;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.ElasticsearchParseException;
 import org.elasticsearch.client.node.NodeClient;
 import org.elasticsearch.common.ParseField;
 import org.elasticsearch.common.bytes.BytesReference;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.util.set.Sets;
 import org.elasticsearch.common.xcontent.XContentBuilder;
 import org.elasticsearch.common.xcontent.XContentParser;
@@ -44,8 +42,6 @@ import static org.elasticsearch.xpack.watcher.rest.action.RestExecuteWatchAction
 
 public class RestExecuteWatchAction extends BaseRestHandler implements RestRequestFilter {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestExecuteWatchAction.class));
-
     private static final List<String> RESERVED_FIELD_NAMES = Arrays.asList(WatchField.TRIGGER.getPreferredName(),
             WatchField.INPUT.getPreferredName(), WatchField.CONDITION.getPreferredName(),
             WatchField.ACTIONS.getPreferredName(), WatchField.TRANSFORM.getPreferredName(),
@@ -53,19 +49,10 @@ public class RestExecuteWatchAction extends BaseRestHandler implements RestReque
             WatchField.METADATA.getPreferredName(), WatchField.STATUS.getPreferredName());
 
     public RestExecuteWatchAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-            POST, "/_watcher/watch/{id}/_execute", this,
-            POST, "/_xpack/watcher/watch/{id}/_execute", deprecationLogger);
-        controller.registerWithDeprecatedHandler(
-            PUT, "/_watcher/watch/{id}/_execute", this,
-            PUT, "/_xpack/watcher/watch/{id}/_execute", deprecationLogger);
-        controller.registerWithDeprecatedHandler(
-            POST, "/_watcher/watch/_execute", this,
-            POST, "/_xpack/watcher/watch/_execute", deprecationLogger);
-        controller.registerWithDeprecatedHandler(
-            PUT, "/_watcher/watch/_execute", this,
-            PUT, "/_xpack/watcher/watch/_execute", deprecationLogger);
+        controller.registerHandler(POST, "/_watcher/watch/{id}/_execute", this);
+        controller.registerHandler(PUT, "/_watcher/watch/{id}/_execute", this);
+        controller.registerHandler(POST, "/_watcher/watch/_execute", this);
+        controller.registerHandler(PUT, "/_watcher/watch/_execute", this);
     }
 
     @Override

+ 1 - 8
x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestGetWatchAction.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.xpack.watcher.rest.action;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.xcontent.XContentBuilder;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.BytesRestResponse;
@@ -27,13 +25,8 @@ import static org.elasticsearch.rest.RestStatus.OK;
 
 public class RestGetWatchAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetWatchAction.class));
-
     public RestGetWatchAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-            GET, "/_watcher/watch/{id}", this,
-            GET, "/_xpack/watcher/watch/{id}", deprecationLogger);
+        controller.registerHandler(GET, "/_watcher/watch/{id}", this);
     }
 
     @Override

+ 2 - 11
x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestPutWatchAction.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.xpack.watcher.rest.action;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.lucene.uid.Versions;
 import org.elasticsearch.common.util.set.Sets;
 import org.elasticsearch.common.xcontent.XContentBuilder;
@@ -34,16 +32,9 @@ import static org.elasticsearch.rest.RestStatus.OK;
 
 public class RestPutWatchAction extends BaseRestHandler implements RestRequestFilter {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPutWatchAction.class));
-
     public RestPutWatchAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-            POST, "/_watcher/watch/{id}", this,
-            POST, "/_xpack/watcher/watch/{id}", deprecationLogger);
-        controller.registerWithDeprecatedHandler(
-            PUT, "/_watcher/watch/{id}", this,
-            PUT, "/_xpack/watcher/watch/{id}", deprecationLogger);
+        controller.registerHandler(POST, "/_watcher/watch/{id}", this);
+        controller.registerHandler(PUT, "/_watcher/watch/{id}", this);
     }
 
     @Override

+ 2 - 11
x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatchServiceAction.java

@@ -6,9 +6,7 @@
 
 package org.elasticsearch.xpack.watcher.rest.action;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
 import org.elasticsearch.rest.RestRequest;
@@ -20,16 +18,9 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
 
 public class RestWatchServiceAction extends BaseRestHandler {
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestWatchServiceAction.class));
-
     public RestWatchServiceAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-            POST, "/_watcher/_start", this,
-            POST, "/_xpack/watcher/_start", deprecationLogger);
-        controller.registerWithDeprecatedHandler(
-            POST, "/_watcher/_stop", new StopRestHandler(),
-            POST, "/_xpack/watcher/_stop", deprecationLogger);
+        controller.registerHandler(POST, "/_watcher/_start", this);
+        controller.registerHandler(POST, "/_watcher/_stop", new StopRestHandler());
     }
 
     @Override

+ 2 - 7
x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatcherStatsAction.java

@@ -28,13 +28,8 @@ public class RestWatcherStatsAction extends BaseRestHandler {
     private static final DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
 
     public RestWatcherStatsAction(RestController controller) {
-        // TODO: remove deprecated endpoint in 8.0.0
-        controller.registerWithDeprecatedHandler(
-            GET, "/_watcher/stats", this,
-            GET, "/_xpack/watcher/stats", deprecationLogger);
-        controller.registerWithDeprecatedHandler(
-            GET, "/_watcher/stats/{metric}", this,
-            GET, "/_xpack/watcher/stats/{metric}", deprecationLogger);
+        controller.registerHandler(GET, "/_watcher/stats", this);
+        controller.registerHandler(GET, "/_watcher/stats/{metric}", this);
     }
 
     @Override

+ 11 - 51
x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java

@@ -126,8 +126,8 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
     public void testWatcher() throws Exception {
         if (isRunningAgainstOldCluster()) {
             logger.info("Adding a watch on old cluster {}", getOldClusterVersion());
-            Request createBwcWatch = new Request("PUT", getWatcherEndpoint() + "/watch/bwc_watch");
-            Request createBwcThrottlePeriod = new Request("PUT", getWatcherEndpoint() + "/watch/bwc_throttle_period");
+            Request createBwcWatch = new Request("PUT", "/_watcher/watch/bwc_watch");
+            Request createBwcThrottlePeriod = new Request("PUT", "/_watcher/watch/bwc_throttle_period");
 
             createBwcWatch.setJsonEntity(loadWatch("simple-watch.json"));
             client().performRequest(createBwcWatch);
@@ -137,7 +137,7 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
             client().performRequest(createBwcThrottlePeriod);
 
             logger.info("Adding a watch with \"fun\" read timeout on old cluster");
-            Request createFunnyTimeout = new Request("PUT", getWatcherEndpoint() + "/watch/bwc_funny_timeout");
+            Request createFunnyTimeout = new Request("PUT", "/_watcher/watch/bwc_funny_timeout");
             createFunnyTimeout.setJsonEntity(loadWatch("funny-timeout-watch.json"));
             client().performRequest(createFunnyTimeout);
 
@@ -228,7 +228,7 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
             client().performRequest(bulkRequest);
 
             // create the rollup job
-            final Request createRollupJobRequest = new Request("PUT", getRollupEndpoint() + "/job/rollup-job-test");
+            final Request createRollupJobRequest = new Request("PUT", "/_rollup/job/rollup-job-test");
 
             String intervalType;
             if (getOldClusterVersion().onOrAfter(Version.V_7_2_0)) {
@@ -257,7 +257,7 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
             assertThat(createRollupJobResponse.get("acknowledged"), equalTo(Boolean.TRUE));
 
             // start the rollup job
-            final Request startRollupJobRequest = new Request("POST", getRollupEndpoint() + "/job/rollup-job-test/_start");
+            final Request startRollupJobRequest = new Request("POST", "/_rollup/job/rollup-job-test/_start");
             Map<String, Object> startRollupJobResponse = entityAsMap(client().performRequest(startRollupJobRequest));
             assertThat(startRollupJobResponse.get("started"), equalTo(Boolean.TRUE));
 
@@ -445,7 +445,7 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
 
     private void createUser(final boolean oldCluster) throws Exception {
         final String id = oldCluster ? "preupgrade_user" : "postupgrade_user";
-        Request request = new Request("PUT", getSecurityEndpoint() + "/user/" + id);
+        Request request = new Request("PUT", "/_security/user/" + id);
         request.setJsonEntity(
             "{\n" +
             "   \"password\" : \"j@rV1s\",\n" +
@@ -459,7 +459,7 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
 
     private void createRole(final boolean oldCluster) throws Exception {
         final String id = oldCluster ? "preupgrade_role" : "postupgrade_role";
-        Request request = new Request("PUT", getSecurityEndpoint() + "/role/" + id);
+        Request request = new Request("PUT", "/_security/role/" + id);
         request.setJsonEntity(
             "{\n" +
             "  \"run_as\": [ \"abc\" ],\n" +
@@ -480,7 +480,7 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
 
     private void assertUserInfo(final boolean oldCluster) throws Exception {
         final String user = oldCluster ? "preupgrade_user" : "postupgrade_user";
-        Request request = new Request("GET", getSecurityEndpoint() + "/user/" + user);;
+        Request request = new Request("GET", "/_security/user/" + user);;
         Map<String, Object> response = entityAsMap(client().performRequest(request));
         @SuppressWarnings("unchecked") Map<String, Object> userInfo = (Map<String, Object>) response.get(user);
         assertEquals(user + "@example.com", userInfo.get("email"));
@@ -488,50 +488,10 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
         assertNotNull(userInfo.get("roles"));
     }
 
-    private String getSecurityEndpoint() {
-        String securityEndpoint;
-        if (getOldClusterVersion().onOrAfter(Version.V_7_0_0) || isRunningAgainstOldCluster() == false) {
-            securityEndpoint = "/_security";
-        } else {
-            securityEndpoint = "/_xpack/security";
-        }
-        return securityEndpoint;
-    }
-
-    private String getSQLEndpoint() {
-        String securityEndpoint;
-        if (getOldClusterVersion().onOrAfter(Version.V_7_0_0) || isRunningAgainstOldCluster() == false) {
-            securityEndpoint = "/_sql";
-        } else {
-            securityEndpoint = "/_xpack/sql";
-        }
-        return securityEndpoint;
-    }
-
-    private String getRollupEndpoint() {
-        String securityEndpoint;
-        if (getOldClusterVersion().onOrAfter(Version.V_7_0_0) || isRunningAgainstOldCluster() == false) {
-            securityEndpoint = "/_rollup";
-        } else {
-            securityEndpoint = "/_xpack/rollup";
-        }
-        return securityEndpoint;
-    }
-
-    private String getWatcherEndpoint() {
-        String securityEndpoint;
-        if (getOldClusterVersion().onOrAfter(Version.V_7_0_0) || isRunningAgainstOldCluster() == false) {
-            securityEndpoint = "/_watcher";
-        } else {
-            securityEndpoint = "/_xpack/watcher";
-        }
-        return securityEndpoint;
-    }
-
     private void assertRoleInfo(final boolean oldCluster) throws Exception {
         final String role = oldCluster ? "preupgrade_role" : "postupgrade_role";
         @SuppressWarnings("unchecked") Map<String, Object> response = (Map<String, Object>) entityAsMap(
-            client().performRequest(new Request("GET", getSecurityEndpoint() + "/role/" + role))
+            client().performRequest(new Request("GET", "/_security/role/" + role))
         ).get(role);
         assertNotNull(response.get("run_as"));
         assertNotNull(response.get("cluster"));
@@ -544,7 +504,7 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
         waitForRollUpJob(rollupJob, expectedStates);
 
         // check that the rollup job is started using the RollUp API
-        final Request getRollupJobRequest = new Request("GET", getRollupEndpoint() + "/job/" + rollupJob);
+        final Request getRollupJobRequest = new Request("GET", "_rollup/job/" + rollupJob);
         Map<String, Object> getRollupJobResponse = entityAsMap(client().performRequest(getRollupJobRequest));
         Map<String, Object> job = getJob(getRollupJobResponse, rollupJob);
         assertNotNull(job);
@@ -583,7 +543,7 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
 
     private void waitForRollUpJob(final String rollupJob, final Matcher<?> expectedStates) throws Exception {
         assertBusy(() -> {
-            final Request getRollupJobRequest = new Request("GET", getRollupEndpoint() + "/job/" + rollupJob);
+            final Request getRollupJobRequest = new Request("GET", "/_rollup/job/" + rollupJob);
 
             Response getRollupJobResponse = client().performRequest(getRollupJobRequest);
             assertThat(getRollupJobResponse.getStatusLine().getStatusCode(), equalTo(RestStatus.OK.getStatus()));