Class HttpEnvironmentApi
java.lang.Object
com.chutneytesting.environment.api.HttpEnvironmentApi
- All Implemented Interfaces:
EnvironmentApi
@RestController
@CrossOrigin(origins="*")
public class HttpEnvironmentApi
extends Object
implements EnvironmentApi
-
Method Summary
Modifier and TypeMethodDescriptionvoidcreateEnvironment(EnvironmentDto environmentDto) createEnvironment(EnvironmentDto environmentDto, boolean force) voiddeleteEnvironment(String environmentName) voiddeleteTarget(String targetName) voiddeleteTarget(String environmentName, String targetName) getEnvironment(String environmentName) importEnvironment(EnvironmentDto environmentDto) importEnvironment(org.springframework.web.multipart.MultipartFile file) importTarget(String environmentName, TargetDto targetDto) importTarget(String environmentName, org.springframework.web.multipart.MultipartFile file) listTargets(TargetFilter filter) voidupdateEnvironment(String environmentName, EnvironmentDto environmentDto) voidupdateTarget(String targetName, TargetDto targetDto)
-
Method Details
-
listEnvironments
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @GetMapping(path="/api/v2/environments", produces="application/json") public Set<EnvironmentDto> listEnvironments()- Specified by:
listEnvironmentsin interfaceEnvironmentApi
-
listEnvironmentsNames
@PreAuthorize("hasAuthority(\'SCENARIO_EXECUTE\') or hasAuthority(\'CAMPAIGN_WRITE\') or hasAuthority(\'CAMPAIGN_EXECUTE\') or hasAuthority(\'COMPONENT_WRITE\')") @GetMapping(path="/api/v2/environments/names", produces="application/json") public Set<String> listEnvironmentsNames()- Specified by:
listEnvironmentsNamesin interfaceEnvironmentApi
-
createEnvironment
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @PostMapping(value="/api/v2/environments", consumes="application/json") public EnvironmentDto createEnvironment(@RequestBody EnvironmentDto environmentDto) throws InvalidEnvironmentNameException, AlreadyExistingEnvironmentException - Specified by:
createEnvironmentin interfaceEnvironmentApi- Throws:
InvalidEnvironmentNameExceptionAlreadyExistingEnvironmentException
-
importEnvironment
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @PostMapping(value="/api/v2/environments", consumes="multipart/form-data") public EnvironmentDto importEnvironment(@RequestParam("file") org.springframework.web.multipart.MultipartFile file) -
importEnvironment
- Specified by:
importEnvironmentin interfaceEnvironmentApi
-
createEnvironment
- Specified by:
createEnvironmentin interfaceEnvironmentApi
-
deleteEnvironment
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @DeleteMapping("/api/v2/environments/{environmentName}") public void deleteEnvironment(@PathVariable("environmentName") String environmentName) throws EnvironmentNotFoundException, CannotDeleteEnvironmentException - Specified by:
deleteEnvironmentin interfaceEnvironmentApi- Throws:
EnvironmentNotFoundExceptionCannotDeleteEnvironmentException
-
updateEnvironment
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @PutMapping("/api/v2/environments/{environmentName}") public void updateEnvironment(@PathVariable("environmentName") String environmentName, @RequestBody EnvironmentDto environmentDto) throws InvalidEnvironmentNameException, EnvironmentNotFoundException - Specified by:
updateEnvironmentin interfaceEnvironmentApi- Throws:
InvalidEnvironmentNameExceptionEnvironmentNotFoundException
-
getEnvironment
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @GetMapping("/api/v2/environments/{environmentName}") public EnvironmentDto getEnvironment(@PathVariable("environmentName") String environmentName) throws EnvironmentNotFoundException - Specified by:
getEnvironmentin interfaceEnvironmentApi- Throws:
EnvironmentNotFoundException
-
importTarget
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @PostMapping(value="/api/v2/environments/{environmentName}/targets", consumes="multipart/form-data") public TargetDto importTarget(@PathVariable("environmentName") String environmentName, @RequestParam("file") org.springframework.web.multipart.MultipartFile file) -
importTarget
- Specified by:
importTargetin interfaceEnvironmentApi
-
listTargetsNames
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @GetMapping(path="/api/v2/targets/names", produces="application/json") public Set<String> listTargetsNames() throws EnvironmentNotFoundException- Specified by:
listTargetsNamesin interfaceEnvironmentApi- Throws:
EnvironmentNotFoundException
-
listTargets
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @GetMapping(path="/api/v2/targets", produces="application/json") public List<TargetDto> listTargets(TargetFilter filter) throws EnvironmentNotFoundException - Specified by:
listTargetsin interfaceEnvironmentApi- Throws:
EnvironmentNotFoundException
-
getTarget
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @GetMapping("/api/v2/environments/{environmentName}/targets/{targetName}") public TargetDto getTarget(@PathVariable("environmentName") String environmentName, @PathVariable("targetName") String targetName) throws EnvironmentNotFoundException, TargetNotFoundException - Specified by:
getTargetin interfaceEnvironmentApi- Throws:
EnvironmentNotFoundExceptionTargetNotFoundException
-
deleteTarget
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @DeleteMapping("/api/v2/environments/{environmentName}/targets/{targetName}") public void deleteTarget(@PathVariable("environmentName") String environmentName, @PathVariable("targetName") String targetName) throws EnvironmentNotFoundException, TargetNotFoundException - Specified by:
deleteTargetin interfaceEnvironmentApi- Throws:
EnvironmentNotFoundExceptionTargetNotFoundException
-
deleteTarget
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @DeleteMapping("/api/v2/targets/{targetName}") public void deleteTarget(@PathVariable("targetName") String targetName) throws EnvironmentNotFoundException, TargetNotFoundException - Specified by:
deleteTargetin interfaceEnvironmentApi- Throws:
EnvironmentNotFoundExceptionTargetNotFoundException
-
addTarget
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @PostMapping("/api/v2/targets") public void addTarget(@RequestBody TargetDto targetDto) throws EnvironmentNotFoundException, AlreadyExistingTargetException - Specified by:
addTargetin interfaceEnvironmentApi- Throws:
EnvironmentNotFoundExceptionAlreadyExistingTargetException
-
updateTarget
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @PutMapping("/api/v2/targets/{targetName}") public void updateTarget(@PathVariable("targetName") String targetName, @RequestBody TargetDto targetDto) throws EnvironmentNotFoundException, TargetNotFoundException - Specified by:
updateTargetin interfaceEnvironmentApi- Throws:
EnvironmentNotFoundExceptionTargetNotFoundException
-