Search in sources :

Example 6 with FeedHealth

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;
}
Also used : DefaultFeedHealth(com.thinkbiganalytics.jobrepo.query.model.DefaultFeedHealth) FeedHealth(com.thinkbiganalytics.jobrepo.query.model.FeedHealth) DefaultFeedHealth(com.thinkbiganalytics.jobrepo.query.model.DefaultFeedHealth)

Example 7 with 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;
    });
}
Also used : FeedStatus(com.thinkbiganalytics.jobrepo.query.model.FeedStatus) FeedHealth(com.thinkbiganalytics.jobrepo.query.model.FeedHealth) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

FeedHealth (com.thinkbiganalytics.jobrepo.query.model.FeedHealth)7 DefaultFeedHealth (com.thinkbiganalytics.jobrepo.query.model.DefaultFeedHealth)4 FeedStatus (com.thinkbiganalytics.jobrepo.query.model.FeedStatus)2 ApiOperation (io.swagger.annotations.ApiOperation)2 ApiResponses (io.swagger.annotations.ApiResponses)2 GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 ExecutedFeed (com.thinkbiganalytics.jobrepo.query.model.ExecutedFeed)1 FeedSummary (com.thinkbiganalytics.metadata.api.feed.FeedSummary)1 OpsManagerFeed (com.thinkbiganalytics.metadata.api.feed.OpsManagerFeed)1 JpaFeedSummary (com.thinkbiganalytics.metadata.jpa.feed.JpaFeedSummary)1 SearchResultImpl (com.thinkbiganalytics.rest.model.search.SearchResultImpl)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Nonnull (javax.annotation.Nonnull)1 NotFoundException (javax.ws.rs.NotFoundException)1