Class EnvironmentController
java.lang.Object
org.springframework.cloud.config.server.environment.EnvironmentController
@RestController
@RequestMapping(method=GET,
path="${spring.cloud.config.server.prefix:}")
public class EnvironmentController
extends Object
- Author:
- Dave Syer, Spencer Gibb, Roy Clarkson, Bartosz Wojtkiewicz, Rafal Zukowski, Ivan Corrales Solera, Daniel Frey, Ian Bondoc, Chen Li
-
Constructor Summary
ConstructorsConstructorDescriptionEnvironmentController(EnvironmentRepository repository) EnvironmentController(EnvironmentRepository repository, tools.jackson.databind.json.JsonMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.cloud.config.environment.EnvironmentdefaultLabel(String name, String profiles) org.springframework.cloud.config.environment.EnvironmentdefaultLabelIncludeOrigin(String name, String profiles) voidenvironmentException(jakarta.servlet.http.HttpServletResponse response, EnvironmentException e) org.springframework.cloud.config.environment.EnvironmentgetEnvironment(String name, String profiles, String label, boolean includeOrigin) voidillegalArgument(jakarta.servlet.http.HttpServletResponse response) org.springframework.http.ResponseEntity<String> jsonProperties(String name, String profiles, boolean resolvePlaceholders) org.springframework.cloud.config.environment.Environmentorg.springframework.cloud.config.environment.EnvironmentlabelledIncludeOrigin(String name, String profiles, String label) org.springframework.http.ResponseEntity<String> labelledJsonProperties(String name, String profiles, String label, boolean resolvePlaceholders) org.springframework.http.ResponseEntity<String> labelledProperties(String name, String profiles, String label, boolean resolvePlaceholders) org.springframework.http.ResponseEntity<String> labelledYaml(String name, String profiles, String label, boolean resolvePlaceholders) voidnoSuchLabel(jakarta.servlet.http.HttpServletResponse response) org.springframework.http.ResponseEntity<String> properties(String name, String profiles, boolean resolvePlaceholders) voidsetAcceptEmpty(boolean acceptEmpty) Flag to indicate that If HTTP 404 needs to be sent if Application is not Found.voidsetStripDocumentFromYaml(boolean stripDocument) Flag to indicate that YAML documents which are not a map should be stripped of the "document" prefix that is added by Spring (to facilitate conversion to Properties).org.springframework.http.ResponseEntity<String>
-
Constructor Details
-
EnvironmentController
-
EnvironmentController
public EnvironmentController(EnvironmentRepository repository, tools.jackson.databind.json.JsonMapper objectMapper)
-
-
Method Details
-
setStripDocumentFromYaml
public void setStripDocumentFromYaml(boolean stripDocument) Flag to indicate that YAML documents which are not a map should be stripped of the "document" prefix that is added by Spring (to facilitate conversion to Properties).- Parameters:
stripDocument- the flag to set
-
setAcceptEmpty
public void setAcceptEmpty(boolean acceptEmpty) Flag to indicate that If HTTP 404 needs to be sent if Application is not Found.- Parameters:
acceptEmpty- the flag to set
-
defaultLabel
-
defaultLabelIncludeOrigin
-
labelled
-
labelledIncludeOrigin
-
getEnvironment
-
properties
@GetMapping("/{name}-{profiles}.properties") public org.springframework.http.ResponseEntity<String> properties(@PathVariable String name, @PathVariable String profiles, @RequestParam(defaultValue="true") boolean resolvePlaceholders) throws IOException - Throws:
IOException
-
labelledProperties
@GetMapping("/{label}/{name}-{profiles}.properties") public org.springframework.http.ResponseEntity<String> labelledProperties(@PathVariable String name, @PathVariable String profiles, @PathVariable String label, @RequestParam(defaultValue="true") boolean resolvePlaceholders) throws IOException - Throws:
IOException
-
jsonProperties
-
labelledJsonProperties
@GetMapping("/{label}/{name}-{profiles}.json") public org.springframework.http.ResponseEntity<String> labelledJsonProperties(@PathVariable String name, @PathVariable String profiles, @PathVariable String label, @RequestParam(defaultValue="true") boolean resolvePlaceholders) throws Exception - Throws:
Exception
-
yaml
-
labelledYaml
@GetMapping({"/{label}/{name}-{profiles}.yml","/{label}/{name}-{profiles}.yaml"}) public org.springframework.http.ResponseEntity<String> labelledYaml(@PathVariable String name, @PathVariable String profiles, @PathVariable String label, @RequestParam(defaultValue="true") boolean resolvePlaceholders) throws Exception - Throws:
Exception
-
noSuchLabel
@ExceptionHandler(RepositoryException.class) public void noSuchLabel(jakarta.servlet.http.HttpServletResponse response) throws IOException - Throws:
IOException
-
illegalArgument
@ExceptionHandler(IllegalArgumentException.class) public void illegalArgument(jakarta.servlet.http.HttpServletResponse response) throws IOException - Throws:
IOException
-
environmentException
@ExceptionHandler(EnvironmentException.class) public void environmentException(jakarta.servlet.http.HttpServletResponse response, EnvironmentException e) throws IOException - Throws:
IOException
-