Class HttpEnvironmentApi
- java.lang.Object
-
- com.chutneytesting.environment.api.HttpEnvironmentApi
-
- All Implemented Interfaces:
EnvironmentApi
@RestController @CrossOrigin(origins="*") @RequestMapping("/api/v2/environment") public class HttpEnvironmentApi extends Object implements EnvironmentApi
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTarget(String environmentName, TargetDto targetDto)EnvironmentDtocreateEnvironment(EnvironmentDto environmentDto)EnvironmentDtocreateEnvironment(EnvironmentDto environmentDto, boolean force)voiddeleteEnvironment(String environmentName)voiddeleteTarget(String environmentName, String targetName)EnvironmentDtogetEnvironment(String environmentName)TargetDtogetTarget(String environmentName, String targetName)Set<EnvironmentDto>listEnvironments()Set<String>listEnvironmentsNames()Set<TargetDto>listTargets()Set<TargetDto>listTargets(String environmentName)Set<String>listTargetsNames()voidupdateEnvironment(String environmentName, EnvironmentDto environmentDto)voidupdateTarget(String environmentName, String targetName, TargetDto targetDto)
-
-
-
Method Detail
-
listEnvironments
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @GetMapping(path="", 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="/names", produces="application/json") public Set<String> listEnvironmentsNames()- Specified by:
listEnvironmentsNamesin interfaceEnvironmentApi
-
createEnvironment
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @PostMapping("") public EnvironmentDto createEnvironment(@RequestBody EnvironmentDto environmentDto) throws InvalidEnvironmentNameException, AlreadyExistingEnvironmentException- Specified by:
createEnvironmentin interfaceEnvironmentApi- Throws:
InvalidEnvironmentNameExceptionAlreadyExistingEnvironmentException
-
createEnvironment
public EnvironmentDto createEnvironment(@RequestBody EnvironmentDto environmentDto, boolean force)
- Specified by:
createEnvironmentin interfaceEnvironmentApi
-
deleteEnvironment
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @DeleteMapping("/{environmentName}") public void deleteEnvironment(@PathVariable("environmentName") String environmentName) throws EnvironmentNotFoundException, CannotDeleteEnvironmentException- Specified by:
deleteEnvironmentin interfaceEnvironmentApi- Throws:
EnvironmentNotFoundExceptionCannotDeleteEnvironmentException
-
updateEnvironment
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @PutMapping("/{environmentName}") public void updateEnvironment(@PathVariable("environmentName") String environmentName, @RequestBody EnvironmentDto environmentDto) throws InvalidEnvironmentNameException, EnvironmentNotFoundException- Specified by:
updateEnvironmentin interfaceEnvironmentApi- Throws:
InvalidEnvironmentNameExceptionEnvironmentNotFoundException
-
listTargets
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @GetMapping(path="/{environmentName}/target", produces="application/json") public Set<TargetDto> listTargets(@PathVariable("environmentName") String environmentName) throws EnvironmentNotFoundException- Specified by:
listTargetsin interfaceEnvironmentApi- Throws:
EnvironmentNotFoundException
-
listTargets
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @GetMapping(path="/target", produces="application/json") public Set<TargetDto> listTargets() throws EnvironmentNotFoundException- Specified by:
listTargetsin interfaceEnvironmentApi- Throws:
EnvironmentNotFoundException
-
listTargetsNames
@PreAuthorize("hasAuthority(\'COMPONENT_READ\')") @GetMapping(path="/target/names", produces="application/json") public Set<String> listTargetsNames() throws EnvironmentNotFoundException- Specified by:
listTargetsNamesin interfaceEnvironmentApi- Throws:
EnvironmentNotFoundException
-
getEnvironment
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @GetMapping("/{environmentName}") public EnvironmentDto getEnvironment(@PathVariable("environmentName") String environmentName) throws EnvironmentNotFoundException- Specified by:
getEnvironmentin interfaceEnvironmentApi- Throws:
EnvironmentNotFoundException
-
getTarget
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @GetMapping("/{environmentName}/target/{targetName}") public TargetDto getTarget(@PathVariable("environmentName") String environmentName, @PathVariable("targetName") String targetName) throws EnvironmentNotFoundException, TargetNotFoundException- Specified by:
getTargetin interfaceEnvironmentApi- Throws:
EnvironmentNotFoundExceptionTargetNotFoundException
-
addTarget
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @PostMapping("/{environmentName}/target") public void addTarget(@PathVariable("environmentName") String environmentName, @RequestBody TargetDto targetDto) throws EnvironmentNotFoundException, AlreadyExistingTargetException- Specified by:
addTargetin interfaceEnvironmentApi- Throws:
EnvironmentNotFoundExceptionAlreadyExistingTargetException
-
deleteTarget
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @DeleteMapping("/{environmentName}/target/{targetName}") public void deleteTarget(@PathVariable("environmentName") String environmentName, @PathVariable("targetName") String targetName) throws EnvironmentNotFoundException, TargetNotFoundException- Specified by:
deleteTargetin interfaceEnvironmentApi- Throws:
EnvironmentNotFoundExceptionTargetNotFoundException
-
updateTarget
@PreAuthorize("hasAuthority(\'ENVIRONMENT_ACCESS\')") @PutMapping("/{environmentName}/target/{targetName}") public void updateTarget(@PathVariable("environmentName") String environmentName, @PathVariable("targetName") String targetName, @RequestBody TargetDto targetDto) throws EnvironmentNotFoundException, TargetNotFoundException- Specified by:
updateTargetin interfaceEnvironmentApi- Throws:
EnvironmentNotFoundExceptionTargetNotFoundException
-
-