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

Jason Gerlowski commented on SOLR-11028:
----------------------------------------

I was mulling over the syntax for this API a bit last night.  I'd originally 
proposed:

{code}
POST /api/nodes/nodeName/commands?action=replace <request-body>
{code}

...but the more I think about it, the more I wonder whether "replace" should be 
in the path, instead of as a query-param.  For instance:

{code}
POST /api/nodes/nodeName/commands/replace <request-body>
{code}

This might have a few benefits.  In particular:
1. From an input-validation perspective, we want the "action" parameter to be 
required, single-valued, and only one of a few select values.  That all gets 
enforced implicitly if the "action" is specified on the path.
2. Requiring users to specify their inputs using a mix of query-params and 
request-body properties might be confusing. (i.e. "Which values go in the 
request-body again?"). IMO putting "replace" in the path helps with that a bit: 
once you get the path right, everything is in the request-body.
3. I _suspect_ this format will be easier to integrate with external tooling, 
OpenAPI in particular. (see [here|https://www.openapis.org/] and 
[here|https://issues.apache.org/jira/browse/SOLR-16346] for context).

Thoughts?  If we like the latter form better and go that route here, I can 
update the spreadsheet to use that syntax generally for these sort of 
command/action APIs.

> Create a v2 API equivalent for REPLACENODE API
> ----------------------------------------------
>
>                 Key: SOLR-11028
>                 URL: https://issues.apache.org/jira/browse/SOLR-11028
>             Project: Solr
>          Issue Type: Sub-task
>          Components: SolrCloud, v2 API
>            Reporter: Shalin Shekhar Mangar
>            Priority: Major
>
> The REPLACENODE API is only implemented as part of the v1 collections API. 
> There should be an equivalent call in the v2 paradigm.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to