Search in sources :

Example 1 with NodeSummary

use of org.graylog2.rest.models.system.cluster.responses.NodeSummary in project graylog2-server by Graylog2.

the class ClusterResource method nodes.

@GET
@Timed
@Path("/nodes")
@ApiOperation(value = "List all active nodes in this cluster.")
public NodeSummaryList nodes() {
    final Map<String, Node> nodes = nodeService.allActive(Node.Type.SERVER);
    final List<NodeSummary> nodeList = new ArrayList<>(nodes.size());
    for (Node node : nodes.values()) {
        nodeList.add(nodeSummary(node));
    }
    return NodeSummaryList.create(nodeList);
}
Also used : NodeSummary(org.graylog2.rest.models.system.cluster.responses.NodeSummary) Node(org.graylog2.cluster.Node) ArrayList(java.util.ArrayList) Path(javax.ws.rs.Path) Timed(com.codahale.metrics.annotation.Timed) GET(javax.ws.rs.GET) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

Timed (com.codahale.metrics.annotation.Timed)1 ApiOperation (io.swagger.annotations.ApiOperation)1 ArrayList (java.util.ArrayList)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Node (org.graylog2.cluster.Node)1 NodeSummary (org.graylog2.rest.models.system.cluster.responses.NodeSummary)1