use of org.opentosca.toscana.core.transformation.platform.Platform in project TOSCAna by StuPro-TOSCAna.
the class PlatformController method getPlatform.
/**
* Returns the information for a specific platform.
* <p>
* This method handles the <code>/platforms/{id}</code> request
* <p>
* jResponds with Http code 200 normally (application/hal+json) and with code 404 (application/hal+json, standard
* error message) if the platform with the given name (case sensitive) does not exist.
*
* @param id the <code>id</code> (identifier) of the platform (HTTP Path Parameter)
*/
@ApiOperation(value = "Get the Details for a specific Platform", notes = "Returns the resource object for one specific plugin (platform)", code = 200)
@ApiResponses({ @ApiResponse(code = 200, message = "The request has been executed with no error!", response = PlatformResponse.class), @ApiResponse(code = 404, message = "There is no platform with the given name", response = RestErrorResponse.class) })
@RequestMapping(path = "/{id}", method = RequestMethod.GET, produces = "application/hal+json")
public ResponseEntity<PlatformResponse> getPlatform(@ApiParam(name = "id", value = "The Platform identifier", required = true) @PathVariable(name = "id") String id) {
Optional<Platform> optionalPlatform = platformService.findPlatformById(id);
Platform p = optionalPlatform.orElseThrow(PlatformNotFoundException::new);
return ResponseEntity.ok(getPlatformResource(p));
}
Aggregations