You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/10/16 17:32:02 UTC
[GitHub] [lucene-solr] HoustonPutman opened a new pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
HoustonPutman opened a new pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996
https://issues.apache.org/jira/browse/SOLR-14907
Adding v2 APIs.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] dsmiley commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
dsmiley commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r509667053
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
Review comment:
People can add basically whatever named files they want and reference them from the primary config files (e.g. solrconfig.xml). This discussion is similar to field naming in our schema. Some names are special, like `_version_`. If you try to have your own field named as such, then you're asking for trouble. Likewise, we might suggest that users avoid file names with a leading underscore. Simple enough and keeps the "/files" verbosity out. Also there is a difference in HTTP verbs... in this issue here we're using PUT to put a file. But for an interactive editing of config elements, that would use POST.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] murblanc commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
murblanc commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r509145391
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
Review comment:
I'm not a REST specialist but I think I would prefer to leave the `files` component of the path in. Wouldn't this allow changing other things in the future and makes the API more self describing?
Would it really be easy to add it later?
If we wanted to add properties for example, how to tell if `/cluster/configs/{configname}/properties/whatever` is a property `whatever` or if `properties/whatever` is actually a file?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] HoustonPutman commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r507814091
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
Review comment:
Would you be ok with `/cluster/configs/{configname}/files/*`? That's very restful, since it would be updating the `*` `file` under the `{configname}` `config`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] murblanc commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
murblanc commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r509629741
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
Review comment:
@dsmiley, can users of Solr pick random names for some ConfigSet files? I believe code will be easier to understand/maintain if we don't have to parse file names to detect if they are files or some other form of separator (and then the API would be inconsistent: files will not have its `/files` segment in the part whereas properties will be defined after `/properties`).
Examples in [https://restfulapi.net/resource-naming/](https://restfulapi.net/resource-naming/) would be a vote for keeping `/files` in the path IMO.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] HoustonPutman merged pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
HoustonPutman merged pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] HoustonPutman commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r507907209
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
Review comment:
I've updated the PR to reflect this new API.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] murblanc commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
murblanc commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r509145391
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
Review comment:
I'm not a REST specialist but I think I would prefer to leave the `files` component of the path in. Wouldn't this allow changing other things in the future and make the API more self describing?
Would it really be easy to add it later?
If we wanted to add properties for example, how to tell if `/cluster/configs/{configname}/properties/whatever` is a property `whatever` or if `properties/whatever` is actually a file?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] HoustonPutman commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r508509512
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
Review comment:
Ok sounds good, that would certainly work. I'll take out the `/files/` part of the path, and update the PR and Jira.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] HoustonPutman commented on pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#issuecomment-712948608
Are there any concerns now that the API has been sorted?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] HoustonPutman commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r507814091
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
Review comment:
Would you be ok with `/cluster/configs/{configname}/file/*`? That's very restful, since it would be updating the `*` `file` under the `{configname}` `config`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] anshumg commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
anshumg commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r508680212
##########
File path: solr/core/src/java/org/apache/solr/handler/admin/ConfigSetsHandler.java
##########
@@ -230,7 +231,9 @@ private void handleConfigUploadRequest(SolrQueryRequest req, SolrQueryResponse r
ZipInputStream zis = new ZipInputStream(inputStream, StandardCharsets.UTF_8);
ZipEntry zipEntry = null;
+ int entryCount = 0;
Review comment:
Can we just use a boolean here?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] noblepaul commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
noblepaul commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r507004619
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
Review comment:
Let's use a proper REST mechanism here
`path ="/cluster/configs/{configname}/*`
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}/file",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void insertIntoConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ String path = req.getParams().get(ConfigSetParams.PATH);
+ if (path == null || path.isBlank()) {
+ throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "In order to insert a file into a configSet, a valid 'path' parameter must be provided.");
+ }
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}/file",
Review comment:
same as above
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] HoustonPutman commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r509536901
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
Review comment:
I agree @murblanc, it lets us future-proof the API even if we don't have current plans on expanding beyond files.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] dsmiley commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
dsmiley commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r508475185
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
Review comment:
To support properties manipulation in the future, I think that could be done via a POST to the particular path to the properties file in the configSet (I forget if it exists already or maybe should be exactly params.json) with commands in the JSON to delete/set/update etc.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] noblepaul commented on pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
noblepaul commented on pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#issuecomment-713227450
LGTM
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] noblepaul commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
noblepaul commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r508208566
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
Review comment:
>Just checking that we support nested structure within the configSet?
We could. But, I'm OK to add support for that later
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] dsmiley commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
dsmiley commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r508186617
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
Review comment:
I don't see the point of the "/files/" component of the path. The files within the configSet are directly in it, so I think it should be that way. I think of this very much like a file in a folder, where the folder is the configSet.
Just checking that we support nested structure within the configSet?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] murblanc commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
murblanc commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r509146710
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
Review comment:
Also "file" is a pretty generic abstraction that can represent many things (a schema, properties, synonyms etc). We might eventually want to address such ressources by what they actually are (schema, properties, synonyms) rather than by the way in which they are stored (files).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] dsmiley commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
dsmiley commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r509562901
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
Review comment:
All very debatable of course. Removing "/files/" doesn't prevent expanding beyond files, it's just that, for example, if we add a POST to say /configsetname/properties then we can't have a file named simply "properties". I will shed no tear over this loss :-). I like the simplicity of not having the needless "/files/".
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] HoustonPutman commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r508203430
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
Review comment:
We do support the nested structure.
The `/files/` part defines what the * after it is, and allows us to extend in the future. For example possible adding a `/cluster/configs/{configname}/properties` PUT action to update the properties for that config. It fits pretty well in the [guidelines](https://restfulapi.net/resource-naming/).
It's not that important to me though if y'all agree with taking it out.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] murblanc commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
murblanc commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r509629741
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
Review comment:
@dsmiley, can users of Solr pick random names for some ConfigSet files? I believe code will be easier to understand/maintain if we don't have to parse file names to detect if they are files or some other form of separator (and then the API would be inconsistent: files will not have its `/files` segment in the path whereas properties will be defined after `/properties`).
Examples in [https://restfulapi.net/resource-naming/](https://restfulapi.net/resource-naming/) would be a vote for keeping `/files` in the path IMO.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
[GitHub] [lucene-solr] noblepaul commented on a change in pull request #1996: SOLR-14907: Adding V2 API for ConfigSet Upload.
Posted by GitBox <gi...@apache.org>.
noblepaul commented on a change in pull request #1996:
URL: https://github.com/apache/lucene-solr/pull/1996#discussion_r508116583
##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -133,6 +134,62 @@ public void create(PayloadObj<CreateConfigInfo> obj) throws Exception {
}
+ @EndPoint(method = POST,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = PUT,
+ path = "/cluster/configs/{name}",
+ permission = CONFIG_EDIT_PERM
+ )
+ public void uploadConfigSetWithOverwrite(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
+ req = wrapParams(req,
+ "action", ConfigSetParams.ConfigSetAction.UPLOAD.toString(),
+ CommonParams.NAME, req.getPathTemplateValues().get("name"),
+ ConfigSetParams.OVERWRITE, true,
+ ConfigSetParams.CLEANUP, req.getParams().getBool(ConfigSetParams.CLEANUP, false));
+ configSetsHandler.handleRequestBody(req, rsp);
+ }
+
+ @EndPoint(method = POST,
Review comment:
I'm Ok with both
`/cluster/configs/{configname}/files/*`
and
`/cluster/configs/{configname}/*`
@janhoy @dsmiley @sigram WDYT?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org