Search in sources :

Example 1 with FeatureGroupAlertDTO

use of io.hops.hopsworks.api.featurestore.datavalidation.alert.FeatureGroupAlertDTO in project hopsworks by logicalclocks.

the class ProjectAlertsResource method getAllAlerts.

@GET
@Path("all")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Get project, job and feature group alerts.", response = ProjectAllAlertsDTO.class)
@AllowedProjectRoles({ AllowedProjectRoles.DATA_OWNER, AllowedProjectRoles.DATA_SCIENTIST })
@JWTRequired(acceptedTokens = { Audience.API }, allowedUserRoles = { "HOPS_ADMIN", "HOPS_USER" })
public Response getAllAlerts(@Context UriInfo uriInfo, @Context SecurityContext sc) throws ProjectException {
    ResourceRequest resourceRequest = new ResourceRequest(ResourceRequest.Name.ALERTS);
    ProjectAlertsDTO projectAlertsDTO = projectAlertsBuilder.buildItemsAll(uriInfo, resourceRequest, getProject());
    JobAlertsDTO jobAlertsDTO = jobAlertsBuilder.buildItems(uriInfo, resourceRequest, getProject());
    FeatureGroupAlertDTO featureGroupAlertDTO = featureGroupAlertBuilder.buildItems(uriInfo, resourceRequest, getProject());
    ProjectAllAlertsDTO projectAllAlertsDTO = new ProjectAllAlertsDTO();
    projectAllAlertsDTO.setProjectAlerts(projectAlertsDTO);
    projectAllAlertsDTO.setJobAlerts(jobAlertsDTO);
    projectAllAlertsDTO.setFeatureGroupAlerts(featureGroupAlertDTO);
    return Response.ok().entity(projectAllAlertsDTO).build();
}
Also used : FeatureGroupAlertDTO(io.hops.hopsworks.api.featurestore.datavalidation.alert.FeatureGroupAlertDTO) ResourceRequest(io.hops.hopsworks.common.api.ResourceRequest) JobAlertsDTO(io.hops.hopsworks.api.jobs.alert.JobAlertsDTO) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) JWTRequired(io.hops.hopsworks.jwt.annotation.JWTRequired) ApiOperation(io.swagger.annotations.ApiOperation) AllowedProjectRoles(io.hops.hopsworks.api.filter.AllowedProjectRoles)

Aggregations

FeatureGroupAlertDTO (io.hops.hopsworks.api.featurestore.datavalidation.alert.FeatureGroupAlertDTO)1 AllowedProjectRoles (io.hops.hopsworks.api.filter.AllowedProjectRoles)1 JobAlertsDTO (io.hops.hopsworks.api.jobs.alert.JobAlertsDTO)1 ResourceRequest (io.hops.hopsworks.common.api.ResourceRequest)1 JWTRequired (io.hops.hopsworks.jwt.annotation.JWTRequired)1 ApiOperation (io.swagger.annotations.ApiOperation)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1