controller.registerHandler(RestRequest.Method.POST, "/_cluster/nodes/{nodeId}/_restart", this);
}
@Override public void handleRequest(final RestRequest request, final RestChannel channel) {
String[] nodesIds = RestActions.splitNodes(request.param("nodeId"));
NodesRestartRequest nodesRestartRequest = new NodesRestartRequest(nodesIds);
nodesRestartRequest.listenerThreaded(false);
nodesRestartRequest.delay(request.paramAsTime("delay", nodesRestartRequest.delay()));
client.admin().cluster().nodesRestart(nodesRestartRequest, new ActionListener<NodesRestartResponse>() {
@Override public void onResponse(NodesRestartResponse result) {
try {
XContentBuilder builder = restContentBuilder(request);
builder.startObject();