DashboardResource.java (moskito-moskito-2.9.3) | : | DashboardResource.java (moskito-moskito-2.10.0) | ||
---|---|---|---|---|
package net.anotheria.moskito.webui.dashboards.resource; | package net.anotheria.moskito.webui.dashboards.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.dashboards.api.DashboardAO; | import net.anotheria.moskito.webui.dashboards.api.DashboardAO; | |||
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; | |||
import javax.ws.rs.PathParam; | import javax.ws.rs.PathParam; | |||
/** | /** | |||
* The REST Resource for Dashboards API. | * The REST Resource for Dashboards API. | |||
* | * | |||
* @author lrosenberg | * @author lrosenberg | |||
* @since 15.04.15 09:08 | * @since 15.04.15 09:08 | |||
*/ | */ | |||
@Path("dashboards") | @Path("dashboards") | |||
@Server(url = "/moskito-inspect-rest/") | //@Server(url = "/moskito-inspect-rest/") | |||
public class DashboardResource extends AbstractResource { | public class DashboardResource extends AbstractResource { | |||
@GET | @GET | |||
public ReplyObject getDashboardDefinitions(){ | public ReplyObject getDashboardDefinitions(){ | |||
try{ | try{ | |||
ReplyObject ret = ReplyObject.success(); | ReplyObject ret = ReplyObject.success(); | |||
ret.addResult("definitions", getDashboardAPI().getDashboa rdDefinitions()); | ret.addResult("definitions", getDashboardAPI().getDashboa rdDefinitions()); | |||
return ret; | return ret; | |||
}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 |