Class EnvironmentVariableController
java.lang.Object
fr.enedis.chutney.environment.api.variable.EnvironmentVariableController
- All Implemented Interfaces:
EnvironmentVariableApi
@RestController
public class EnvironmentVariableController
extends Object
implements EnvironmentVariableApi
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEnvironmentVariableController(EnvironmentVariableApi delegate, EnvironmentApi envDelegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddVariable(List<EnvironmentVariableDto> values) voiddeleteVariable(String key) voidupdateVariable(String key, List<EnvironmentVariableDto> values)
-
Field Details
-
VARIABLE_BASE_URI
- See Also:
-
-
Constructor Details
-
EnvironmentVariableController
public EnvironmentVariableController(EnvironmentVariableApi delegate, @Qualifier("environmentEmbeddedApplication") EnvironmentApi envDelegate)
-
-
Method Details
-
listVariablesByEnvironments
@PreAuthorize("hasAuthority(\'VARIABLE_READ\')") @GetMapping(path="/api/v2/environments/variables", produces="application/json") public List<EnvironmentDto> listVariablesByEnvironments() throws EnvironmentNotFoundException, TargetNotFoundException -
addVariable
@PreAuthorize("hasAuthority(\'VARIABLE_WRITE\')") @PostMapping("/api/v2/variables") public void addVariable(@RequestBody List<EnvironmentVariableDto> values) throws EnvironmentNotFoundException, VariableAlreadyExistingException - Specified by:
addVariablein interfaceEnvironmentVariableApi- Throws:
EnvironmentNotFoundExceptionVariableAlreadyExistingException
-
updateVariable
@PreAuthorize("hasAuthority(\'VARIABLE_WRITE\')") @PutMapping("/api/v2/variables/{key}") public void updateVariable(@PathVariable("key") String key, @RequestBody List<EnvironmentVariableDto> values) throws EnvironmentNotFoundException, EnvVariableNotFoundException - Specified by:
updateVariablein interfaceEnvironmentVariableApi- Throws:
EnvironmentNotFoundExceptionEnvVariableNotFoundException
-
deleteVariable
@PreAuthorize("hasAuthority(\'VARIABLE_WRITE\')") @DeleteMapping("/api/v2/variables/{key}") public void deleteVariable(@PathVariable("key") String key) throws EnvVariableNotFoundException - Specified by:
deleteVariablein interfaceEnvironmentVariableApi- Throws:
EnvVariableNotFoundException
-