controller.registerHandler(GET, "/{index}/_skywalker", this);
}
@Override
public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
SkywalkerRequest r = new SkywalkerRequest(Strings.splitStringByCommaToArray(request.param("index")));
client.admin().cluster().execute(SkywalkerAction.INSTANCE, r, new RestResponseListener<SkywalkerResponse>(channel) {
@Override
public RestResponse buildResponse(SkywalkerResponse response) throws Exception {
XContentBuilder builder = jsonBuilder();
builder.startObject();