Skip to content

Commit 6620be3

Browse files
authored
Remove all v7-only REST endpoints (elastic#114765)
These endpoints were deprecated in v7 and are unsupported in v8 so we can remove them entirely in v9.
1 parent 4d775cb commit 6620be3

File tree

30 files changed

+29
-315
lines changed

30 files changed

+29
-315
lines changed

modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ public List<Route> routes() {
4646
new Route(GET, "/_msearch/template"),
4747
new Route(POST, "/_msearch/template"),
4848
new Route(GET, "/{index}/_msearch/template"),
49-
new Route(POST, "/{index}/_msearch/template"),
50-
Route.builder(GET, "/{index}/{type}/_msearch/template").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
51-
Route.builder(POST, "/{index}/{type}/_msearch/template").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build()
49+
new Route(POST, "/{index}/_msearch/template")
5250
);
5351
}
5452

modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateAction.java

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

1212
import org.elasticsearch.action.search.SearchRequest;
1313
import org.elasticsearch.client.internal.node.NodeClient;
14-
import org.elasticsearch.core.RestApiVersion;
1514
import org.elasticsearch.features.NodeFeature;
1615
import org.elasticsearch.rest.BaseRestHandler;
1716
import org.elasticsearch.rest.RestRequest;
@@ -48,13 +47,7 @@ public List<Route> routes() {
4847
new Route(GET, "/_search/template"),
4948
new Route(POST, "/_search/template"),
5049
new Route(GET, "/{index}/_search/template"),
51-
new Route(POST, "/{index}/_search/template"),
52-
Route.builder(GET, "/{index}/{type}/_search/template")
53-
.deprecated(RestSearchAction.TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7)
54-
.build(),
55-
Route.builder(POST, "/{index}/{type}/_search/template")
56-
.deprecated(RestSearchAction.TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7)
57-
.build()
50+
new Route(POST, "/{index}/_search/template")
5851
);
5952
}
6053

modules/reindex/src/main/java/org/elasticsearch/reindex/RestDeleteByQueryAction.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@
1010
package org.elasticsearch.reindex;
1111

1212
import org.elasticsearch.client.internal.node.NodeClient;
13-
import org.elasticsearch.core.RestApiVersion;
1413
import org.elasticsearch.features.NodeFeature;
1514
import org.elasticsearch.index.reindex.DeleteByQueryAction;
1615
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
1716
import org.elasticsearch.rest.RestRequest;
1817
import org.elasticsearch.rest.Scope;
1918
import org.elasticsearch.rest.ServerlessScope;
20-
import org.elasticsearch.rest.action.search.RestSearchAction;
2119

