Skip to content

Commit a12b409

Browse files
authored
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
1 parent ac5eaf8 commit a12b409

File tree

33 files changed

+69
-347
lines changed

33 files changed

+69
-347
lines changed

docs/reference/migration/migrate_8_0.asciidoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ Indices created in Elasticsearch 6.x or before will need to be reindexed with
5050
Elasticsearch 7.x in order to be readable by Elasticsearch 8.x.
5151
5252
=========================================
53+
54+
[float]
55+
==== REST endpoints containing `_xpack`
56+
57+
In 7.0, we deprecated REST endpoints that contain `_xpack` in their path. These
58+
endpoints are now removed in 8.0. Each endpoint that was deprecated and removed
59+
is replaced with a new endpoint that does not contain `_xpack`. As an example,
60+
`/{index}/_xpack/graph/_explore` is replaced by `/{index}/_graph/explore`.
61+
62+
5363
// end::notable-breaking-changes[]
5464

5565
include::migrate_8_0/analysis.asciidoc[]

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
package org.elasticsearch.license;
88

9-
import org.apache.logging.log4j.LogManager;
109
import org.elasticsearch.client.node.NodeClient;
11-
import org.elasticsearch.common.logging.DeprecationLogger;
1210
import org.elasticsearch.protocol.xpack.license.DeleteLicenseRequest;
1311
import org.elasticsearch.rest.BaseRestHandler;
1412
import org.elasticsearch.rest.RestController;
@@ -21,13 +19,8 @@
2119

2220
public class RestDeleteLicenseAction extends BaseRestHandler {
2321

24-
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestDeleteLicenseAction.class));
25-
2622
RestDeleteLicenseAction(RestController controller) {
27-
// TODO: remove deprecated endpoint in 8.0.0
28-
controller.registerWithDeprecatedHandler(
29-
DELETE, "/_license", this,
30-
DELETE, "/_xpack/license", deprecationLogger);
23+
controller.registerHandler(DELETE, "/_license", this);
3124
}
3225

3326
@Override

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
package org.elasticsearch.license;
88

9-
import org.apache.logging.log4j.LogManager;
109
import org.elasticsearch.client.node.NodeClient;
11-
import org.elasticsearch.common.logging.DeprecationLogger;
1210
import org.elasticsearch.rest.BaseRestHandler;
1311
import org.elasticsearch.rest.RestController;
1412
import org.elasticsearch.rest.RestRequest;
@@ -18,13 +16,8 @@
1816

1917
public class RestGetBasicStatus extends BaseRestHandler {
2018

21-
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetBasicStatus.class));
22-
2319
RestGetBasicStatus(RestController controller) {
24-
// TODO: remove deprecated endpoint in 8.0.0
25-
controller.registerWithDeprecatedHandler(
26-
GET, "/_license/basic_status", this,
27-
GET, "/_xpack/license/basic_status", deprecationLogger);
20+
controller.registerHandler(GET, "/_license/basic_status", this);
2821
}
2922

3023
@Override

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
package org.elasticsearch.license;
88

9-
import org.apache.logging.log4j.LogManager;
109
import org.elasticsearch.client.node.NodeClient;
11-
import org.elasticsearch.common.logging.DeprecationLogger;
1210
import org.elasticsearch.common.xcontent.ToXContent;
1311
import org.elasticsearch.common.xcontent.XContentBuilder;
1412
import org.elasticsearch.protocol.xpack.license.GetLicenseRequest;
@@ -29,13 +27,8 @@
2927

3028
public class RestGetLicenseAction extends BaseRestHandler {
3129

32-
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetLicenseAction.class));
33-
3430
RestGetLicenseAction(RestController controller) {
35-
// TODO: remove deprecated endpoint in 8.0.0
36-
controller.registerWithDeprecatedHandler(
37-
GET, "/_license", this,
38-
GET, "/_xpack/license", deprecationLogger);
31+
controller.registerHandler(GET, "/_license", this);
3932
}
4033

4134
@Override

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
package org.elasticsearch.license;
88

9-
import org.apache.logging.log4j.LogManager;
109
import org.elasticsearch.client.node.NodeClient;
11-
import org.elasticsearch.common.logging.DeprecationLogger;
1210
import org.elasticsearch.rest.BaseRestHandler;
1311
import org.elasticsearch.rest.RestController;
1412
import org.elasticsearch.rest.RestRequest;
@@ -18,13 +16,8 @@
1816

1917
public class RestGetTrialStatus extends BaseRestHandler {
2018

21-
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetTrialStatus.class));
22-
2319
RestGetTrialStatus(RestController controller) {
24-
// TODO: remove deprecated endpoint in 8.0.0
25-
controller.registerWithDeprecatedHandler(
26-
GET, "/_license/trial_status", this,
27-
GET, "/_xpack/license/trial_status", deprecationLogger);
20+
controller.registerHandler(GET, "/_license/trial_status", this);
2821
}
2922

3023
@Override

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
package org.elasticsearch.license;
88

9-
import org.apache.logging.log4j.LogManager;
109
import org.elasticsearch.client.node.NodeClient;
11-
import org.elasticsearch.common.logging.DeprecationLogger;
1210
import org.elasticsearch.rest.BaseRestHandler;
1311
import org.elasticsearch.rest.RestController;
1412
import org.elasticsearch.rest.RestRequest;
@@ -20,13 +18,8 @@
2018

