[
https://issues.apache.org/jira/browse/SOLR-6736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14356702#comment-14356702
]
Shai Erera commented on SOLR-6736:
----------------------------------
On the REST API side, can we make it more REST-like? For example, instead of
carrying an action parameter, we could embed that in the URL, e.g.
{{/admin/zkconfig/config}} or {{/admin/zkconfig/file}}. Then the requests would
look like:
1. POST a zipped file consisting of solr configuration files/folders
Example:
{{curl -X POST -H 'Content-Type: application/octet-stream' --data-binary
@compressed.zip
"http://localhost:8983/solr/admin/zkconfig/config?config.name=testconfig"}}
2. POST a single file into a configuration
Example:
{{curl -X POST -H 'Content-Type: text/plain' --data-binary @testfile.txt
"http://localhost:8983/solr/admin/zkconfig/file/testconfig?filename=testfile.txt"}}
3. Link an existing configuration in zookeeper to an existing collection
Example:
{{curl -X PUT
http://localhost:8983/solr/admin/zkconfig/link/testcollection/testconfig}}
Here we could have few variants, e.g. ending w/ {{/zkconfig/link}} and taking
the collection and configuration name as parameters, or only one of them.
4. Delete a configuration from zookeeper
Example:
{{curl -X DELETE http://localhost:8983/solr/admin/zkconfig/config/testconfig}}
5. Delete a file/folder from a configuration in zookeeper
Example:
{{curl -X DELETE
http://localhost:8983/solr/admin/zkconfig/file/testconfig?filename=lang/stopwords.txt}}
What I am after is for consistency between PUT/POST/GET/DELETE commands such
that if you handle a file configuration, the request looks the same (or as much
as possible) between the different commands, and we let REST determine the
action we should carry. For instance, deleting a file or adding a file should
take, IMO, the same parameters (and not 'path' when deleting and 'filename'
when posting), and we let the PUT/POST/DELETE/GET determine what should we do
with the request.
My 2 cents.
> A collections-like request handler to manage solr configurations on zookeeper
> -----------------------------------------------------------------------------
>
> Key: SOLR-6736
> URL: https://issues.apache.org/jira/browse/SOLR-6736
> Project: Solr
> Issue Type: New Feature
> Components: SolrCloud
> Reporter: Varun Rajput
> Assignee: Anshum Gupta
> Priority: Minor
> Fix For: 5.0, Trunk
>
> Attachments: SOLR-6736.patch, SOLR-6736.patch
>
>
> Managing Solr configuration files on zookeeper becomes cumbersome while using
> solr in cloud mode, especially while trying out changes in the
> configurations.
> It will be great if there is a request handler that can provide an API to
> manage the configurations similar to the collections handler that would allow
> actions like uploading new configurations, linking them to a collection,
> deleting configurations, etc.
> example :
> {code}
> #use the following command to upload a new configset called mynewconf. This
> will fail if there is alredy a conf called 'mynewconf'. The file could be a
> jar , zip or a tar file which contains all the files for the this conf.
> curl -X POST -H 'Content-Type: application/octet-stream' --data-binary
> @testconf.zip
> http://localhost:8983/solr/admin/configs/mynewconf?sig=<the-signature>
> {code}
> A GET to http://localhost:8983/solr/admin/configs will give a list of configs
> available
> A GET to http://localhost:8983/solr/admin/configs/mynewconf would give the
> list of files in mynewconf
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]