Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push yaml format #6493

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions api/src/main/java/com/alibaba/nacos/api/config/ConfigService.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@ String getConfigAndSignListener(String dataId, String group, long timeoutMs, Lis
*/
boolean publishConfig(String dataId, String group, String content) throws NacosException;

/**
* Publish config.
*
* @param dataId dataId
* @param group group
* @param content content
* @param type type
* @return Whether publish
* @throws NacosException NacosException
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add since annotation like @since 2.1.0

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add complete

*/
boolean publishConfig(String dataId, String group, String content,String type) throws NacosException;

/**
* Remove config.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ public void addListener(String dataId, String group, Listener listener) throws N

@Override
public boolean publishConfig(String dataId, String group, String content) throws NacosException {
return publishConfigInner(namespace, dataId, group, null, null, null, content);
return publishConfigInner(namespace, dataId, group, null, null, null, content, null);
}

@Override
public boolean publishConfig(String dataId, String group, String content, String type) throws NacosException {
return publishConfigInner(namespace, dataId, group, null, null, null, content, type);
}

@Override
Expand Down Expand Up @@ -211,7 +216,7 @@ private boolean removeConfigInner(String tenant, String dataId, String group, St
}

private boolean publishConfigInner(String tenant, String dataId, String group, String tag, String appName,
String betaIps, String content) throws NacosException {
String betaIps, String content, String type) throws NacosException {
group = null2defaultGroup(group);
ParamUtils.checkParam(dataId, group, content);

Expand All @@ -237,6 +242,9 @@ private boolean publishConfigInner(String tenant, String dataId, String group, S
if (StringUtils.isNotEmpty(tag)) {
params.put("tag", tag);
}
if (StringUtils.isNotEmpty(type)) {
params.put("type", type);
}
Map<String, String> headers = new HashMap<String, String>(1);
if (StringUtils.isNotEmpty(betaIps)) {
headers.put("betaIps", betaIps);
Expand Down