Search in sources :

Example 11 with TopologyValidationResult

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();
}
Also used : TopologyValidationResult(alien4cloud.topology.TopologyValidationResult) Topology(org.alien4cloud.tosca.model.templates.Topology) ApiOperation(io.swagger.annotations.ApiOperation) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

TopologyValidationResult (alien4cloud.topology.TopologyValidationResult)11 And (cucumber.api.java.en.And)4 DeploymentTopologyDTO (alien4cloud.deployment.DeploymentTopologyDTO)2 NotFoundException (alien4cloud.exception.NotFoundException)2 ApplicationEnvironment (alien4cloud.model.application.ApplicationEnvironment)2 DeploymentTopology (alien4cloud.model.deployment.DeploymentTopology)2 RestError (alien4cloud.rest.model.RestError)2 AbstractTask (alien4cloud.topology.task.AbstractTask)2 InputArtifactTask (alien4cloud.topology.task.InputArtifactTask)2 PropertiesTask (alien4cloud.topology.task.PropertiesTask)2 ApiOperation (io.swagger.annotations.ApiOperation)2 DeploymentMatchingConfiguration (org.alien4cloud.alm.deployment.configuration.model.DeploymentMatchingConfiguration)2 OrchestratorDeploymentProperties (org.alien4cloud.alm.deployment.configuration.model.OrchestratorDeploymentProperties)2 Topology (org.alien4cloud.tosca.model.templates.Topology)2 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 DeploymentSubstitutionConfiguration (alien4cloud.deployment.model.DeploymentSubstitutionConfiguration)1 SecretProviderCredentials (alien4cloud.deployment.model.SecretProviderCredentials)1 Application (alien4cloud.model.application.Application)1 ApplicationTopologyVersion (alien4cloud.model.application.ApplicationTopologyVersion)1