return responseResource.response( jsonNode.toString() );
}
ClusterHealthRequest clusterReq = new ClusterHealthRequest();
ActionFuture<ClusterHealthResponse> afClusterRes = client.cluster().health(clusterReq);
ClusterHealthResponse clusterRes = afClusterRes.actionGet();
jsonNode.put("clusterName", clusterRes.getClusterName());
jsonNode.put("numberOfNodes", clusterRes.getNumberOfNodes());
jsonNode.put("activeShards", clusterRes.getActiveShards());
jsonNode.put("activePrimaryShards", clusterRes.getActivePrimaryShards());
jsonNode.put("unasignedPrimaryShards", clusterRes.getUnassignedShards());
ClusterHealthStatus clusterStatus = clusterRes.getStatus();
jsonNode.put("status", clusterStatus);
return responseResource.response( jsonNode.toString() );
}