use of alien4cloud.topology.TopologyValidationResult in project alien4cloud by alien4cloud.
the class TopologyController method isTopologyValid.
/**
* Check if a topology is valid or not.
*
* @param topologyId The id of the topology to check.
* @return a boolean rest response that says if the topology is valid or not.
*/
@ApiOperation(value = "Check if a topology is valid or not.", notes = "Returns true if valid, false if not. Application role required [ APPLICATION_MANAGER | APPLICATION_DEVOPS ]")
@RequestMapping(value = "/{topologyId:.+}/isvalid", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
@PreAuthorize("isAuthenticated()")
public RestResponse<TopologyValidationResult> isTopologyValid(@PathVariable String topologyId, @RequestParam(required = false) String environmentId) {
Topology topology = topologyServiceCore.getOrFail(topologyId);
topologyService.checkAccessAuthorizations(topology);
TopologyValidationResult dto = topologyValidationService.validateTopology(topology);
return RestResponseBuilder.<TopologyValidationResult>builder().data(dto).build();
}
Aggregations