Class ConfigController


  • @RestController
    @RequestMapping("/v1/cs/configs")
    public class ConfigController
    extends Object
    软负载客户端发布数据专用控制器
    Author:
    leiwen
    • Method Detail

      • publishConfig

        @PostMapping
        public Boolean publishConfig​(javax.servlet.http.HttpServletRequest request,
                                     javax.servlet.http.HttpServletResponse response,
                                     @RequestParam("dataId")
                                     String dataId,
                                     @RequestParam("group")
                                     String group,
                                     @RequestParam(value="tenant",required=false,defaultValue="")
                                     String tenant,
                                     @RequestParam("content")
                                     String content,
                                     @RequestParam(value="tag",required=false)
                                     String tag,
                                     @RequestParam(value="appName",required=false)
                                     String appName,
                                     @RequestParam(value="src_user",required=false)
                                     String srcUser,
                                     @RequestParam(value="config_tags",required=false)
                                     String configTags,
                                     @RequestParam(value="desc",required=false)
                                     String desc,
                                     @RequestParam(value="use",required=false)
                                     String use,
                                     @RequestParam(value="effect",required=false)
                                     String effect,
                                     @RequestParam(value="type",required=false)
                                     String type,
                                     @RequestParam(value="schema",required=false)
                                     String schema)
                              throws NacosException
        增加或更新非聚合数据。
        Throws:
        NacosException
      • getConfig

        @GetMapping
        public void getConfig​(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response,
                              @RequestParam("dataId")
                              String dataId,
                              @RequestParam("group")
                              String group,
                              @RequestParam(value="tenant",required=false,defaultValue="")
                              String tenant,
                              @RequestParam(value="tag",required=false)
                              String tag)
                       throws IOException,
                              javax.servlet.ServletException,
                              NacosException
        取数据
        Throws:
        javax.servlet.ServletException
        IOException
        NacosException
      • detailConfigInfo

        @GetMapping(params="show=all")
        public ConfigAllInfo detailConfigInfo​(javax.servlet.http.HttpServletRequest request,
                                              javax.servlet.http.HttpServletResponse response,
                                              @RequestParam("dataId")
                                              String dataId,
                                              @RequestParam("group")
                                              String group,
                                              @RequestParam(value="tenant",required=false,defaultValue="")
                                              String tenant)
                                       throws NacosException
        取数据
        Throws:
        NacosException
      • deleteConfig

        @DeleteMapping
        public Boolean deleteConfig​(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response,
                                    @RequestParam("dataId")
                                    String dataId,
                                    @RequestParam("group")
                                    String group,
                                    @RequestParam(value="tenant",required=false,defaultValue="")
                                    String tenant,
                                    @RequestParam(value="tag",required=false)
                                    String tag)
                             throws NacosException
        同步删除某个dataId下面所有的聚合前数据
        Throws:
        NacosException
      • deleteConfigs

        @DeleteMapping(params="delType=ids")
        public RestResult<Boolean> deleteConfigs​(javax.servlet.http.HttpServletRequest request,
                                                 javax.servlet.http.HttpServletResponse response,
                                                 @RequestParam("ids")
                                                 List<Long> ids)
        Returns:
        java.lang.Boolean
      • getConfigAdvanceInfo

        @GetMapping("/catalog")
        public RestResult<ConfigAdvanceInfo> getConfigAdvanceInfo​(@RequestParam("dataId")
                                                                  String dataId,
                                                                  @RequestParam("group")
                                                                  String group,
                                                                  @RequestParam(value="tenant",required=false,defaultValue="")
                                                                  String tenant)
      • listener

        @PostMapping("/listener")
        public void listener​(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
                      throws javax.servlet.ServletException,
                             IOException
        比较MD5
        Throws:
        javax.servlet.ServletException
        IOException
      • getListeners

        @GetMapping("/listener")
        public GroupkeyListenserStatus getListeners​(@RequestParam("dataId")
                                                    String dataId,
                                                    @RequestParam("group")
                                                    String group,
                                                    @RequestParam(value="tenant",required=false)
                                                    String tenant,
                                                    @RequestParam(value="sampleTime",required=false,defaultValue="1")
                                                    int sampleTime)
                                             throws Exception
        订阅改配置的客户端信息
        Throws:
        Exception
      • searchConfig

        @GetMapping(params="search=accurate")
        public Page<ConfigInfo> searchConfig​(@RequestParam("dataId")
                                             String dataId,
                                             @RequestParam("group")
                                             String group,
                                             @RequestParam(value="appName",required=false)
                                             String appName,
                                             @RequestParam(value="tenant",required=false,defaultValue="")
                                             String tenant,
                                             @RequestParam(value="config_tags",required=false)
                                             String configTags,
                                             @RequestParam("pageNo")
                                             int pageNo,
                                             @RequestParam("pageSize")
                                             int pageSize)
        查询配置信息,返回JSON格式。
      • fuzzySearchConfig

        @GetMapping(params="search=blur")
        public Page<ConfigInfo> fuzzySearchConfig​(@RequestParam("dataId")
                                                  String dataId,
                                                  @RequestParam("group")
                                                  String group,
                                                  @RequestParam(value="appName",required=false)
                                                  String appName,
                                                  @RequestParam(value="tenant",required=false,defaultValue="")
                                                  String tenant,
                                                  @RequestParam(value="config_tags",required=false)
                                                  String configTags,
                                                  @RequestParam("pageNo")
                                                  int pageNo,
                                                  @RequestParam("pageSize")
                                                  int pageSize)
        模糊查询配置信息。不允许只根据内容模糊查询,即dataId和group都为NULL,但content不是NULL。这种情况下,返回所有配置。
      • stopBeta

        @DeleteMapping(params="beta=true")
        public RestResult<Boolean> stopBeta​(@RequestParam("dataId")
                                            String dataId,
                                            @RequestParam("group")
                                            String group,
                                            @RequestParam(value="tenant",required=false,defaultValue="")
                                            String tenant)
      • queryBeta

        @GetMapping(params="beta=true")
        public RestResult<ConfigInfo4Beta> queryBeta​(@RequestParam("dataId")
                                                     String dataId,
                                                     @RequestParam("group")
                                                     String group,
                                                     @RequestParam(value="tenant",required=false,defaultValue="")
                                                     String tenant)
      • exportConfig

        @GetMapping(params="export=true")
        public org.springframework.http.ResponseEntity<byte[]> exportConfig​(@RequestParam(value="dataId",required=false)
                                                                            String dataId,
                                                                            @RequestParam(value="group",required=false)
                                                                            String group,
                                                                            @RequestParam(value="appName",required=false)
                                                                            String appName,
                                                                            @RequestParam(value="tenant",required=false,defaultValue="")
                                                                            String tenant,
                                                                            @RequestParam(value="ids",required=false)
                                                                            List<Long> ids)
      • importAndPublishConfig

        @PostMapping(params="import=true")
        public RestResult<Map<String,​Object>> importAndPublishConfig​(javax.servlet.http.HttpServletRequest request,
                                                                           @RequestParam(value="src_user",required=false)
                                                                           String srcUser,
                                                                           @RequestParam(value="namespace",required=false)
                                                                           String namespace,
                                                                           @RequestParam(value="policy",defaultValue="ABORT")
                                                                           SameConfigPolicy policy,
                                                                           org.springframework.web.multipart.MultipartFile file)
                                                                    throws NacosException
        Throws:
        NacosException