2119
public class RestPostStartBasicLicense extends BaseRestHandler {
2220

23-
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPostStartBasicLicense.class));
24-
2521
RestPostStartBasicLicense(RestController controller) {
26-
// TODO: remove deprecated endpoint in 8.0.0
27-
controller.registerWithDeprecatedHandler(
28-
POST, "/_license/start_basic", this,
29-
POST, "/_xpack/license/start_basic", deprecationLogger);
22+
controller.registerHandler(POST, "/_license/start_basic", this);
3023
}
3124

3225
@Override

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
package org.elasticsearch.license;
88

9-
import org.apache.logging.log4j.LogManager;
109
import org.elasticsearch.client.node.NodeClient;
11-
import org.elasticsearch.common.logging.DeprecationLogger;
1210
import org.elasticsearch.common.xcontent.XContentBuilder;
1311
import org.elasticsearch.rest.BaseRestHandler;
1412
import org.elasticsearch.rest.BytesRestResponse;
@@ -24,13 +22,8 @@
2422

2523
public class RestPostStartTrialLicense extends BaseRestHandler {
2624

27-
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPostStartTrialLicense.class));
28-
2925
RestPostStartTrialLicense(RestController controller) {
30-
// TODO: remove deprecated endpoint in 8.0.0
31-
controller.registerWithDeprecatedHandler(
32-
POST, "/_license/start_trial", this,
33-
POST, "/_xpack/license/start_trial", deprecationLogger);
26+
controller.registerHandler(POST, "/_license/start_trial", this);
3427
}
3528

3629
@Override

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

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
package org.elasticsearch.license;
88

9-
import org.apache.logging.log4j.LogManager;
109
import org.elasticsearch.client.node.NodeClient;
11-
import org.elasticsearch.common.logging.DeprecationLogger;
1210
import org.elasticsearch.rest.BaseRestHandler;
1311
import org.elasticsearch.rest.RestController;
1412
import org.elasticsearch.rest.RestRequest;
@@ -21,18 +19,10 @@
2119

2220
public class RestPutLicenseAction extends BaseRestHandler {
2321

24-
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPutLicenseAction.class));
25-
2622
RestPutLicenseAction(RestController controller) {
2723
// TODO: remove POST endpoint?
28-
// TODO: remove deprecated endpoint in 8.0.0
29-
controller.registerWithDeprecatedHandler(
30-
POST, "/_license", this,
31-
POST, "/_xpack/license", deprecationLogger);
32-
// TODO: remove deprecated endpoint in 8.0.0
33-
controller.registerWithDeprecatedHandler(
34-
PUT, "/_license", this,
35-
PUT, "/_xpack/license", deprecationLogger);
24+
controller.registerHandler(POST, "/_license", this);
25+
controller.registerHandler(PUT, "/_license", this);
3626
}
3727

3828
@Override

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
*/
66
package org.elasticsearch.xpack.core.ssl.rest;
77

8-
import org.apache.logging.log4j.LogManager;
98
import org.elasticsearch.client.node.NodeClient;
10-
import org.elasticsearch.common.logging.DeprecationLogger;
119
import org.elasticsearch.common.xcontent.XContentBuilder;
1210
import org.elasticsearch.rest.BaseRestHandler;
1311
import org.elasticsearch.rest.BytesRestResponse;
@@ -27,14 +25,8 @@
2725
*/
2826
public class RestGetCertificateInfoAction extends BaseRestHandler {
2927

30-
private static final DeprecationLogger deprecationLogger =
31-
new DeprecationLogger(LogManager.getLogger(RestGetCertificateInfoAction.class));
32-
3328
public RestGetCertificateInfoAction(RestController controller) {
34-
// TODO: remove deprecated endpoint in 8.0.0
35-
controller.registerWithDeprecatedHandler(
36-
GET, "/_ssl/certificates", this,
37-
GET, "/_xpack/ssl/certificates", deprecationLogger);
29+
controller.registerHandler(GET, "/_ssl/certificates", this);
3830
}
3931

4032
@Override

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import org.apache.logging.log4j.Logger;
1010
import org.elasticsearch.client.node.NodeClient;
1111
import org.elasticsearch.common.Strings;
12-
import org.elasticsearch.common.logging.DeprecationLogger;
1312
import org.elasticsearch.rest.BaseRestHandler;
1413
import org.elasticsearch.rest.RestController;
1514
import org.elasticsearch.rest.RestRequest;
@@ -21,15 +20,10 @@
2120

2221
public class RestDeprecationInfoAction extends BaseRestHandler {
2322
private static final Logger logger = LogManager.getLogger(RestDeprecationInfoAction.class);
24-
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
2523

2624
public RestDeprecationInfoAction(RestController controller) {
27-
controller.registerWithDeprecatedHandler(
28-
RestRequest.Method.GET, "/_migration/deprecations", this,
29-
RestRequest.Method.GET, "/_xpack/migration/deprecations", deprecationLogger);
30-
controller.registerWithDeprecatedHandler(
31-
RestRequest.Method.GET, "/{index}/_migration/deprecations", this,
32-
RestRequest.Method.GET, "/{index}/_xpack/migration/deprecations", deprecationLogger);
25+
controller.registerHandler(RestRequest.Method.GET, "/_migration/deprecations", this);
26+
controller.registerHandler(RestRequest.Method.GET, "/{index}/_migration/deprecations", this);
3327
}
3428

3529
@Override

0 commit comments

Comments
 (0)