Class ConfigController
- java.lang.Object
-
- com.alibaba.nacos.config.server.controller.ConfigController
-
@RestController @RequestMapping("/v1/cs/configs") public class ConfigController extends Object软负载客户端发布数据专用控制器- Author:
- leiwen
-
-
Constructor Summary
Constructors Constructor Description ConfigController(ConfigServletInner configServletInner, PersistService persistService, ConfigSubService configSubService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RestResult<Map<String,Object>>cloneConfig(javax.servlet.http.HttpServletRequest request, String srcUser, String namespace, List<SameNamespaceCloneConfigBean> configBeansList, SameConfigPolicy policy)BooleandeleteConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String dataId, String group, String tenant, String tag)同步删除某个dataId下面所有的聚合前数据RestResult<Boolean>deleteConfigs(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, List<Long> ids)ConfigAllInfodetailConfigInfo(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String dataId, String group, String tenant)取数据org.springframework.http.ResponseEntity<byte[]>exportConfig(String dataId, String group, String appName, String tenant, List<Long> ids)Page<ConfigInfo>fuzzySearchConfig(String dataId, String group, String appName, String tenant, String configTags, int pageNo, int pageSize)模糊查询配置信息。不允许只根据内容模糊查询,即dataId和group都为NULL,但content不是NULL。这种情况下,返回所有配置。voidgetConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String dataId, String group, String tenant, String tag)取数据RestResult<ConfigAdvanceInfo>getConfigAdvanceInfo(String dataId, String group, String tenant)GroupkeyListenserStatusgetListeners(String dataId, String group, String tenant, int sampleTime)订阅改配置的客户端信息RestResult<Map<String,Object>>importAndPublishConfig(javax.servlet.http.HttpServletRequest request, String srcUser, String namespace, SameConfigPolicy policy, org.springframework.web.multipart.MultipartFile file)voidlistener(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)比较MD5BooleanpublishConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String dataId, String group, String tenant, String content, String tag, String appName, String srcUser, String configTags, String desc, String use, String effect, String type, String schema)增加或更新非聚合数据。RestResult<ConfigInfo4Beta>queryBeta(String dataId, String group, String tenant)Page<ConfigInfo>searchConfig(String dataId, String group, String appName, String tenant, String configTags, int pageNo, int pageSize)查询配置信息,返回JSON格式。RestResult<Boolean>stopBeta(String dataId, String group, String tenant)
-
-
-
Constructor Detail
-
ConfigController
@Autowired public ConfigController(ConfigServletInner configServletInner, PersistService persistService, ConfigSubService configSubService)
-
-
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.ServletExceptionIOExceptionNacosException
-
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.ServletExceptionIOException
-
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
-
cloneConfig
@PostMapping(params="clone=true") public RestResult<Map<String,Object>> cloneConfig(javax.servlet.http.HttpServletRequest request, @RequestParam(value="src_user",required=false) String srcUser, @RequestParam(value="tenant",required=true) String namespace, @RequestBody(required=true) List<SameNamespaceCloneConfigBean> configBeansList, @RequestParam(value="policy",defaultValue="ABORT") SameConfigPolicy policy) throws NacosException
- Throws:
NacosException
-
-