Skip to content

Commit 162dce5

Browse files
authored
Remove unused v7-only APIs (#114733)
Removes several REST endpoints that only existed in the now-inaccessible v7-compatible mode.
1 parent 4eda4a3 commit 162dce5

File tree

2 files changed

+2
-73
lines changed

2 files changed

+2
-73
lines changed

server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestAddVotingConfigExclusionAction.java

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import org.elasticsearch.action.admin.cluster.configuration.TransportAddVotingConfigExclusionsAction;
1414
import org.elasticsearch.client.internal.node.NodeClient;
1515
import org.elasticsearch.common.Strings;
16-
import org.elasticsearch.core.RestApiVersion;
1716
import org.elasticsearch.core.TimeValue;
1817
import org.elasticsearch.rest.BaseRestHandler;
1918
import org.elasticsearch.rest.RestRequest;
@@ -28,23 +27,14 @@
2827
public class RestAddVotingConfigExclusionAction extends BaseRestHandler {
2928
private static final TimeValue DEFAULT_TIMEOUT = TimeValue.timeValueSeconds(30L);
3029

31-
private static final String DEPRECATION_MESSAGE = "POST /_cluster/voting_config_exclusions/{node_name} "
32-
+ "has been removed. You must use POST /_cluster/voting_config_exclusions?node_ids=... "
33-
+ "or POST /_cluster/voting_config_exclusions?node_names=... instead.";
34-
3530
@Override
3631
public String getName() {
3732
return "add_voting_config_exclusions_action";
3833
}
3934

4035
@Override
4136
public List<Route> routes() {
42-
return List.of(
43-
new Route(POST, "/_cluster/voting_config_exclusions"),
44-
Route.builder(POST, "/_cluster/voting_config_exclusions/{node_name}")
45-
.deprecated(DEPRECATION_MESSAGE, RestApiVersion.V_7)
46-
.build()
47-
);
37+
return List.of(new Route(POST, "/_cluster/voting_config_exclusions"));
4838
}
4939

5040
@Override
@@ -66,10 +56,6 @@ static AddVotingConfigExclusionsRequest resolveVotingConfigExclusionsRequest(fin
6656
String nodeIds = null;
6757
String nodeNames = null;
6858

69-
if (request.getRestApiVersion() == RestApiVersion.V_7 && request.hasParam("node_name")) {
70-
throw new IllegalArgumentException("[node_name] has been removed, you must set [node_names] or [node_ids]");
71-
}
72-
7359
if (request.hasParam("node_ids")) {
7460
nodeIds = request.param("node_ids");
7561
}

server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesHotThreadsAction.java

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.elasticsearch.action.admin.cluster.node.hotthreads.TransportNodesHotThreadsAction;
1515
import org.elasticsearch.client.internal.node.NodeClient;
1616
import org.elasticsearch.common.Strings;
17-
import org.elasticsearch.core.RestApiVersion;
1817
import org.elasticsearch.monitor.jvm.HotThreads;
1918
import org.elasticsearch.rest.BaseRestHandler;
2019
import org.elasticsearch.rest.RestRequest;
@@ -26,7 +25,6 @@
2625

2726
import java.io.IOException;
2827
import java.util.List;
29-
import java.util.Locale;
3028

3129
import static org.elasticsearch.rest.ChunkedRestResponseBodyPart.fromTextChunks;
3230
import static org.elasticsearch.rest.RestRequest.Method.GET;
@@ -36,64 +34,9 @@
3634
@ServerlessScope(Scope.INTERNAL)
3735
public class RestNodesHotThreadsAction extends BaseRestHandler {
3836

39-
private static final String formatDeprecatedMessageWithoutNodeID = "[%s] is a deprecated endpoint. "
40-
+ "Please use [/_nodes/hot_threads] instead.";
41-
private static final String formatDeprecatedMessageWithNodeID = "[%s] is a deprecated endpoint. "
42-
+ "Please use [/_nodes/{nodeId}/hot_threads] instead.";
43-
private static final String DEPRECATED_MESSAGE_CLUSTER_NODES_HOT_THREADS = String.format(
44-
Locale.ROOT,
45-
formatDeprecatedMessageWithoutNodeID,
46-
"/_cluster/nodes/hot_threads"
47-
);
48-
private static final String DEPRECATED_MESSAGE_CLUSTER_NODES_NODEID_HOT_THREADS = String.format(
49-
Locale.ROOT,
50-
formatDeprecatedMessageWithNodeID,
51-
"/_cluster/nodes/{nodeId}/hot_threads"
52-
);
53-
private static final String DEPRECATED_MESSAGE_CLUSTER_NODES_HOTTHREADS = String.format(
54-
Locale.ROOT,
55-
formatDeprecatedMessageWithoutNodeID,
56-
"/_cluster/nodes/hotthreads"
57-
);
58-
private static final String DEPRECATED_MESSAGE_CLUSTER_NODES_NODEID_HOTTHREADS = String.format(
59-
Locale.ROOT,
60-
formatDeprecatedMessageWithNodeID,
61-
"/_cluster/nodes/{nodeId}/hotthreads"
62-
);
63-
private static final String DEPRECATED_MESSAGE_NODES_HOTTHREADS = String.format(
64-
Locale.ROOT,
65-
formatDeprecatedMessageWithoutNodeID,
66-
"/_nodes/hotthreads"
67-
);
68-
private static final String DEPRECATED_MESSAGE_NODES_NODEID_HOTTHREADS = String.format(
69-
Locale.ROOT,
70-
formatDeprecatedMessageWithNodeID,
71-
"/_nodes/{nodeId}/hotthreads"
72-
);
73-
7437
@Override
7538
public List<Route> routes() {
76-
return List.of(
77-
new Route(GET, "/_nodes/hot_threads"),
78-
new Route(GET, "/_nodes/{nodeId}/hot_threads"),
79-
80-
Route.builder(GET, "/_cluster/nodes/hot_threads")
81-
.deprecated(DEPRECATED_MESSAGE_CLUSTER_NODES_HOT_THREADS, RestApiVersion.V_7)
82-
.build(),
83-
Route.builder(GET, "/_cluster/nodes/{nodeId}/hot_threads")
84-
.deprecated(DEPRECATED_MESSAGE_CLUSTER_NODES_NODEID_HOT_THREADS, RestApiVersion.V_7)
85-
.build(),
86-
Route.builder(GET, "/_cluster/nodes/hotthreads")
87-
.deprecated(DEPRECATED_MESSAGE_CLUSTER_NODES_HOTTHREADS, RestApiVersion.V_7)
88-
.build(),
89-
Route.builder(GET, "/_cluster/nodes/{nodeId}/hotthreads")
90-
.deprecated(DEPRECATED_MESSAGE_CLUSTER_NODES_NODEID_HOTTHREADS, RestApiVersion.V_7)
91-
.build(),
92-
Route.builder(GET, "/_nodes/hotthreads").deprecated(DEPRECATED_MESSAGE_NODES_HOTTHREADS, RestApiVersion.V_7).build(),
93-
Route.builder(GET, "/_nodes/{nodeId}/hotthreads")
94-
.deprecated(DEPRECATED_MESSAGE_NODES_NODEID_HOTTHREADS, RestApiVersion.V_7)
95-
.build()
96-
);
39+
return List.of(new Route(GET, "/_nodes/hot_threads"), new Route(GET, "/_nodes/{nodeId}/hot_threads"));
9740
}
9841

9942
@Override

0 commit comments

Comments
 (0)