Deprecate alternatives to the hot threads API (#52930)
This commit deprecates various undocumented alternatives to the hot threads API.
This commit is contained in:
parent
e3ca124537
commit
b33fbe7026
|
@ -34,25 +34,67 @@ import org.elasticsearch.rest.action.RestResponseListener;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
import static java.util.Collections.unmodifiableList;
|
||||
import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
|
||||
public class RestNodesHotThreadsAction extends BaseRestHandler {
|
||||
|
||||
private static final String formatDeprecatedMessageWithoutNodeID = "[%s] is a deprecated endpoint. " +
|
||||
"Please use [/_nodes/hot_threads] instead.";
|
||||
private static final String formatDeprecatedMessageWithNodeID = "[%s] is a deprecated endpoint. " +
|
||||
"Please use [/_nodes/{nodeId}/hot_threads] instead.";
|
||||
private static final String DEPRECATED_MESSAGE_CLUSTER_NODES_HOT_THREADS = String.format(Locale.ROOT,
|
||||
formatDeprecatedMessageWithoutNodeID,
|
||||
"/_cluster/nodes/hot_threads"
|
||||
);
|
||||
private static final String DEPRECATED_MESSAGE_CLUSTER_NODES_NODEID_HOT_THREADS = String.format(Locale.ROOT,
|
||||
formatDeprecatedMessageWithNodeID,
|
||||
"/_cluster/nodes/{nodeId}/hot_threads"
|
||||
);
|
||||
private static final String DEPRECATED_MESSAGE_CLUSTER_NODES_HOTTHREADS = String.format(Locale.ROOT,
|
||||
formatDeprecatedMessageWithoutNodeID,
|
||||
"/_cluster/nodes/hotthreads"
|
||||
);
|
||||
private static final String DEPRECATED_MESSAGE_CLUSTER_NODES_NODEID_HOTTHREADS = String.format(Locale.ROOT,
|
||||
formatDeprecatedMessageWithNodeID,
|
||||
"/_cluster/nodes/{nodeId}/hotthreads"
|
||||
);
|
||||
private static final String DEPRECATED_MESSAGE_NODES_HOTTHREADS = String.format(Locale.ROOT,
|
||||
formatDeprecatedMessageWithoutNodeID,
|
||||
"/_nodes/hotthreads"
|
||||
);
|
||||
private static final String DEPRECATED_MESSAGE_NODES_NODEID_HOTTHREADS = String.format(Locale.ROOT,
|
||||
formatDeprecatedMessageWithNodeID,
|
||||
"/_nodes/{nodeId}/hotthreads"
|
||||
);
|
||||
|
||||
@Override
|
||||
public List<DeprecatedRoute> deprecatedRoutes() {
|
||||
return unmodifiableList(asList(
|
||||
new DeprecatedRoute(GET, "/_cluster/nodes/hot_threads",
|
||||
DEPRECATED_MESSAGE_CLUSTER_NODES_HOT_THREADS),
|
||||
new DeprecatedRoute(GET, "/_cluster/nodes/{nodeId}/hot_threads",
|
||||
DEPRECATED_MESSAGE_CLUSTER_NODES_NODEID_HOT_THREADS),
|
||||
new DeprecatedRoute(GET, "/_cluster/nodes/hotthreads",
|
||||
DEPRECATED_MESSAGE_CLUSTER_NODES_HOTTHREADS),
|
||||
new DeprecatedRoute(GET, "/_cluster/nodes/{nodeId}/hotthreads",
|
||||
DEPRECATED_MESSAGE_CLUSTER_NODES_NODEID_HOTTHREADS),
|
||||
new DeprecatedRoute(GET, "/_nodes/hotthreads",
|
||||
DEPRECATED_MESSAGE_NODES_HOTTHREADS),
|
||||
new DeprecatedRoute(GET, "/_nodes/{nodeId}/hotthreads",
|
||||
DEPRECATED_MESSAGE_NODES_NODEID_HOTTHREADS)
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return unmodifiableList(asList(
|
||||
new Route(GET, "/_cluster/nodes/hotthreads"),
|
||||
new Route(GET, "/_cluster/nodes/hot_threads"),
|
||||
new Route(GET, "/_cluster/nodes/{nodeId}/hotthreads"),
|
||||
new Route(GET, "/_cluster/nodes/{nodeId}/hot_threads"),
|
||||
new Route(GET, "/_nodes/hotthreads"),
|
||||
new Route(GET, "/_nodes/hot_threads"),
|
||||
new Route(GET, "/_nodes/{nodeId}/hotthreads"),
|
||||
new Route(GET, "/_nodes/{nodeId}/hot_threads")));
|
||||
new Route(GET, "/_nodes/{nodeId}/hot_threads")
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue