use of org.graylog2.rest.models.system.responses.SystemThreadDumpResponse in project graylog2-server by Graylog2.
the class ClusterSystemResource method threadDump.
@GET
@Timed
@ApiOperation(value = "Get a thread dump of the given node")
@RequiresPermissions(RestPermissions.THREADS_DUMP)
@Path("{nodeId}/threaddump")
public SystemThreadDumpResponse threadDump(@ApiParam(name = "nodeId", value = "The id of the node to get a thread dump.", 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<SystemThreadDumpResponse> response = remoteSystemResource.threadDump().execute();
if (response.isSuccessful()) {
return response.body();
} else {
LOG.warn("Unable to get thread dump on node {}: {}", nodeId, response.message());
throw new WebApplicationException(response.message(), BAD_GATEWAY);
}
}
Aggregations