Class 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
    • Constructor Detail

      • EnvironmentController

        public EnvironmentController​(EnvironmentRepository repository,
                                     com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    • Method Detail

      • 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

        @GetMapping(path="/{name}/{profiles:(?!.*\\b\\.(?:ya?ml|properties|json)\\b).*}",
                    produces="application/json")
        public Environment defaultLabel​(@PathVariable
                                        String name,
                                        @PathVariable
                                        String profiles)
      • defaultLabelIncludeOrigin

        @GetMapping(path="/{name}/{profiles:(?!.*\\b\\.(?:ya?ml|properties|json)\\b).*}",
                    produces="application/vnd.spring-cloud.config-server.v2+json")
        public Environment defaultLabelIncludeOrigin​(@PathVariable
                                                     String name,
                                                     @PathVariable
                                                     String profiles)
      • labelled

        @GetMapping(path="/{name}/{profiles}/{label:.*}",
                    produces="application/json")
        public Environment labelled​(@PathVariable
                                    String name,
                                    @PathVariable
                                    String profiles,
                                    @PathVariable
                                    String label)
      • labelledIncludeOrigin

        @GetMapping(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)
      • 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

        @GetMapping("{name}-{profiles}.json")
        public org.springframework.http.ResponseEntity<String> jsonProperties​(@PathVariable
                                                                              String name,
                                                                              @PathVariable
                                                                              String profiles,
                                                                              @RequestParam(defaultValue="true")
                                                                              boolean resolvePlaceholders)
                                                                       throws Exception
        Throws:
        Exception
      • 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

        @GetMapping({"/{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
        Throws:
        Exception
      • 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