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

Christine Poerschke updated SOLR-10888:
---------------------------------------
    Attachment: SOLR-10888.patch

Attaching illustrative patch, sample output below.

top-level usage
{code}
prompt:solr$ bin/v2-collections-api.py
usage: v2-collections-api.py [-h]
                             
{restore-collection,create,create-alias,backup-collection,delete-alias}
                             ...
v2-collections-api.py: error: too few arguments
{code}

per-command usage
{code}
prompt:solr$ bin/v2-collections-api.py create
usage: v2-collections-api.py create [-h]
                                    [--replicationFactor REPLICATIONFACTOR]
                                    [--async ASYNC]
                                    [--tlogReplicas TLOGREPLICAS]
                                    [--maxShardsPerNode MAXSHARDSPERNODE]
                                    [--shards SHARDS]
                                    [--shuffleNodes SHUFFLENODES]
                                    [--nrtReplicas NRTREPLICAS]
                                    [--numShards NUMSHARDS]
                                    [--autoAddReplicas AUTOADDREPLICAS]
                                    [--config CONFIG]
                                    [--pullReplicas PULLREPLICAS]
                                    name
v2-collections-api.py create: error: too few arguments
{code}

detailed per-command usage
{code}
prompt:solr$ bin/v2-collections-api.py create -h
usage: v2-collections-api.py create [-h]
                                    [--replicationFactor REPLICATIONFACTOR]
                                    [--async ASYNC]
                                    [--tlogReplicas TLOGREPLICAS]
                                    [--maxShardsPerNode MAXSHARDSPERNODE]
                                    [--shards SHARDS]
                                    [--shuffleNodes SHUFFLENODES]
                                    [--nrtReplicas NRTREPLICAS]
                                    [--numShards NUMSHARDS]
                                    [--autoAddReplicas AUTOADDREPLICAS]
                                    [--config CONFIG]
                                    [--pullReplicas PULLREPLICAS]
                                    name

positional arguments:
  name                  The name of the collection to be created.

optional arguments:
  -h, --help            show this help message and exit
  --replicationFactor REPLICATIONFACTOR
                        The number of NRT replicas to be created for each
                        shard. Replicas are physical copies of each shard,
                        acting as failover for the shard.
  --async ASYNC         Defines a request ID that can be used to track this
                        action after it's submitted. The action will be
                        processed asynchronously.
  --tlogReplicas TLOGREPLICAS
                        ...
{code}

illustrative run:
{code}
prompot:solr$ bin/v2-collections-api.py create myDemoCollection --shards=42
url = 
http://localhost:8983/v2/collections/create?name=myDemoCollection&shards=42
{code}

> almost self-generating python script(s) to access V2 APIs
> ---------------------------------------------------------
>
>                 Key: SOLR-10888
>                 URL: https://issues.apache.org/jira/browse/SOLR-10888
>             Project: Solr
>          Issue Type: New Feature
>            Reporter: Christine Poerschke
>            Priority: Minor
>         Attachments: SOLR-10888.patch
>
>
> The V2 API supports introspection and the results of such introspection(s) 
> can be used to automatically on-the-fly generate a (nested) 
> {{argparse.ArgumentParser}} in a python script and then to again 
> automatically transform the script arguments into a url and http call to the 
> V2 API.
> Illustrative patch and sample output to follow.



--
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