AlertsResource.java (moskito-moskito-2.9.3) | : | AlertsResource.java (moskito-moskito-2.10.0) | ||
---|---|---|---|---|
package net.anotheria.moskito.webui.threshold.resource; | package net.anotheria.moskito.webui.threshold.resource; | |||
import io.swagger.v3.oas.annotations.servers.Server; | ||||
import net.anotheria.anoplass.api.APIException; | import net.anotheria.anoplass.api.APIException; | |||
import net.anotheria.moskito.webui.shared.resource.AbstractResource; | import net.anotheria.moskito.webui.shared.resource.AbstractResource; | |||
import net.anotheria.moskito.webui.shared.resource.ReplyObject; | import net.anotheria.moskito.webui.shared.resource.ReplyObject; | |||
import javax.ws.rs.GET; | import javax.ws.rs.GET; | |||
import javax.ws.rs.Path; | import javax.ws.rs.Path; | |||
/** | /** | |||
* Rest resource, returns alerts in the system. | * Rest resource, returns alerts in the system. | |||
* | * | |||
* @author lrosenberg | * @author lrosenberg | |||
* @since 14.04.15 16:54 | * @since 14.04.15 16:54 | |||
*/ | */ | |||
@Path("alerts") | @Path("alerts") | |||
@Server(url = "/moskito-inspect-rest/") | //@Server(url = "/moskito-inspect-rest/") | |||
public class AlertsResource extends AbstractResource { | public class AlertsResource extends AbstractResource { | |||
@GET | @GET | |||
public ReplyObject getAlerts(){ | public ReplyObject getAlerts(){ | |||
try{ | try{ | |||
return ReplyObject.success("alerts", getThresholdAPI().ge tAlerts()); | return ReplyObject.success("alerts", getThresholdAPI().ge tAlerts()); | |||
}catch(APIException e){ | }catch(APIException e){ | |||
return ReplyObject.error(e.getMessage()); | return ReplyObject.error(e.getMessage()); | |||
} | } | |||
} | } | |||
} | } | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added |