use of org.graylog2.rest.models.system.indexer.responses.ClusterHealth in project graylog2-server by Graylog2.
the class IndexerClusterResource method clusterHealth.
@GET
@Timed
@Path("/health")
@ApiOperation(value = "Get cluster and shard health overview")
@RequiresPermissions(RestPermissions.INDEXERCLUSTER_READ)
@Produces(MediaType.APPLICATION_JSON)
public ClusterHealth clusterHealth() {
final ClusterHealthResponse health = cluster.health();
final ClusterHealth.ShardStatus shards = ClusterHealth.ShardStatus.create(health.getActiveShards(), health.getInitializingShards(), health.getRelocatingShards(), health.getUnassignedShards());
return ClusterHealth.create(health.getStatus().toString().toLowerCase(Locale.ENGLISH), shards);
}
Aggregations