class CerebroController {

    @RequestMapping(value="/alerts", method = RequestMethod.GET)
    @ApiResponses(value={@ApiResponse(code=200, message = "Returns the latest alarm alerts")})
    public Collection<Alert> getAlerts(@ApiParam(name="nbItem", value="number of alerts to return") @RequestParam(value = "items", required = false, defaultValue = "20") final int nbItem,
        							   @ApiParam(name="start", value="starting date") @RequestParam(value = "start", required = false, defaultValue = "0") final int start,
        							   @ApiParam(name="from") @RequestParam(value = "from", required = false) final String from) {
        
        Collection<Alert> alerts;
        if (from != null) {
            alerts = alertService.getAlerts(from);
        } else {
            alerts = alertService.getAlerts(nbItem, start).getValues();
        }

        return alerts;
    }

}