public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
String[] nodesIds = Strings.splitStringByCommaToArray(request.param("nodeId"));
NodesShutdownRequest nodesShutdownRequest = new NodesShutdownRequest(nodesIds);
nodesShutdownRequest.listenerThreaded(false);
nodesShutdownRequest.delay(request.paramAsTime("delay", nodesShutdownRequest.delay()));
nodesShutdownRequest.exit(request.paramAsBoolean("exit", nodesShutdownRequest.exit()));
client.admin().cluster().nodesShutdown(nodesShutdownRequest, new RestBuilderListener<NodesShutdownResponse>(channel) {
@Override
public RestResponse buildResponse(NodesShutdownResponse response, XContentBuilder builder) throws Exception {
builder.startObject();
builder.field("cluster_name", response.getClusterName().value());