类 ConfigController
- java.lang.Object
-
- com.alibaba.nacos.config.server.controller.ConfigController
-
@RestController @RequestMapping("/v1/cs/configs") public class ConfigController extends java.lang.ObjectSpecial controller for soft load client to publish data.- 作者:
- leiwen
-
-
字段概要
字段 修饰符和类型 字段 说明 private CommonPersistServicecommonPersistServiceprivate ConfigInfoBetaPersistServiceconfigInfoBetaPersistServiceprivate ConfigInfoPersistServiceconfigInfoPersistServiceprivate ConfigOperationServiceconfigOperationServiceprivate ConfigSubServiceconfigSubServiceprivate static java.lang.StringEXPORT_CONFIG_FILE_NAMEprivate static java.lang.StringEXPORT_CONFIG_FILE_NAME_DATE_FORMATprivate static java.lang.StringEXPORT_CONFIG_FILE_NAME_EXTprivate ConfigServletInnerinnerprivate static org.slf4j.LoggerLOGGER
-
构造器概要
构造器 构造器 说明 ConfigController(ConfigServletInner inner, ConfigOperationService configOperationService, ConfigSubService configSubService, ConfigInfoPersistService configInfoPersistService, CommonPersistService commonPersistService, ConfigInfoBetaPersistService configInfoBetaPersistService)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 com.alibaba.nacos.common.model.RestResult<java.util.Map<java.lang.String,java.lang.Object>>cloneConfig(javax.servlet.http.HttpServletRequest request, java.lang.String srcUser, java.lang.String namespace, java.util.List<SameNamespaceCloneConfigBean> configBeansList, SameConfigPolicy policy)Execute clone config operation.java.lang.BooleandeleteConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String dataId, java.lang.String group, java.lang.String tenant, java.lang.String tag)Synchronously delete all pre-aggregation data under a dataId.com.alibaba.nacos.common.model.RestResult<java.lang.Boolean>deleteConfigs(javax.servlet.http.HttpServletRequest request, java.util.List<java.lang.Long> ids)Execute delete config operation.ConfigAllInfodetailConfigInfo(java.lang.String dataId, java.lang.String group, java.lang.String tenant)Get the specific configuration information that the console USES.org.springframework.http.ResponseEntity<byte[]>exportConfig(java.lang.String dataId, java.lang.String group, java.lang.String appName, java.lang.String tenant, java.util.List<java.lang.Long> ids)Execute export config operation.org.springframework.http.ResponseEntity<byte[]>exportConfigV2(java.lang.String dataId, java.lang.String group, java.lang.String appName, java.lang.String tenant, java.util.List<java.lang.Long> ids)new version export config add metadata.yml file record config metadata.Page<ConfigInfo>fuzzySearchConfig(java.lang.String dataId, java.lang.String group, java.lang.String appName, java.lang.String tenant, java.lang.String configTags, int pageNo, int pageSize)Fuzzy query configuration information.voidgetConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String dataId, java.lang.String group, java.lang.String tenant, java.lang.String tag)Get configure board information fail.com.alibaba.nacos.common.model.RestResult<ConfigAdvanceInfo>getConfigAdvanceInfo(java.lang.String dataId, java.lang.String group, java.lang.String tenant)GroupkeyListenserStatusgetListeners(java.lang.String dataId, java.lang.String group, java.lang.String tenant, int sampleTime)Subscribe to configured client information.com.alibaba.nacos.common.model.RestResult<java.util.Map<java.lang.String,java.lang.Object>>importAndPublishConfig(javax.servlet.http.HttpServletRequest request, java.lang.String srcUser, java.lang.String namespace, SameConfigPolicy policy, org.springframework.web.multipart.MultipartFile file)Execute import and publish config operation.voidlistener(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)The client listens for configuration changes.private com.alibaba.nacos.common.model.RestResult<java.util.Map<java.lang.String,java.lang.Object>>parseImportData(ZipUtils.UnZipResult unziped, java.util.List<ConfigAllInfo> configInfoList, java.util.List<java.util.Map<java.lang.String,java.lang.String>> unrecognizedList, java.lang.String namespace)old import config.private com.alibaba.nacos.common.model.RestResult<java.util.Map<java.lang.String,java.lang.Object>>parseImportDataV2(ZipUtils.UnZipResult unziped, java.util.List<ConfigAllInfo> configInfoList, java.util.List<java.util.Map<java.lang.String,java.lang.String>> unrecognizedList, java.lang.String namespace)new version import config add .metadata.yml file.java.lang.BooleanpublishConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String dataId, java.lang.String group, java.lang.String tenant, java.lang.String content, java.lang.String tag, java.lang.String appName, java.lang.String srcUser, java.lang.String configTags, java.lang.String desc, java.lang.String use, java.lang.String effect, java.lang.String type, java.lang.String schema)Adds or updates non-aggregated data.com.alibaba.nacos.common.model.RestResult<ConfigInfo4Beta>queryBeta(java.lang.String dataId, java.lang.String group, java.lang.String tenant)Execute to query beta operation.Page<ConfigInfo>searchConfig(java.lang.String dataId, java.lang.String group, java.lang.String appName, java.lang.String tenant, java.lang.String configTags, int pageNo, int pageSize)Query the configuration information and return it in JSON format.com.alibaba.nacos.common.model.RestResult<java.lang.Boolean>stopBeta(java.lang.String dataId, java.lang.String group, java.lang.String tenant)Execute to remove beta operation.
-
-
-
字段详细资料
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
EXPORT_CONFIG_FILE_NAME
private static final java.lang.String EXPORT_CONFIG_FILE_NAME
- 另请参阅:
- 常量字段值
-
EXPORT_CONFIG_FILE_NAME_EXT
private static final java.lang.String EXPORT_CONFIG_FILE_NAME_EXT
- 另请参阅:
- 常量字段值
-
EXPORT_CONFIG_FILE_NAME_DATE_FORMAT
private static final java.lang.String EXPORT_CONFIG_FILE_NAME_DATE_FORMAT
- 另请参阅:
- 常量字段值
-
inner
private final ConfigServletInner inner
-
configInfoPersistService
private ConfigInfoPersistService configInfoPersistService
-
configInfoBetaPersistService
private ConfigInfoBetaPersistService configInfoBetaPersistService
-
commonPersistService
private CommonPersistService commonPersistService
-
configOperationService
private final ConfigOperationService configOperationService
-
configSubService
private final ConfigSubService configSubService
-
-
构造器详细资料
-
ConfigController
public ConfigController(ConfigServletInner inner, ConfigOperationService configOperationService, ConfigSubService configSubService, ConfigInfoPersistService configInfoPersistService, CommonPersistService commonPersistService, ConfigInfoBetaPersistService configInfoBetaPersistService)
-
-
方法详细资料
-
publishConfig
@PostMapping public java.lang.Boolean publishConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, @RequestParam("dataId") java.lang.String dataId, @RequestParam("group") java.lang.String group, @RequestParam(value="tenant",required=false,defaultValue="") java.lang.String tenant, @RequestParam("content") java.lang.String content, @RequestParam(value="tag",required=false) java.lang.String tag, @RequestParam(value="appName",required=false) java.lang.String appName, @RequestParam(value="src_user",required=false) java.lang.String srcUser, @RequestParam(value="config_tags",required=false) java.lang.String configTags, @RequestParam(value="desc",required=false) java.lang.String desc, @RequestParam(value="use",required=false) java.lang.String use, @RequestParam(value="effect",required=false) java.lang.String effect, @RequestParam(value="type",required=false) java.lang.String type, @RequestParam(value="schema",required=false) java.lang.String schema) throws com.alibaba.nacos.api.exception.NacosExceptionAdds or updates non-aggregated data.request and response will be used in aspect, see
CapacityManagementAspectandRequestLogAspect.- 抛出:
com.alibaba.nacos.api.exception.NacosException- NacosException.
-
getConfig
@GetMapping public void getConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, @RequestParam("dataId") java.lang.String dataId, @RequestParam("group") java.lang.String group, @RequestParam(value="tenant",required=false,defaultValue="") java.lang.String tenant, @RequestParam(value="tag",required=false) java.lang.String tag) throws java.io.IOException, javax.servlet.ServletException, com.alibaba.nacos.api.exception.NacosExceptionGet configure board information fail.- 抛出:
javax.servlet.ServletException- ServletException.java.io.IOException- IOException.com.alibaba.nacos.api.exception.NacosException- NacosException.
-
detailConfigInfo
@GetMapping(params="show=all") public ConfigAllInfo detailConfigInfo(@RequestParam("dataId") java.lang.String dataId, @RequestParam("group") java.lang.String group, @RequestParam(value="tenant",required=false,defaultValue="") java.lang.String tenant) throws com.alibaba.nacos.api.exception.NacosException
Get the specific configuration information that the console USES.- 抛出:
com.alibaba.nacos.api.exception.NacosException- NacosException.
-
deleteConfig
@DeleteMapping public java.lang.Boolean deleteConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, @RequestParam("dataId") java.lang.String dataId, @RequestParam("group") java.lang.String group, @RequestParam(value="tenant",required=false,defaultValue="") java.lang.String tenant, @RequestParam(value="tag",required=false) java.lang.String tag) throws com.alibaba.nacos.api.exception.NacosExceptionSynchronously delete all pre-aggregation data under a dataId.request and response will be used in aspect, see
CapacityManagementAspectandRequestLogAspect.- 抛出:
com.alibaba.nacos.api.exception.NacosException- NacosException.
-
deleteConfigs
@DeleteMapping(params="delType=ids") public com.alibaba.nacos.common.model.RestResult<java.lang.Boolean> deleteConfigs(javax.servlet.http.HttpServletRequest request, @RequestParam("ids") java.util.List<java.lang.Long> ids)Execute delete config operation.- 返回:
- java.lang.Boolean
-
getConfigAdvanceInfo
@GetMapping("/catalog") public com.alibaba.nacos.common.model.RestResult<ConfigAdvanceInfo> getConfigAdvanceInfo(@RequestParam("dataId") java.lang.String dataId, @RequestParam("group") java.lang.String group, @RequestParam(value="tenant",required=false,defaultValue="") java.lang.String tenant)
-
listener
@PostMapping("/listener") public void listener(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOExceptionThe client listens for configuration changes.- 抛出:
javax.servlet.ServletExceptionjava.io.IOException
-
getListeners
@GetMapping("/listener") public GroupkeyListenserStatus getListeners(@RequestParam("dataId") java.lang.String dataId, @RequestParam("group") java.lang.String group, @RequestParam(value="tenant",required=false) java.lang.String tenant, @RequestParam(value="sampleTime",required=false,defaultValue="1") int sampleTime) throws java.lang.ExceptionSubscribe to configured client information.- 抛出:
java.lang.Exception
-
searchConfig
@GetMapping(params="search=accurate") public Page<ConfigInfo> searchConfig(@RequestParam("dataId") java.lang.String dataId, @RequestParam("group") java.lang.String group, @RequestParam(value="appName",required=false) java.lang.String appName, @RequestParam(value="tenant",required=false,defaultValue="") java.lang.String tenant, @RequestParam(value="config_tags",required=false) java.lang.String configTags, @RequestParam("pageNo") int pageNo, @RequestParam("pageSize") int pageSize)
Query the configuration information and return it in JSON format.
-
fuzzySearchConfig
@GetMapping(params="search=blur") public Page<ConfigInfo> fuzzySearchConfig(@RequestParam("dataId") java.lang.String dataId, @RequestParam("group") java.lang.String group, @RequestParam(value="appName",required=false) java.lang.String appName, @RequestParam(value="tenant",required=false,defaultValue="") java.lang.String tenant, @RequestParam(value="config_tags",required=false) java.lang.String configTags, @RequestParam("pageNo") int pageNo, @RequestParam("pageSize") int pageSize)
Fuzzy query configuration information. Fuzzy queries based only on content are not allowed, that is, both dataId and group are NULL, but content is not NULL. In this case, all configurations are returned.
-
stopBeta
@DeleteMapping(params="beta=true") public com.alibaba.nacos.common.model.RestResult<java.lang.Boolean> stopBeta(@RequestParam("dataId") java.lang.String dataId, @RequestParam("group") java.lang.String group, @RequestParam(value="tenant",required=false,defaultValue="") java.lang.String tenant)Execute to remove beta operation.- 参数:
dataId- dataId string value.group- group string value.tenant- tenant string value.- 返回:
- Execute to operate result.
-
queryBeta
@GetMapping(params="beta=true") public com.alibaba.nacos.common.model.RestResult<ConfigInfo4Beta> queryBeta(@RequestParam("dataId") java.lang.String dataId, @RequestParam("group") java.lang.String group, @RequestParam(value="tenant",required=false,defaultValue="") java.lang.String tenant)
Execute to query beta operation.- 参数:
dataId- dataId string value.group- group string value.tenant- tenant string value.- 返回:
- RestResult for ConfigInfo4Beta.
-
exportConfig
@GetMapping(params="export=true") public org.springframework.http.ResponseEntity<byte[]> exportConfig(@RequestParam(value="dataId",required=false) java.lang.String dataId, @RequestParam(value="group",required=false) java.lang.String group, @RequestParam(value="appName",required=false) java.lang.String appName, @RequestParam(value="tenant",required=false,defaultValue="") java.lang.String tenant, @RequestParam(value="ids",required=false) java.util.List<java.lang.Long> ids)Execute export config operation.- 参数:
dataId- dataId string value.group- group string value.appName- appName string value.tenant- tenant string value.ids- id list value.- 返回:
- ResponseEntity.
-
exportConfigV2
@GetMapping(params="exportV2=true") public org.springframework.http.ResponseEntity<byte[]> exportConfigV2(@RequestParam(value="dataId",required=false) java.lang.String dataId, @RequestParam(value="group",required=false) java.lang.String group, @RequestParam(value="appName",required=false) java.lang.String appName, @RequestParam(value="tenant",required=false,defaultValue="") java.lang.String tenant, @RequestParam(value="ids",required=false) java.util.List<java.lang.Long> ids)new version export config add metadata.yml file record config metadata.- 参数:
dataId- dataId string value.group- group string value.appName- appName string value.tenant- tenant string value.ids- id list value.- 返回:
- ResponseEntity.
-
importAndPublishConfig
@PostMapping(params="import=true") public com.alibaba.nacos.common.model.RestResult<java.util.Map<java.lang.String,java.lang.Object>> importAndPublishConfig(javax.servlet.http.HttpServletRequest request, @RequestParam(value="src_user",required=false) java.lang.String srcUser, @RequestParam(value="namespace",required=false) java.lang.String namespace, @RequestParam(value="policy",defaultValue="ABORT") SameConfigPolicy policy, org.springframework.web.multipart.MultipartFile file) throws com.alibaba.nacos.api.exception.NacosExceptionExecute import and publish config operation.- 参数:
request- http servlet request .srcUser- src user string value.namespace- namespace string value.policy- policy model.file- MultipartFile.- 返回:
- RestResult Map.
- 抛出:
com.alibaba.nacos.api.exception.NacosException- NacosException.
-
parseImportData
private com.alibaba.nacos.common.model.RestResult<java.util.Map<java.lang.String,java.lang.Object>> parseImportData(ZipUtils.UnZipResult unziped, java.util.List<ConfigAllInfo> configInfoList, java.util.List<java.util.Map<java.lang.String,java.lang.String>> unrecognizedList, java.lang.String namespace)
old import config.- 参数:
unziped- export file.configInfoList- parse file result.unrecognizedList- unrecognized file.namespace- import namespace.- 返回:
- error result.
-
parseImportDataV2
private com.alibaba.nacos.common.model.RestResult<java.util.Map<java.lang.String,java.lang.Object>> parseImportDataV2(ZipUtils.UnZipResult unziped, java.util.List<ConfigAllInfo> configInfoList, java.util.List<java.util.Map<java.lang.String,java.lang.String>> unrecognizedList, java.lang.String namespace)
new version import config add .metadata.yml file.- 参数:
unziped- export file.configInfoList- parse file result.unrecognizedList- unrecognized file.namespace- import namespace.- 返回:
- error result.
-
cloneConfig
@PostMapping(params="clone=true") public com.alibaba.nacos.common.model.RestResult<java.util.Map<java.lang.String,java.lang.Object>> cloneConfig(javax.servlet.http.HttpServletRequest request, @RequestParam(value="src_user",required=false) java.lang.String srcUser, @RequestParam("tenant") java.lang.String namespace, @RequestBody java.util.List<SameNamespaceCloneConfigBean> configBeansList, @RequestParam(value="policy",defaultValue="ABORT") SameConfigPolicy policy) throws com.alibaba.nacos.api.exception.NacosExceptionExecute clone config operation.- 参数:
request- http servlet request .srcUser- src user string value.namespace- namespace string value.configBeansList- config beans list.policy- config policy model.- 返回:
- RestResult for map.
- 抛出:
com.alibaba.nacos.api.exception.NacosException- NacosException.
-
-