use of org.graylog2.rest.resources.system.RemoteJournalResource in project graylog2-server by Graylog2.
the class ClusterJournalResource method get.
@GET
@Timed
@ApiOperation(value = "Get message journal information of a given node")
@RequiresPermissions(RestPermissions.JOURNAL_READ)
public JournalSummaryResponse get(@ApiParam(name = "nodeId", value = "The id of the node to get message journal information.", required = true) @PathParam("nodeId") String nodeId) throws IOException, NodeNotFoundException {
final Node targetNode = nodeService.byNodeId(nodeId);
final RemoteJournalResource remoteJournalResource = remoteInterfaceProvider.get(targetNode, this.authenticationToken, RemoteJournalResource.class);
final Response<JournalSummaryResponse> response = remoteJournalResource.get().execute();
if (response.isSuccessful()) {
return response.body();
} else {
LOG.warn("Unable to get message journal information on node {}: {}", nodeId, response.message());
throw new WebApplicationException(response.message(), BAD_GATEWAY);
}
}
Aggregations