2220
import java.io.IOException;
2321
import java.util.HashMap;
@@ -40,13 +38,7 @@ public RestDeleteByQueryAction(Predicate<NodeFeature> clusterSupportsFeature) {
4038

4139
@Override
4240
public List<Route> routes() {
43-
return List.of(
44-
new Route(POST, "/{index}/_delete_by_query"),
45-
Route.builder(POST, "/{index}/{type}/_delete_by_query")
46-
.deprecated(RestSearchAction.TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7)
47-
.build()
48-
);
49-
41+
return List.of(new Route(POST, "/{index}/_delete_by_query"));
5042
}
5143

5244
@Override

modules/reindex/src/main/java/org/elasticsearch/reindex/RestUpdateByQueryAction.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import org.elasticsearch.rest.RestRequest;
1818
import org.elasticsearch.rest.Scope;
1919
import org.elasticsearch.rest.ServerlessScope;
20-
import org.elasticsearch.rest.action.search.RestSearchAction;
2120
import org.elasticsearch.script.Script;
2221

2322
import java.io.IOException;
@@ -41,12 +40,7 @@ public RestUpdateByQueryAction(Predicate<NodeFeature> clusterSupportsFeature) {
4140

4241
@Override
4342
public List<Route> routes() {
44-
return List.of(
45-
new Route(POST, "/{index}/_update_by_query"),
46-
Route.builder(POST, "/{index}/{type}/_update_by_query")
47-
.deprecated(RestSearchAction.TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7)
48-
.build()
49-
);
43+
return List.of(new Route(POST, "/{index}/_update_by_query"));
5044
}
5145

5246
@Override

server/src/main/java/org/elasticsearch/action/ActionModule.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,7 @@
352352
import org.elasticsearch.rest.action.admin.indices.RestRolloverIndexAction;
353353
import org.elasticsearch.rest.action.admin.indices.RestSimulateIndexTemplateAction;
354354
import org.elasticsearch.rest.action.admin.indices.RestSimulateTemplateAction;
355-
import org.elasticsearch.rest.action.admin.indices.RestSyncedFlushAction;
356355
import org.elasticsearch.rest.action.admin.indices.RestUpdateSettingsAction;
357-
import org.elasticsearch.rest.action.admin.indices.RestUpgradeActionDeprecated;
358356
import org.elasticsearch.rest.action.admin.indices.RestValidateQueryAction;
359357
import org.elasticsearch.rest.action.cat.AbstractCatAction;
360358
import org.elasticsearch.rest.action.cat.RestAliasAction;
@@ -916,7 +914,6 @@ public void initRestHandlers(Supplier<DiscoveryNodes> nodesInCluster, Predicate<
916914

917915
registerHandler.accept(new RestRefreshAction());
918916
registerHandler.accept(new RestFlushAction());
919-
registerHandler.accept(new RestSyncedFlushAction());
920917
registerHandler.accept(new RestForceMergeAction());
921918
registerHandler.accept(new RestClearIndicesCacheAction());
922919
registerHandler.accept(new RestResolveClusterAction());
@@ -1003,8 +1000,6 @@ public void initRestHandlers(Supplier<DiscoveryNodes> nodesInCluster, Predicate<
10031000
registerHandler.accept(new RestAnalyzeIndexDiskUsageAction());
10041001
registerHandler.accept(new RestFieldUsageStatsAction());
10051002

1006-
registerHandler.accept(new RestUpgradeActionDeprecated());
1007-
10081003
// Desired nodes
10091004
registerHandler.accept(new RestGetDesiredNodesAction());
10101005
registerHandler.accept(new RestUpdateDesiredNodesAction(clusterSupportsFeature));

server/src/main/java/org/elasticsearch/rest/RestHandler.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,6 @@ private RouteBuilder(Method method, String path) {
197197
this.restApiVersion = RestApiVersion.current();
198198
}
199199

200-
/**
201-
* @deprecated Use {@link #deprecatedForRemoval(String, RestApiVersion)} if the intent is deprecate the path and remove in the
202-
* next major version. Use {@link #deprecateAndKeep(String)} if the intent is to deprecate the path but not remove it.
203-
* This method will delegate to {@link #deprecatedForRemoval(String, RestApiVersion)}.
204-
*/
205-
@Deprecated(since = "9.0.0", forRemoval = true)
206-
public RouteBuilder deprecated(String deprecationMessage, RestApiVersion lastFullySupportedVersion) {
207-
return deprecatedForRemoval(deprecationMessage, lastFullySupportedVersion);
208-
}
209-
210200
/**
211201
* Marks that the route being built has been deprecated (for some reason -- the deprecationMessage) for removal. Notes the last
212202
* major version in which the path is fully supported without compatibility headers. If this path is being replaced by another

server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetFieldMappingAction.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,7 @@ public class RestGetFieldMappingAction extends BaseRestHandler {
4545

4646
@Override
4747
public List<Route> routes() {
48-
return List.of(
49-
new Route(GET, "/_mapping/field/{fields}"),
50-
new Route(GET, "/{index}/_mapping/field/{fields}"),
51-
Route.builder(GET, "/_mapping/{type}/field/{fields}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
52-
Route.builder(GET, "/{index}/{type}/_mapping/field/{fields}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
53-
Route.builder(GET, "/{index}/_mapping/{type}/field/{fields}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build()
54-
);
48+
return List.of(new Route(GET, "/_mapping/field/{fields}"), new Route(GET, "/{index}/_mapping/field/{fields}"));
5549
}
5650

5751
@Override

server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,8 @@ public List<Route> routes() {
4646
return List.of(
4747
new Route(GET, "/_mapping"),
4848
new Route(GET, "/_mappings"),
49-
Route.builder(GET, "/{index}/{type}/_mapping").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
5049
new Route(GET, "/{index}/_mapping"),
51-
new Route(GET, "/{index}/_mappings"),
52-
Route.builder(GET, "/{index}/_mappings/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
53-
Route.builder(GET, "/{index}/_mapping/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
54-
Route.builder(HEAD, "/{index}/_mapping/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
55-
Route.builder(GET, "/_mapping/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build()
50+
new Route(GET, "/{index}/_mappings")
5651
);
5752
}
5853

server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutMappingAction.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,7 @@ public List<Route> routes() {
4545
new Route(POST, "/{index}/_mapping/"),
4646
new Route(PUT, "/{index}/_mapping/"),
4747
new Route(POST, "/{index}/_mappings/"),
48-
new Route(PUT, "/{index}/_mappings/"),
49-
Route.builder(POST, "/{index}/{type}/_mapping").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
50-
Route.builder(PUT, "/{index}/{type}/_mapping").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
51-
Route.builder(POST, "/{index}/_mapping/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
52-
Route.builder(PUT, "/{index}/_mapping/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
53-
Route.builder(POST, "/_mapping/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
54-
Route.builder(PUT, "/_mapping/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
55-
Route.builder(POST, "/{index}/{type}/_mappings").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
56-
Route.builder(PUT, "/{index}/{type}/_mappings").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
57-
Route.builder(POST, "/{index}/_mappings/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
58-
Route.builder(PUT, "/{index}/_mappings/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
59-
Route.builder(POST, "/_mappings/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
60-
Route.builder(PUT, "/_mappings/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build()
48+
new Route(PUT, "/{index}/_mappings/")
6149
);
6250
}
6351

server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestSyncedFlushAction.java

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)