@RestController @RequestMapping(method=GET, path="${spring.cloud.config.server.prefix:}") public class EnvironmentController extends Object
Constructor and Description |
---|
EnvironmentController(EnvironmentRepository repository) |
EnvironmentController(EnvironmentRepository repository,
com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
Modifier and Type | Method and Description |
---|---|
Environment |
defaultLabel(String name,
String profiles) |
Environment |
defaultLabelIncludeOrigin(String name,
String profiles) |
void |
environmentException(javax.servlet.http.HttpServletResponse response,
EnvironmentException e) |
Environment |
getEnvironment(String name,
String profiles,
String label,
boolean includeOrigin) |
void |
illegalArgument(javax.servlet.http.HttpServletResponse response) |
org.springframework.http.ResponseEntity<String> |
jsonProperties(String name,
String profiles,
boolean resolvePlaceholders) |
Environment |
labelled(String name,
String profiles,
String label) |
Environment |
labelledIncludeOrigin(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) |
void |
noSuchLabel(javax.servlet.http.HttpServletResponse response) |
org.springframework.http.ResponseEntity<String> |
properties(String name,
String profiles,
boolean resolvePlaceholders) |
void |
setAcceptEmpty(boolean acceptEmpty)
Flag to indicate that If HTTP 404 needs to be sent if Application is not Found.
|
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).
|
org.springframework.http.ResponseEntity<String> |
yaml(String name,
String profiles,
boolean resolvePlaceholders) |
public EnvironmentController(EnvironmentRepository repository)
public EnvironmentController(EnvironmentRepository repository, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
public void setStripDocumentFromYaml(boolean stripDocument)
stripDocument
- the flag to setpublic void setAcceptEmpty(boolean acceptEmpty)
acceptEmpty
- the flag to set@RequestMapping(path="/{name}/{profiles:.*[^-].*}", produces="application/json") public Environment defaultLabel(@PathVariable String name, @PathVariable String profiles)
@RequestMapping(path="/{name}/{profiles:.*[^-].*}", produces="application/vnd.spring-cloud.config-server.v2+json") public Environment defaultLabelIncludeOrigin(@PathVariable String name, @PathVariable String profiles)
@RequestMapping(path="/{name}/{profiles}/{label:.*}", produces="application/json") public Environment labelled(@PathVariable String name, @PathVariable String profiles, @PathVariable String label)
@RequestMapping(path="/{name}/{profiles}/{label:.*}", produces="application/vnd.spring-cloud.config-server.v2+json") public Environment labelledIncludeOrigin(@PathVariable String name, @PathVariable String profiles, @PathVariable String label)
public Environment getEnvironment(String name, String profiles, String label, boolean includeOrigin)
@RequestMapping(value="/{name}-{profiles}.properties") public org.springframework.http.ResponseEntity<String> properties(@PathVariable String name, @PathVariable String profiles, @RequestParam(defaultValue="true") boolean resolvePlaceholders) throws IOException
IOException
@RequestMapping(value="/{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
IOException
@RequestMapping(value="{name}-{profiles}.json") public org.springframework.http.ResponseEntity<String> jsonProperties(@PathVariable String name, @PathVariable String profiles, @RequestParam(defaultValue="true") boolean resolvePlaceholders) throws Exception
Exception
@RequestMapping(value="/{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
Exception
@RequestMapping(value={"/{name}-{profiles}.yml","/{name}-{profiles}.yaml"}) public org.springframework.http.ResponseEntity<String> yaml(@PathVariable String name, @PathVariable String profiles, @RequestParam(defaultValue="true") boolean resolvePlaceholders) throws Exception
Exception
@RequestMapping(value={"/{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
Exception
@ExceptionHandler(value=RepositoryException.class) public void noSuchLabel(javax.servlet.http.HttpServletResponse response) throws IOException
IOException
@ExceptionHandler(value=java.lang.IllegalArgumentException.class) public void illegalArgument(javax.servlet.http.HttpServletResponse response) throws IOException
IOException
@ExceptionHandler(value=EnvironmentException.class) public void environmentException(javax.servlet.http.HttpServletResponse response, EnvironmentException e) throws IOException
IOException
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.