You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Jason Gerlowski (Jira)" <ji...@apache.org> on 2022/10/24 16:36:00 UTC

[jira] [Comment Edited] (SOLR-16396) Cosmetic, REST-fulness improvements to v2 config APIs

    [ https://issues.apache.org/jira/browse/SOLR-16396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17623281#comment-17623281 ] 

Jason Gerlowski edited comment on SOLR-16396 at 10/24/22 4:35 PM:
------------------------------------------------------------------

To be a little more explicit about the APIs we want this ticket to cover, I found 32 APIs that need work related to config CRUD:

* List paramsets
** Current Form: GET /api/collections/collName/config/params
** Desired Form: GET /api/collections/collName/config/paramsets
** Spreadsheet Ref: Tab 3, Line 20
* Fetch Single Paramset
** Current Form: GET /api/collections/collName/config/params/paramSetName
** Desired Form: GET /api/collections/collName/config/paramsets/paramSetName
** Spreadsheet Ref: Tab 3, Line 22
* List Request Handlers
** Current Form: GET /api/collections/collName/config/requestHandler
** Desired Form: GET /api/collections/collName/config/requestHandlers
** Spreadsheet Ref: Tab 3, Line 26
* Add/Update Request Handler
** Current Form: POST /api/collections/collName/config \{"add-requesthandler": \{...\}\} and POST /api/collections/collName/config \{"update-requesthandler": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/requestHandlers/rhPath \{...\}
** Spreadsheet Ref: Tab 3, Line 27
* Delete Overlay Request Handler
** Current Form: POST /api/collections/collName/config \{"delete-requesthandler": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/requestHandlers/rhPath
** Spreadsheet Ref: Tab 3, Line 29
* List Seach Components
** Current Form: GET /api/collections/collName/config/searchComponent
** Desired Form: GET /api/collections/collName/config/searchComponents
** Spreadsheet Ref: Tab 3, Line 31
* Add/Update Search Component
** Current Form: POST /api/collections/collName/config \{"add-searchcomponent": \{...\}\} and POST /api/collections/collName/config \{"update-searchcomponent": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/searchComponents/scName \{...\}
** Spreadsheet Ref: Tab 3, Line 32
* Delete Overlay Search Component
** Current Form: POST /api/collections/collName/config \{"delete-searchcomponent": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/searchComponents/scName
** Spreadsheet Ref: Tab 3, Line 34
* List Query Response Writers
** Current Form: GET /api/collections/collName/config/queryResponseWriter
** Desired Form: GET /api/collections/collName/config/queryResponseWriters
** Spreadsheet Ref: Tab 3, Line 36
* Add/Update Query Response Writers
** Current Form: POST /api/collections/collName/config \{"add-queryresponsewriter": \{...\}\} and POST /api/collections/collName/config \{"update-queryresponsewriter": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/queryResponseWriters/responseWriterName \{...\}
** Spreadsheet Ref: Tab 3, Line 37
* Delete Overlay Query Response Writers
** Current Form: POST /api/collections/collName/config \{"delete-queryresponsewriter": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/queryResponseWriters/responseWriterName
** Spreadsheet Ref: Tab 3, Line 39
* Add/Update Init Params
** Current Form: POST /api/collections/collName/config \{"add-initparams": \{...\}\} and POST /api/collections/collName/config \{"update-initparams": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/initParams/initParamName \{...\}
** Spreadsheet Ref: Tab 3, Line 42
* Delete Overlay Init Params
** Current Form: POST /api/collections/collName/config \{"delete-initparams": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/initParams/initParamName
** Spreadsheet Ref: Tab 3, Line 44
* List Listeners
** Current Form: GET /api/collections/collName/config/listener
** Desired Form: GET /api/collections/collName/config/listeners
** Spreadsheet Ref: Tab 3, Line 46
* Add/Update Listener
** Current Form: POST /api/collections/collName/config \{"add-listener": \{...\}\} and POST /api/collections/collName/config \{"update-listener": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/listeners/listenerName \{...\}
** Spreadsheet Ref: Tab 3, Line 47
* Delete Overlay Listener
** Current Form: POST /api/collections/collName/config \{"delete-listener": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/listeners/listenerName
** Spreadsheet Ref: Tab 3, Line 49
* Add/Update Query Parser
** Current Form: POST /api/collections/collName/config \{"add-queryparser": \{...\}\} and POST /api/collections/collName/config \{"update-queryparser": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/queryparsers/queryParserName \{...\}
** Spreadsheet Ref: Tab 3, Line 51
* Delete Overlay Query Parser
** Current Form: POST /api/collections/collName/config \{"delete-queryparser": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/queryparsers/queryParserName
** Spreadsheet Ref: Tab 3, Line 53
* Set Common Property
** Current Form: POST /api/collections/collName/config \{"set-property": \{"propName": "propValue"\}\}
** Desired Form: PUT /api/collections/collName/config/properties/propertyName \{"value": "propVal"\}
** Spreadsheet Ref: Tab 3, Line 55
* Delete Common Property
** Current Form: POST /api/collections/collName/config \{"unset-property": "propName"\}
** Desired Form: DELETE /api/collections/collName/config/properties/propertyName
** Spreadsheet Ref: Tab 3, Line 56
* Set User Property
** Current Form: POST /api/collections/collName/config \{"set-user-property": \{"propName": "val"\}\}
** Desired Form: PUT /api/collections/collName/config/userproperties/propertyName \{"value": "propVal"\}
** Spreadsheet Ref: Tab 3, Line 57
* Delete User Property
** Current Form: POST /api/collections/collName/config \{"unset-user-property": "propName"\}
** Desired Form: DELETE /api/collections/collName/config/userproperties/propertyName
** Spreadsheet Ref: Tab 3, Line 58
* Add/Update Value Source Parser
** Current Form: POST /api/collections/collName/config \{"add-valuesourceparser": \{...\}\} and POST /api/collections/collName/config \{"update-valuesourceparser": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/valueSourceParser/vspName \{...\}
** Spreadsheet Ref: Tab 3, Line 60
* Delete Value Source Parser
** Current Form: POST /api/collections/collName/config \{"delete-valuesourceparser": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/valueSourceParser/vspName
** Spreadsheet Ref: Tab 3, Line 62
* Add/Update Transformer
** Current Form: POST /api/collections/collName/config \{"add-transformer": \{...\}\} and POST /api/collections/collName/config \{"update-transformer": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/transformers/transformerName \{...\}
** Spreadsheet Ref: Tab 3, Line 64
* Delete Transformer
** Current Form: POST /api/collections/collName/config \{"delete-transformer": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/transformers/transformerName
** Spreadsheet Ref: Tab 3, Line 66
* Add/Update "Update Processor"
** Current Form: POST /api/collections/collName/config \{"add-updateprocessor": \{...\}\} and POST /api/collections/collName/config \{"update-updateprocessor": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/updateProcessors/updateProcessorName \{...\}
** Spreadsheet Ref: Tab 3, Line 68
* Delete Update Processor
** Current Form: POST /api/collections/collName/config \{"delete-updateprocessor": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/updateProcessors/updateProcessorName
** Spreadsheet Ref: Tab 3, Line 70
* Add/Update Query Converter
** Current Form: POST /api/collections/collName/config \{"add-queryconverter": \{...\}\} and POST /api/collections/collName/config \{"update-queryconverter": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/queryConverters/queryConverterName \{...\}
** Spreadsheet Ref: Tab 3, Line 72
* Delete Query Converter
** Current Form: POST /api/collections/collName/config \{"delete-queryconverter": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/queryConverters/queryConverterName
** Spreadsheet Ref: Tab 3, Line 74
* Add/Update Expressible
** Current Form: POST /api/collections/collName/config \{"add-expressible": \{...\}\} and POST /api/collections/collName/config \{"update-expressible": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/expressibles/expressibleName \{...\}
** Spreadsheet Ref: Tab 3, Line 76
* Delete Expressible
** Current Form: POST /api/collections/collName/config \{"delete-expressible": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/expressibles/expressibleName
** Spreadsheet Ref: Tab 3, Line 78

This is a huge list, though in practice I expect many of these to copy/paste exercises.  If anyone wants to help chip away at this, just call out which APIs from this list you intend to work on and we can parallelize them.

In terms of the steps required, the JIRA comments [here|https://issues.apache.org/jira/browse/SOLR-15737?focusedCommentId=17617806&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17617806] and [here|https://issues.apache.org/jira/browse/SOLR-15737?focusedCommentId=17617923&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17617923] give some good background and step-by-step instructions for switching APIs over to the new JAX-RS framework, which is usually helpful or even required as the traditional v2 framework doesn't lend itself very readily to RESTful APIs.  (Those comments describe creating a new API "from scratch", but the steps are still applicable to modifying an existing API.)  The PR [here|https://github.com/apache/solr/pull/1053] also serves as a helpful example to work from.

Not all API modifications require the new JAX-RS framework, though it is preferred going forward.  Instructions for updating APIs using the older, traditional v2 framework can be found [here|https://issues.apache.org/jira/browse/SOLR-15737?focusedCommentId=17565076&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17565076], and an example PR can be found [here|https://github.com/apache/solr/pull/1061].


was (Author: gerlowskija):
To be a little more explicit about the APIs we want this ticket to cover, I found 32 APIs that need work related to config CRUD:

* List paramsets
** Current Form: GET /api/collections/collName/config/params
** Desired Form: GET /api/collections/collName/config/paramsets
** Spreadsheet Ref: Tab 3, Line 20
* Fetch Single Paramset
** Current Form: GET /api/collections/collName/config/params/paramSetName
** Desired Form: GET /api/collections/collName/config/paramsets/paramSetName
** Spreadsheet Ref: Tab 3, Line 22
* List Request Handlers
** Current Form: GET /api/collections/collName/config/requestHandler
** Desired Form: GET /api/collections/collName/config/requestHandlers
** Spreadsheet Ref: Tab 3, Line 26
* Add/Update Request Handler
** Current Form: POST /api/collections/collName/config \{"add-requesthandler": \{...\}\} and POST /api/collections/collName/config \{"update-requesthandler": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/requestHandlers/rhPath \{...\}
** Spreadsheet Ref: Tab 3, Line 27
* Delete Overlay Request Handler
** Current Form: POST /api/collections/collName/config \{"delete-requesthandler": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/requestHandlers/rhPath
** Spreadsheet Ref: Tab 3, Line 29
* List Seach Components
** Current Form: GET /api/collections/collName/config/searchComponent
** Desired Form: GET /api/collections/collName/config/searchComponents
** Spreadsheet Ref: Tab 3, Line 31
* Add/Update Search Component
** Current Form: POST /api/collections/collName/config \{"add-searchcomponent": \{...\}\} and POST /api/collections/collName/config \{"update-searchcomponent": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/searchComponents/scName \{...\}
** Spreadsheet Ref: Tab 3, Line 32
* Delete Overlay Search Component
** Current Form: POST /api/collections/collName/config \{"delete-searchcomponent": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/searchComponents/scName
** Spreadsheet Ref: Tab 3, Line 34
* List Query Response Writers
** Current Form: GET /api/collections/collName/config/queryResponseWriter
** Desired Form: GET /api/collections/collName/config/queryResponseWriters
** Spreadsheet Ref: Tab 3, Line 36
* Add/Update Query Response Writers
** Current Form: POST /api/collections/collName/config \{"add-queryresponsewriter": \{...\}\} and POST /api/collections/collName/config \{"update-queryresponsewriter": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/queryResponseWriters/responseWriterName \{...\}
** Spreadsheet Ref: Tab 3, Line 37
* Delete Overlay Query Response Writers
** Current Form: POST /api/collections/collName/config \{"delete-queryresponsewriter": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/queryResponseWriters/responseWriterName
** Spreadsheet Ref: Tab 3, Line 39
* Add/Update Init Params
** Current Form: POST /api/collections/collName/config \{"add-initparams": \{...\}\} and POST /api/collections/collName/config \{"update-initparams": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/initParams/initParamName \{...\}
** Spreadsheet Ref: Tab 3, Line 42
* Delete Overlay Init Params
** Current Form: POST /api/collections/collName/config \{"delete-initparams": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/initParams/initParamName
** Spreadsheet Ref: Tab 3, Line 44
* List Listeners
** Current Form: GET /api/collections/collName/config/listener
** Desired Form: GET /api/collections/collName/config/listeners
** Spreadsheet Ref: Tab 3, Line 46
* Add/Update Listener
** Current Form: POST /api/collections/collName/config \{"add-listener": \{...\}\} and POST /api/collections/collName/config \{"update-listener": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/listeners/listenerName \{...\}
** Spreadsheet Ref: Tab 3, Line 47
* Delete Overlay Listener
** Current Form: POST /api/collections/collName/config \{"delete-listener": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/listeners/listenerName
** Spreadsheet Ref: Tab 3, Line 49
* Add/Update Query Parser
** Current Form: POST /api/collections/collName/config \{"add-queryparser": \{...\}\} and POST /api/collections/collName/config \{"update-queryparser": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/queryparsers/queryParserName \{...\}
** Spreadsheet Ref: Tab 3, Line 51
* Delete Overlay Query Parser
** Current Form: POST /api/collections/collName/config \{"delete-queryparser": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/queryparsers/queryParserName
** Spreadsheet Ref: Tab 3, Line 53
* Set Common Property
** Current Form: POST /api/collections/collName/config \{"set-property": \{"propName": "propValue"\}\}
** Desired Form: PUT /api/collections/collName/config/properties/propertyName \{"value": "propVal"\}
** Spreadsheet Ref: Tab 3, Line 55
* Delete Common Property
** Current Form: POST /api/collections/collName/config \{"unset-property": "propName"\}
** Desired Form: DELETE /api/collections/collName/config/properties/propertyName
** Spreadsheet Ref: Tab 3, Line 56
* Set User Property
** Current Form: POST /api/collections/collName/config \{"set-user-property": \{"propName": "val"\}\}
** Desired Form: PUT /api/collections/collName/config/userproperties/propertyName \{"value": "propVal"\}
** Spreadsheet Ref: Tab 3, Line 57
* Delete User Property
** Current Form: POST /api/collections/collName/config \{"unset-user-property": "propName"\}
** Desired Form: DELETE /api/collections/collName/config/userproperties/propertyName
** Spreadsheet Ref: Tab 3, Line 58
* Add/Update Value Source Parser
** Current Form: POST /api/collections/collName/config \{"add-valuesourceparser": \{...\}\} and POST /api/collections/collName/config \{"update-valuesourceparser": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/valueSourceParser/vspName \{...\}
** Spreadsheet Ref: Tab 3, Line 60
* Delete Value Source Parser
** Current Form: POST /api/collections/collName/config \{"delete-valuesourceparser": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/valueSourceParser/vspName
** Spreadsheet Ref: Tab 3, Line 62
* Add/Update Transformer
** Current Form: POST /api/collections/collName/config \{"add-transformer": \{...\}\} and POST /api/collections/collName/config \{"update-transformer": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/transformers/transformerName \{...\}
** Spreadsheet Ref: Tab 3, Line 64
* Delete Transformer
** Current Form: POST /api/collections/collName/config \{"delete-transformer": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/transformers/transformerName
** Spreadsheet Ref: Tab 3, Line 66
* Add/Update "Update Processor"
** Current Form: POST /api/collections/collName/config \{"add-updateprocessor": \{...\}\} and POST /api/collections/collName/config \{"update-updateprocessor": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/updateProcessors/updateProcessorName \{...\}
** Spreadsheet Ref: Tab 3, Line 68
* Delete Update Processor
** Current Form: POST /api/collections/collName/config \{"delete-updateprocessor": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/updateProcessors/updateProcessorName
** Spreadsheet Ref: Tab 3, Line 70
* Add/Update Query Converter
** Current Form: POST /api/collections/collName/config \{"add-queryconverter": \{...\}\} and POST /api/collections/collName/config \{"update-queryconverter": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/queryConverters/queryConverterName \{...\}
** Spreadsheet Ref: Tab 3, Line 72
* Delete Query Converter
** Current Form: POST /api/collections/collName/config \{"delete-queryconverter": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/queryConverters/queryConverterName
** Spreadsheet Ref: Tab 3, Line 74
* Add/Update Expressible
** Current Form: POST /api/collections/collName/config \{"add-expressible": \{...\}\} and POST /api/collections/collName/config \{"update-expressible": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/expressibles/expressibleName \{...\}
** Spreadsheet Ref: Tab 3, Line 76
* Delete Expressible
** Current Form: POST /api/collections/collName/config \{"delete-expressible": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/expressibles/expressibleName
** Spreadsheet Ref: Tab 3, Line 78

Obviously this is a big list.  IMO it makes sense to split these up across different PRs, doing some small number (i.e. 1 or 2) of APIs per-PR.  If anyone wants to help chip away at this, just call out which APIs from this list you intend to work on and we can parallelize them.

In terms of the steps required, the JIRA comments [here|https://issues.apache.org/jira/browse/SOLR-15737?focusedCommentId=17617806&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17617806] and [here|https://issues.apache.org/jira/browse/SOLR-15737?focusedCommentId=17617923&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17617923] give some good background and step-by-step instructions for switching APIs over to the new JAX-RS framework, which is usually helpful or even required as the traditional v2 framework doesn't lend itself very readily to RESTful APIs.  (Those comments describe creating a new API "from scratch", but the steps are still applicable to modifying an existing API.)  The PR [here|https://github.com/apache/solr/pull/1053] also serves as a helpful example to work from.

Not all API modifications require the new JAX-RS framework, though it is preferred going forward.  Instructions for updating APIs using the older, traditional v2 framework can be found [here|https://issues.apache.org/jira/browse/SOLR-15737?focusedCommentId=17565076&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17565076], and an example PR can be found [here|https://github.com/apache/solr/pull/1061].

> Cosmetic, REST-fulness improvements to v2 config APIs
> -----------------------------------------------------
>
>                 Key: SOLR-16396
>                 URL: https://issues.apache.org/jira/browse/SOLR-16396
>             Project: Solr
>          Issue Type: Sub-task
>          Components: v2 API
>    Affects Versions: main (10.0)
>            Reporter: Jason Gerlowski
>            Priority: Major
>
> As mentioned on SOLR-15781, the v2 API currently has an experimental designation, and the community has expressed an interest in using this period to update our v2 endpoints to be more REST-ful and consistent.  The current plan is to follow the
> specific changes laid out in [this spreadsheet|https://docs.google.com/spreadsheets/d/1HAoBBFPpSiT8mJmgNZKkZAPwfCfPvlc08m5jz3fQBpA/edit?usp=sharing], though of course nothing there is set in stone and there are still warts to be worked out.
>  
> This ticket plans to tackle making the changes required for Solr's config (read and write/overlay) and configset CRUD APIs, as described in the spreadsheet above.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org