[ 
https://issues.apache.org/jira/browse/SOLR-11608?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Anshum Gupta resolved SOLR-11608.
---------------------------------
    Resolution: Fixed

> V2 Core-Rename API fails to parse new core name
> -----------------------------------------------
>
>                 Key: SOLR-11608
>                 URL: https://issues.apache.org/jira/browse/SOLR-11608
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: v2 API
>    Affects Versions: 7.1, master (8.0)
>            Reporter: Jason Gerlowski
>            Assignee: Anshum Gupta
>            Priority: Minor
>             Fix For: 7.2, master (8.0)
>
>         Attachments: SOLR-11608.patch, SOLR-11608.patch, repro.sh
>
>
> I noticed recently that the v2 Solr API's rename-core command fails to parse 
> out the provided "to" parameter (which contains the desired new core name).
> {{_introspect}} shows the following documentation for the API:
> {code}
>         "rename":{
>           "type":"object",
>           
> "documentation":"https://lucene.apache.org/solr/guide/coreadmin-api.html#coreadmin-rename";,
>           "description":"Change the name of a core.",
>           "properties":{
>             "to":{
>               "type":"string",
>               "description":"The new name for the core."},
>             "async":{
>               "type":"string",
>               "description":"Defines a request ID that can be used to track 
> this action after it's submitted. The action will be processed asynchronously 
> when this is defined."}},
>           "required":["to"]},
> {code}
> but it appears that the underlying code fails to parse out the "to" parameter:
> {code}
> ➜  solr git:(master) ✗ curl -ilk -X POST "$SOLR_HOST/api/cores/foo" -d 
> '{"rename": {"to":"bar"}}'
> HTTP/1.1 400 Bad Request
> Content-Type: application/json;charset=utf-8
> Content-Length: 381
> {
>   "responseHeader":{
>     "status":400,
>     "QTime":0},
>   "error":{
>     "metadata":[
>       "error-class","org.apache.solr.common.SolrException",
>       "root-error-class","org.apache.solr.common.SolrException"],
>     "msg":"Invalid core: [null]. core names must consist entirely of periods, 
> underscores, hyphens, and alphanumerics as well not start with a hyphen",
>     "code":400}}
> {code}
> I'm not super familiar with the V2<->V1 API mapping code, but it looks like 
> the underlying implementation in {{CoreAdminOperation}} is expecting a 
> parameter named "other", but there's no mapping from "to" -> "other" for this 
> particular API.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to