use of org.opentosca.toscana.api.docs.HiddenResourceSupport in project TOSCAna by StuPro-TOSCAna.
the class CommonController method getStatusIndex.
@RequestMapping(value = { "/status/", "/status" }, method = RequestMethod.GET, produces = "application/hal+json")
@ApiOperation(value = "Hypermedia endpoint to get all supported Status operations", notes = "Status operations are based on Spring Boot Actuator", produces = "application/hal+json", response = ResourceSupport.class)
public ResourceSupport getStatusIndex(HttpServletRequest request) throws Exception {
String baseURL = request.getRequestURL().toString().replace("/api/status", "").replace("/api/status/", "");
ResourceSupport support = new HiddenResourceSupport();
support.add(new Link(baseURL + actuatorHealthPath, "health"));
support.add(new Link(baseURL + actuatorMetricsPath, "metrics"));
if (actuatorMappingsActive)
support.add(new Link(baseURL + actuatorMappingsPath, "mappings"));
support.add(linkTo(methodOn(CommonController.class).getStatusIndex(null)).withSelfRel());
return support;
}
use of org.opentosca.toscana.api.docs.HiddenResourceSupport in project TOSCAna by StuPro-TOSCAna.
the class CommonController method getIndex.
@RequestMapping(value = { "/", "" }, method = RequestMethod.GET, produces = "application/hal+json")
@ApiOperation(value = "Hypermedia endpoint to get all resource endpoints", notes = "The retuned links to the endpoints are: Csars, platforms and status", produces = "application/hal+json", response = ResourceSupport.class)
public ResourceSupport getIndex() throws Exception {
ResourceSupport support = new HiddenResourceSupport();
support.add(linkTo(methodOn(CommonController.class).getIndex()).withSelfRel());
support.add(linkTo(methodOn(CommonController.class).getStatusIndex(null)).withRel("status"));
support.add(linkTo(methodOn(PlatformController.class).getPlatforms()).withRel("platforms"));
support.add(linkTo(methodOn(CsarController.class).listCSARs()).withRel("csars"));
return support;
}
Aggregations