Search in sources :

Example 86 with GET

use of javax.ws.rs.GET in project jersey by jersey.

the class TestExceptionResource method getUnmappedException.

@GET
@Path("unmapped")
public void getUnmappedException(@Suspended final AsyncResponse asyncResponse) {
    lastProcessingThread = Thread.currentThread();
    asyncResponse.resume(new UnmappedException());
}
Also used : UnmappedException(org.glassfish.jersey.tests.integration.jersey2730.exception.UnmappedException) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Example 87 with GET

use of javax.ws.rs.GET in project jersey by jersey.

the class TestExceptionResource method getUnmappedRuntimeException.

@GET
@Path("runtime")
public void getUnmappedRuntimeException(@Suspended final AsyncResponse asyncResponse) {
    lastProcessingThread = Thread.currentThread();
    asyncResponse.resume(new UnmappedRuntimeException());
}
Also used : UnmappedRuntimeException(org.glassfish.jersey.tests.integration.jersey2730.exception.UnmappedRuntimeException) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Example 88 with GET

use of javax.ws.rs.GET in project pinot by linkedin.

the class AnomaliesResource method getAnomaliesByDashboardId.

/**
   * Find anomalies by dashboard id
   * @param startTime
   * @param endTime
   * @param dashboardId
   * @param functionName
   * @return
   * @throws Exception
   */
@GET
@Path("search/dashboardId/{startTime}/{endTime}/{pageNumber}")
public AnomaliesWrapper getAnomaliesByDashboardId(@PathParam("startTime") Long startTime, @PathParam("endTime") Long endTime, @PathParam("pageNumber") int pageNumber, @QueryParam("dashboardId") String dashboardId, @QueryParam("functionName") String functionName) throws Exception {
    DashboardConfigDTO dashboardConfig = dashboardConfigDAO.findById(Long.valueOf(dashboardId));
    String metricIdsString = Joiner.on(COMMA_SEPARATOR).join(dashboardConfig.getMetricIds());
    return getAnomaliesByMetricIds(startTime, endTime, pageNumber, metricIdsString, functionName);
}
Also used : DashboardConfigDTO(com.linkedin.thirdeye.datalayer.dto.DashboardConfigDTO) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Example 89 with GET

use of javax.ws.rs.GET in project pinot by linkedin.

the class AnomaliesResource method getAnomaliesByTime.

/**
   * Search anomalies only by time
   * @param startTime
   * @param endTime
   * @return
   * @throws Exception
   */
@GET
@Path("search/time/{startTime}/{endTime}/{pageNumber}")
public AnomaliesWrapper getAnomaliesByTime(@PathParam("startTime") Long startTime, @PathParam("endTime") Long endTime, @PathParam("pageNumber") int pageNumber) throws Exception {
    List<MergedAnomalyResultDTO> mergedAnomalies = mergedAnomalyResultDAO.findByTime(startTime, endTime);
    try {
        mergedAnomalies = AlertFilterHelper.applyFiltrationRule(mergedAnomalies, alertFilterFactory);
    } catch (Exception e) {
        LOG.warn("Failed to apply alert filters on anomalies in start:{}, end:{}, exception:{}", new DateTime(startTime), new DateTime(endTime), e);
    }
    AnomaliesWrapper anomaliesWrapper = constructAnomaliesWrapperFromMergedAnomalies(mergedAnomalies, pageNumber);
    return anomaliesWrapper;
}
Also used : MergedAnomalyResultDTO(com.linkedin.thirdeye.datalayer.dto.MergedAnomalyResultDTO) AnomaliesWrapper(com.linkedin.thirdeye.dashboard.resources.v2.pojo.AnomaliesWrapper) TimeoutException(java.util.concurrent.TimeoutException) JSONException(org.json.JSONException) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException) DateTime(org.joda.time.DateTime) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Example 90 with GET

use of javax.ws.rs.GET in project pinot by linkedin.

the class AnomaliesResource method getAnomaliesByMetricIds.

/**
   * Find anomalies by metric ids
   * @param startTime
   * @param endTime
   * @param metricIdsString
   * @param functionName
   * @return
   * @throws Exception
   */
@GET
@Path("search/metricIds/{startTime}/{endTime}/{pageNumber}")
public AnomaliesWrapper getAnomaliesByMetricIds(@PathParam("startTime") Long startTime, @PathParam("endTime") Long endTime, @PathParam("pageNumber") int pageNumber, @QueryParam("metricIds") String metricIdsString, @QueryParam("functionName") String functionName) throws Exception {
    String[] metricIdsList = metricIdsString.split(COMMA_SEPARATOR);
    List<Long> metricIds = new ArrayList<>();
    for (String metricId : metricIdsList) {
        metricIds.add(Long.valueOf(metricId));
    }
    List<MergedAnomalyResultDTO> mergedAnomalies = getAnomaliesForMetricIdsInRange(metricIds, startTime, endTime);
    AnomaliesWrapper anomaliesWrapper = constructAnomaliesWrapperFromMergedAnomalies(mergedAnomalies, pageNumber);
    return anomaliesWrapper;
}
Also used : MergedAnomalyResultDTO(com.linkedin.thirdeye.datalayer.dto.MergedAnomalyResultDTO) ArrayList(java.util.ArrayList) AnomaliesWrapper(com.linkedin.thirdeye.dashboard.resources.v2.pojo.AnomaliesWrapper) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Aggregations

GET (javax.ws.rs.GET)1140 Path (javax.ws.rs.Path)902 Produces (javax.ws.rs.Produces)734 ApiOperation (io.swagger.annotations.ApiOperation)230 ApiResponses (io.swagger.annotations.ApiResponses)163 IOException (java.io.IOException)139 Response (javax.ws.rs.core.Response)116 WebApplicationException (javax.ws.rs.WebApplicationException)113 Timed (com.codahale.metrics.annotation.Timed)103 ArrayList (java.util.ArrayList)100 ResponseBuilder (javax.ws.rs.core.Response.ResponseBuilder)91 List (java.util.List)83 Map (java.util.Map)80 HashMap (java.util.HashMap)78 URI (java.net.URI)70 TimedResource (org.killbill.commons.metrics.TimedResource)58 TenantContext (org.killbill.billing.util.callcontext.TenantContext)57 ApiResponse (io.swagger.annotations.ApiResponse)52 NotFoundException (org.apache.hadoop.yarn.webapp.NotFoundException)39 Consumes (javax.ws.rs.Consumes)36