use of com.thinkbiganalytics.jobrepo.query.model.FeedHealth in project kylo by Teradata.
the class FeedModelTransform method feedHealth.
/**
* Transform the FeedHealth domain object to the REST friendly FeedHealth object
*
* @return the transformed FeedHealth object
*/
public static FeedHealth feedHealth(com.thinkbiganalytics.metadata.api.feed.FeedHealth domain) {
FeedHealth feedHealth = new DefaultFeedHealth();
feedHealth.setUnhealthyCount(domain.getFailedCount());
feedHealth.setHealthyCount(domain.getCompletedCount());
feedHealth.setFeed(domain.getFeedName());
feedHealth.setFeedId(domain.getFeedId() != null ? domain.getFeedId().toString() : null);
feedHealth.setLastOpFeed(executedFeed(domain));
feedHealth.setStream(domain.isStream());
feedHealth.setRunningCount(domain.getRunningCount());
return feedHealth;
}
use of com.thinkbiganalytics.jobrepo.query.model.FeedHealth in project kylo by Teradata.
the class FeedsRestController method getFeedHealth.
@GET
@Path("/health")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation("Provides a detailed health status of every feed.")
@ApiResponses(@ApiResponse(code = 200, message = "Returns the health.", response = FeedStatus.class))
public FeedStatus getFeedHealth(@Context HttpServletRequest request) {
this.accessController.checkPermission(AccessController.SERVICES, OperationsAccessControl.ACCESS_OPS);
return metadataAccess.read(() -> {
List<FeedHealth> feedHealth = getFeedHealthCounts(request);
FeedStatus status = FeedModelTransform.feedStatus(feedHealth);
return status;
});
}
Aggregations