use of org.graylog2.rest.models.system.responses.SystemJVMResponse in project graylog2-server by Graylog2.
the class ClusterSystemResource method jvm.
@GET
@Timed
@ApiOperation(value = "Get JVM information of the given node")
@Path("{nodeId}/jvm")
public SystemJVMResponse jvm(@ApiParam(name = "nodeId", value = "The id of the node to retrieve JVM information.", required = true) @PathParam("nodeId") String nodeId) throws IOException, NodeNotFoundException {
final Node targetNode = nodeService.byNodeId(nodeId);
final RemoteSystemResource remoteSystemResource = remoteInterfaceProvider.get(targetNode, this.authenticationToken, RemoteSystemResource.class);
final Response<SystemJVMResponse> response = remoteSystemResource.jvm().execute();
if (response.isSuccessful()) {
return response.body();
} else {
LOG.warn("Unable to get jvm information on node {}: {}", nodeId, response.message());
throw new WebApplicationException(response.message(), BAD_GATEWAY);
}
}
Aggregations