You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Milindu Sanoj Kumarage <ag...@gmail.com> on 2015/02/22 20:45:48 UTC

GSoC 2015

Hi everyone,

I'm Milindu Sanoj Kumarage , an undergraduate of University of Colombo
School of Computing. This is my second year of participating in GSoC, last
year it was Sahana Software Foundation.

I'm interested in working on "Python based based Command Line Tool (CLI)
for Stratos". I went through the current CLI codes and the RESTful
service's codes. I think this task is very interesting.

I have worked with Stratos before, have used the RESTful service and have
written cartridges. I'm good in Java( have worked with JAX-RS ) and Python,
have a good understanding in authentication mechanisms. I have used Heroku
CLI  and Google's gcloud command-line tool. I think I can use that
experience when developing this command-line tool.

I have some questions,
   1. I'm thinking of using a Python CLI framework instead of writing from
the scratch, in order to increase the reliability and maintainability.
What's your idea on that?

   2. The final product would be a python script that we run like `$ python
stratos.py login` (  or with a wrapper for Linux and Windows environments
like `stratos-cli.sh` ) or python package submitted to Pip that can be
installed to a system as `$pip install stratos-cli`  and run as `$
stratos-cli login`?


Thank you.

Re: GSoC 2015

Posted by Milindu Sanoj Kumarage <ag...@gmail.com>.
Hi everyone,
I'm really happy as I have been selected for GSoC for this task :D It is a
great pleasure to work with you. Hope I can do a good job. I'm continuing
with further development.

I'm currently working on testing. Did some optimization also to the code.

On Sun, Mar 29, 2015 at 7:41 AM, Imesh Gunaratne <im...@apache.org> wrote:

> +1 Great work Milindu! Yes this is exactly what we wanted. May be you
> could remove the space between the colon and the name of the attribute.
>
> Thanks
>
> On Sat, Mar 28, 2015 at 7:48 PM, Milindu Sanoj Kumarage <
> agentmilindu@gmail.com> wrote:
>
>> Hi,
>>
>> I coded that tree printing functionality, assuming it is a JSON structure
>> we have to print and it looks likes this one.
>>
>>  [
>>         {
>>             "name": "level-one-group",
>>             "cartridges": [
>>                 "esb",
>>                 "tomcat"
>>             ],
>>             "groups": [
>>         {
>>             "name": "level-two-group",
>>             "cartridges": [
>>                 "esb",
>>                 "tomcat"
>>             ],
>>                     "groups": [
>>                 {
>>                     "name": "level-three-group",
>>                     "cartridges": [
>>                         "esb",
>>                         "tomcat"
>>                     ]
>>                 }
>>                  ]
>>         }
>>         ]
>>         }
>>     ]
>>
>> Giving the following JSON, the output tree structure look likes the
>> following.
>> _
>> |
>> +-|
>>   +-cartridges
>>   +-|
>>   | +-esb
>>   | +-tomcat
>>   +-name : level-one-group
>>   +-groups
>>   +-|
>>     +-|
>>       +-cartridges
>>       +-|
>>       | +-esb
>>       | +-tomcat
>>       +-name : level-two-group
>>       +-groups
>>       +-|
>>         +-|
>>           +-cartridges
>>           +-|
>>           | +-esb
>>           | +-tomcat
>>           +-name : level-three-group
>>
>> Hope this is how you want it. We can change the styles if you like.
>>
>> On Fri, Mar 27, 2015 at 7:11 PM, Milindu Sanoj Kumarage <
>> agentmilindu@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I have updated the proposal including more implementation details, and
>>> the demo app's details.
>>>
>>> ​​​​​
>>>  Proposal : Python based Command Line Tool (CLI) for Stratos
>>> <https://docs.google.com/document/d/1ORkVPtFnJQi6szswKaim8ZCIKMHi3d3eCVOuA18GOG4/edit?usp=drive_web>
>>> ​
>>>
>>> Meanwhile, I'm implementing the tree printing functionality. What are
>>> the details that need to be printed? It is data relates to clusters that
>>> comes as a JSON, right? Can I have a sample JSON, please.
>>>
>>>
>>>
>>> On Thu, Mar 26, 2015 at 12:05 AM, Milindu Sanoj Kumarage <
>>> agentmilindu@gmail.com> wrote:
>>>
>>>> Hi Imesh,
>>>>
>>>> Here I have uploaded  a simple CLI demo to Pip, you can install it with
>>>> giving this command if you have Pip on your system.
>>>>
>>>> $ sudo pip install stratos
>>>>
>>>> then can invoke it simply calling it on CLI as,
>>>>
>>>> $ stratos
>>>>
>>>>
>>>> What I'm trying to demonstrate with this demo is the basic
>>>> functionalists of the CLI, like autocomplete option, help options, input/
>>>> output redirection, etc. And ability to consume RESTful services via HTTP,
>>>> authenticating with HTTP Basic authentication. And also my ability to
>>>> create Python distributions.
>>>>
>>>> I'm using Github's API currently in order to demonstrate the ability to
>>>> make requests to API and get responses. Connecting to Github API with HTTP
>>>> Basic authentication.
>>>>
>>>>
>>>> *In the Interactive mode*
>>>>
>>>>    1. Give the 'user' command as follows. You will see your name and
>>>>    email retrieved from the Github API.
>>>>
>>>>    user -u <github-username> -p <github-password>
>>>>
>>>>    2. Type 're' and press Tab, it will complete the command.
>>>>    3. Type 'de' and press Tab, then the command will be completed up
>>>>    to 'deploy-' then press Tab twice. It will show the possible commands.
>>>>    4. Type 'de' and press Tab, then the command will be completed up
>>>>    to 'deploy-' then type 'u' and press Tab , it will complete the command.
>>>>    5. Type '?repositories' or 'help repositories' , this will show the
>>>>    help options for 'repositories' command.
>>>>    6. Give the 'repositories' command as follows. You will see 5 of
>>>>    your Github repositories in tabular format, retrieved from the Github API.
>>>>
>>>>    repositories -u <github-username> -p <github-password>
>>>>
>>>>    +----------------------+------------+
>>>>    |         Name         |  language  |
>>>>    +======================+============+
>>>>    | backbone-boilerplate | JavaScript |
>>>>    | CRUD.js              |        CSS |
>>>>    | DeciesGraph          |        CSS |
>>>>    | fancyBox             | JavaScript |
>>>>    | html5-boilerplate    | JavaScript |
>>>>    +----------------------+------------+
>>>>
>>>>    7. press up arrow key, you will the the last command issues, you
>>>>    can traverse through the history using up and down arrow keys.
>>>>    8. Try history command, Try list command.
>>>>    9. Try giving a shell command, it will work in the same way the
>>>>    bash works.
>>>>
>>>>    !ls
>>>>
>>>>    or
>>>>
>>>>    shell ls
>>>>
>>>> *In the single command mode*
>>>>
>>>>    1. Issues the commands in the same way as in interactive mode.
>>>>
>>>>    $ repositories -u <github-username> -p <github-password>
>>>>
>>>>    2. Issues this command in command line. It will write the output to
>>>>    a file names 'out.txt'.
>>>>
>>>>    stratos repositories -u <github-username> -p <github-password> >
>>>>    out.txt
>>>>
>>>>    3. Issues this command in command line. It will pipe the output to
>>>>    the grep command.
>>>>
>>>>    stratos repositories -u <github-username> -p <github-password> |
>>>>     grep JavaScript
>>>>
>>>>    4. Create a file with some commands, entered line by line, save it
>>>>    as commands.txt, then give this command while in CMD. It will execute the
>>>>    commands line by line and print the output to the console.
>>>>
>>>>    stratos < commands.txt
>>>>
>>>>    5. Create a file with some commands, entered line by line, save it
>>>>    as commands.txt, then give this command while in CMD. It will execute the
>>>>    commands line by line and print the output to out.txt file.
>>>>
>>>>    stratos < commands.txt > out.txt
>>>>
>>>>
>>>>
>>>>    ( I developed and tested  this on Linux with Python 2.7 version )
>>>>
>>>>
>>>
>>> On Thu, Mar 26, 2015 at 12:05 AM, Milindu Sanoj Kumarage <
>>> agentmilindu@gmail.com> wrote:
>>>
>>>> Hi Imesh,
>>>>
>>>> Here I have uploaded  a simple CLI demo to Pip, you can install it with
>>>> giving this command if you have Pip on your system.
>>>>
>>>> $ sudo pip install stratos
>>>>
>>>> then can invoke it simply calling it on CLI as,
>>>>
>>>> $ stratos
>>>>
>>>>
>>>> What I'm trying to demonstrate with this demo is the basic
>>>> functionalists of the CLI, like autocomplete option, help options, input/
>>>> output redirection, etc. And ability to consume RESTful services via HTTP,
>>>> authenticating with HTTP Basic authentication. And also my ability to
>>>> create Python distributions.
>>>>
>>>> I'm using Github's API currently in order to demonstrate the ability to
>>>> make requests to API and get responses. Connecting to Github API with HTTP
>>>> Basic authentication.
>>>>
>>>>
>>>> *In the Interactive mode*
>>>>
>>>>    1. Give the 'user' command as follows. You will see your name and
>>>>    email retrieved from the Github API.
>>>>
>>>>    user -u <github-username> -p <github-password>
>>>>
>>>>    2. Type 're' and press Tab, it will complete the command.
>>>>    3. Type 'de' and press Tab, then the command will be completed up
>>>>    to 'deploy-' then press Tab twice. It will show the possible commands.
>>>>    4. Type 'de' and press Tab, then the command will be completed up
>>>>    to 'deploy-' then type 'u' and press Tab , it will complete the command.
>>>>    5. Type '?repositories' or 'help repositories' , this will show the
>>>>    help options for 'repositories' command.
>>>>    6. Give the 'repositories' command as follows. You will see 5 of
>>>>    your Github repositories in tabular format, retrieved from the Github API.
>>>>
>>>>    repositories -u <github-username> -p <github-password>
>>>>
>>>>    +----------------------+------------+
>>>>    |         Name         |  language  |
>>>>    +======================+============+
>>>>    | backbone-boilerplate | JavaScript |
>>>>    | CRUD.js              |        CSS |
>>>>    | DeciesGraph          |        CSS |
>>>>    | fancyBox             | JavaScript |
>>>>    | html5-boilerplate    | JavaScript |
>>>>    +----------------------+------------+
>>>>
>>>>    7. press up arrow key, you will the the last command issues, you
>>>>    can traverse through the history using up and down arrow keys.
>>>>    8. Try history command, Try list command.
>>>>    9. Try giving a shell command, it will work in the same way the
>>>>    bash works.
>>>>
>>>>    !ls
>>>>
>>>>    or
>>>>
>>>>    shell ls
>>>>
>>>> *In the single command mode*
>>>>
>>>>    1. Issues the commands in the same way as in interactive mode.
>>>>
>>>>    $ repositories -u <github-username> -p <github-password>
>>>>
>>>>    2. Issues this command in command line. It will write the output to
>>>>    a file names 'out.txt'.
>>>>
>>>>    stratos repositories -u <github-username> -p <github-password> >
>>>>    out.txt
>>>>
>>>>    3. Issues this command in command line. It will pipe the output to
>>>>    the grep command.
>>>>
>>>>    stratos repositories -u <github-username> -p <github-password> |
>>>>     grep JavaScript
>>>>
>>>>    4. Create a file with some commands, entered line by line, save it
>>>>    as commands.txt, then give this command while in CMD. It will execute the
>>>>    commands line by line and print the output to the console.
>>>>
>>>>    stratos < commands.txt
>>>>
>>>>    5. Create a file with some commands, entered line by line, save it
>>>>    as commands.txt, then give this command while in CMD. It will execute the
>>>>    commands line by line and print the output to out.txt file.
>>>>
>>>>    stratos < commands.txt > out.txt
>>>>
>>>>
>>>>
>>>>    ( I developed and tested  this on Linux with Python 2.7 version )
>>>>
>>>>
>>>
>>
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>

Re: GSoC 2015

Posted by Imesh Gunaratne <im...@apache.org>.
+1 Great work Milindu! Yes this is exactly what we wanted. May be you could
remove the space between the colon and the name of the attribute.

Thanks

On Sat, Mar 28, 2015 at 7:48 PM, Milindu Sanoj Kumarage <
agentmilindu@gmail.com> wrote:

> Hi,
>
> I coded that tree printing functionality, assuming it is a JSON structure
> we have to print and it looks likes this one.
>
>  [
>         {
>             "name": "level-one-group",
>             "cartridges": [
>                 "esb",
>                 "tomcat"
>             ],
>             "groups": [
>         {
>             "name": "level-two-group",
>             "cartridges": [
>                 "esb",
>                 "tomcat"
>             ],
>                     "groups": [
>                 {
>                     "name": "level-three-group",
>                     "cartridges": [
>                         "esb",
>                         "tomcat"
>                     ]
>                 }
>                  ]
>         }
>         ]
>         }
>     ]
>
> Giving the following JSON, the output tree structure look likes the
> following.
> _
> |
> +-|
>   +-cartridges
>   +-|
>   | +-esb
>   | +-tomcat
>   +-name : level-one-group
>   +-groups
>   +-|
>     +-|
>       +-cartridges
>       +-|
>       | +-esb
>       | +-tomcat
>       +-name : level-two-group
>       +-groups
>       +-|
>         +-|
>           +-cartridges
>           +-|
>           | +-esb
>           | +-tomcat
>           +-name : level-three-group
>
> Hope this is how you want it. We can change the styles if you like.
>
> On Fri, Mar 27, 2015 at 7:11 PM, Milindu Sanoj Kumarage <
> agentmilindu@gmail.com> wrote:
>
>> Hi,
>>
>> I have updated the proposal including more implementation details, and
>> the demo app's details.
>>
>> ​​​​​
>>  Proposal : Python based Command Line Tool (CLI) for Stratos
>> <https://docs.google.com/document/d/1ORkVPtFnJQi6szswKaim8ZCIKMHi3d3eCVOuA18GOG4/edit?usp=drive_web>
>> ​
>>
>> Meanwhile, I'm implementing the tree printing functionality. What are the
>> details that need to be printed? It is data relates to clusters that comes
>> as a JSON, right? Can I have a sample JSON, please.
>>
>>
>>
>> On Thu, Mar 26, 2015 at 12:05 AM, Milindu Sanoj Kumarage <
>> agentmilindu@gmail.com> wrote:
>>
>>> Hi Imesh,
>>>
>>> Here I have uploaded  a simple CLI demo to Pip, you can install it with
>>> giving this command if you have Pip on your system.
>>>
>>> $ sudo pip install stratos
>>>
>>> then can invoke it simply calling it on CLI as,
>>>
>>> $ stratos
>>>
>>>
>>> What I'm trying to demonstrate with this demo is the basic
>>> functionalists of the CLI, like autocomplete option, help options, input/
>>> output redirection, etc. And ability to consume RESTful services via HTTP,
>>> authenticating with HTTP Basic authentication. And also my ability to
>>> create Python distributions.
>>>
>>> I'm using Github's API currently in order to demonstrate the ability to
>>> make requests to API and get responses. Connecting to Github API with HTTP
>>> Basic authentication.
>>>
>>>
>>> *In the Interactive mode*
>>>
>>>    1. Give the 'user' command as follows. You will see your name and
>>>    email retrieved from the Github API.
>>>
>>>    user -u <github-username> -p <github-password>
>>>
>>>    2. Type 're' and press Tab, it will complete the command.
>>>    3. Type 'de' and press Tab, then the command will be completed up to
>>>    'deploy-' then press Tab twice. It will show the possible commands.
>>>    4. Type 'de' and press Tab, then the command will be completed up to
>>>    'deploy-' then type 'u' and press Tab , it will complete the command.
>>>    5. Type '?repositories' or 'help repositories' , this will show the
>>>    help options for 'repositories' command.
>>>    6. Give the 'repositories' command as follows. You will see 5 of
>>>    your Github repositories in tabular format, retrieved from the Github API.
>>>
>>>    repositories -u <github-username> -p <github-password>
>>>
>>>    +----------------------+------------+
>>>    |         Name         |  language  |
>>>    +======================+============+
>>>    | backbone-boilerplate | JavaScript |
>>>    | CRUD.js              |        CSS |
>>>    | DeciesGraph          |        CSS |
>>>    | fancyBox             | JavaScript |
>>>    | html5-boilerplate    | JavaScript |
>>>    +----------------------+------------+
>>>
>>>    7. press up arrow key, you will the the last command issues, you can
>>>    traverse through the history using up and down arrow keys.
>>>    8. Try history command, Try list command.
>>>    9. Try giving a shell command, it will work in the same way the bash
>>>    works.
>>>
>>>    !ls
>>>
>>>    or
>>>
>>>    shell ls
>>>
>>> *In the single command mode*
>>>
>>>    1. Issues the commands in the same way as in interactive mode.
>>>
>>>    $ repositories -u <github-username> -p <github-password>
>>>
>>>    2. Issues this command in command line. It will write the output to
>>>    a file names 'out.txt'.
>>>
>>>    stratos repositories -u <github-username> -p <github-password> >
>>>    out.txt
>>>
>>>    3. Issues this command in command line. It will pipe the output to
>>>    the grep command.
>>>
>>>    stratos repositories -u <github-username> -p <github-password> |
>>>     grep JavaScript
>>>
>>>    4. Create a file with some commands, entered line by line, save it
>>>    as commands.txt, then give this command while in CMD. It will execute the
>>>    commands line by line and print the output to the console.
>>>
>>>    stratos < commands.txt
>>>
>>>    5. Create a file with some commands, entered line by line, save it
>>>    as commands.txt, then give this command while in CMD. It will execute the
>>>    commands line by line and print the output to out.txt file.
>>>
>>>    stratos < commands.txt > out.txt
>>>
>>>
>>>
>>>    ( I developed and tested  this on Linux with Python 2.7 version )
>>>
>>>
>>
>> On Thu, Mar 26, 2015 at 12:05 AM, Milindu Sanoj Kumarage <
>> agentmilindu@gmail.com> wrote:
>>
>>> Hi Imesh,
>>>
>>> Here I have uploaded  a simple CLI demo to Pip, you can install it with
>>> giving this command if you have Pip on your system.
>>>
>>> $ sudo pip install stratos
>>>
>>> then can invoke it simply calling it on CLI as,
>>>
>>> $ stratos
>>>
>>>
>>> What I'm trying to demonstrate with this demo is the basic
>>> functionalists of the CLI, like autocomplete option, help options, input/
>>> output redirection, etc. And ability to consume RESTful services via HTTP,
>>> authenticating with HTTP Basic authentication. And also my ability to
>>> create Python distributions.
>>>
>>> I'm using Github's API currently in order to demonstrate the ability to
>>> make requests to API and get responses. Connecting to Github API with HTTP
>>> Basic authentication.
>>>
>>>
>>> *In the Interactive mode*
>>>
>>>    1. Give the 'user' command as follows. You will see your name and
>>>    email retrieved from the Github API.
>>>
>>>    user -u <github-username> -p <github-password>
>>>
>>>    2. Type 're' and press Tab, it will complete the command.
>>>    3. Type 'de' and press Tab, then the command will be completed up to
>>>    'deploy-' then press Tab twice. It will show the possible commands.
>>>    4. Type 'de' and press Tab, then the command will be completed up to
>>>    'deploy-' then type 'u' and press Tab , it will complete the command.
>>>    5. Type '?repositories' or 'help repositories' , this will show the
>>>    help options for 'repositories' command.
>>>    6. Give the 'repositories' command as follows. You will see 5 of
>>>    your Github repositories in tabular format, retrieved from the Github API.
>>>
>>>    repositories -u <github-username> -p <github-password>
>>>
>>>    +----------------------+------------+
>>>    |         Name         |  language  |
>>>    +======================+============+
>>>    | backbone-boilerplate | JavaScript |
>>>    | CRUD.js              |        CSS |
>>>    | DeciesGraph          |        CSS |
>>>    | fancyBox             | JavaScript |
>>>    | html5-boilerplate    | JavaScript |
>>>    +----------------------+------------+
>>>
>>>    7. press up arrow key, you will the the last command issues, you can
>>>    traverse through the history using up and down arrow keys.
>>>    8. Try history command, Try list command.
>>>    9. Try giving a shell command, it will work in the same way the bash
>>>    works.
>>>
>>>    !ls
>>>
>>>    or
>>>
>>>    shell ls
>>>
>>> *In the single command mode*
>>>
>>>    1. Issues the commands in the same way as in interactive mode.
>>>
>>>    $ repositories -u <github-username> -p <github-password>
>>>
>>>    2. Issues this command in command line. It will write the output to
>>>    a file names 'out.txt'.
>>>
>>>    stratos repositories -u <github-username> -p <github-password> >
>>>    out.txt
>>>
>>>    3. Issues this command in command line. It will pipe the output to
>>>    the grep command.
>>>
>>>    stratos repositories -u <github-username> -p <github-password> |
>>>     grep JavaScript
>>>
>>>    4. Create a file with some commands, entered line by line, save it
>>>    as commands.txt, then give this command while in CMD. It will execute the
>>>    commands line by line and print the output to the console.
>>>
>>>    stratos < commands.txt
>>>
>>>    5. Create a file with some commands, entered line by line, save it
>>>    as commands.txt, then give this command while in CMD. It will execute the
>>>    commands line by line and print the output to out.txt file.
>>>
>>>    stratos < commands.txt > out.txt
>>>
>>>
>>>
>>>    ( I developed and tested  this on Linux with Python 2.7 version )
>>>
>>>
>>
>


-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: GSoC 2015

Posted by Milindu Sanoj Kumarage <ag...@gmail.com>.
Hi,

I coded that tree printing functionality, assuming it is a JSON structure
we have to print and it looks likes this one.

 [
        {
            "name": "level-one-group",
            "cartridges": [
                "esb",
                "tomcat"
            ],
            "groups": [
        {
            "name": "level-two-group",
            "cartridges": [
                "esb",
                "tomcat"
            ],
                    "groups": [
                {
                    "name": "level-three-group",
                    "cartridges": [
                        "esb",
                        "tomcat"
                    ]
                }
                 ]
        }
        ]
        }
    ]

Giving the following JSON, the output tree structure look likes the
following.
_
|
+-|
  +-cartridges
  +-|
  | +-esb
  | +-tomcat
  +-name : level-one-group
  +-groups
  +-|
    +-|
      +-cartridges
      +-|
      | +-esb
      | +-tomcat
      +-name : level-two-group
      +-groups
      +-|
        +-|
          +-cartridges
          +-|
          | +-esb
          | +-tomcat
          +-name : level-three-group

Hope this is how you want it. We can change the styles if you like.

On Fri, Mar 27, 2015 at 7:11 PM, Milindu Sanoj Kumarage <
agentmilindu@gmail.com> wrote:

> Hi,
>
> I have updated the proposal including more implementation details, and the
> demo app's details.
>
> ​​​​​
>  Proposal : Python based Command Line Tool (CLI) for Stratos
> <https://docs.google.com/document/d/1ORkVPtFnJQi6szswKaim8ZCIKMHi3d3eCVOuA18GOG4/edit?usp=drive_web>
> ​
>
> Meanwhile, I'm implementing the tree printing functionality. What are the
> details that need to be printed? It is data relates to clusters that comes
> as a JSON, right? Can I have a sample JSON, please.
>
>
>
> On Thu, Mar 26, 2015 at 12:05 AM, Milindu Sanoj Kumarage <
> agentmilindu@gmail.com> wrote:
>
>> Hi Imesh,
>>
>> Here I have uploaded  a simple CLI demo to Pip, you can install it with
>> giving this command if you have Pip on your system.
>>
>> $ sudo pip install stratos
>>
>> then can invoke it simply calling it on CLI as,
>>
>> $ stratos
>>
>>
>> What I'm trying to demonstrate with this demo is the basic functionalists
>> of the CLI, like autocomplete option, help options, input/ output
>> redirection, etc. And ability to consume RESTful services via HTTP,
>> authenticating with HTTP Basic authentication. And also my ability to
>> create Python distributions.
>>
>> I'm using Github's API currently in order to demonstrate the ability to
>> make requests to API and get responses. Connecting to Github API with HTTP
>> Basic authentication.
>>
>>
>> *In the Interactive mode*
>>
>>    1. Give the 'user' command as follows. You will see your name and
>>    email retrieved from the Github API.
>>
>>    user -u <github-username> -p <github-password>
>>
>>    2. Type 're' and press Tab, it will complete the command.
>>    3. Type 'de' and press Tab, then the command will be completed up to
>>    'deploy-' then press Tab twice. It will show the possible commands.
>>    4. Type 'de' and press Tab, then the command will be completed up to
>>    'deploy-' then type 'u' and press Tab , it will complete the command.
>>    5. Type '?repositories' or 'help repositories' , this will show the
>>    help options for 'repositories' command.
>>    6. Give the 'repositories' command as follows. You will see 5 of your
>>    Github repositories in tabular format, retrieved from the Github API.
>>
>>    repositories -u <github-username> -p <github-password>
>>
>>    +----------------------+------------+
>>    |         Name         |  language  |
>>    +======================+============+
>>    | backbone-boilerplate | JavaScript |
>>    | CRUD.js              |        CSS |
>>    | DeciesGraph          |        CSS |
>>    | fancyBox             | JavaScript |
>>    | html5-boilerplate    | JavaScript |
>>    +----------------------+------------+
>>
>>    7. press up arrow key, you will the the last command issues, you can
>>    traverse through the history using up and down arrow keys.
>>    8. Try history command, Try list command.
>>    9. Try giving a shell command, it will work in the same way the bash
>>    works.
>>
>>    !ls
>>
>>    or
>>
>>    shell ls
>>
>> *In the single command mode*
>>
>>    1. Issues the commands in the same way as in interactive mode.
>>
>>    $ repositories -u <github-username> -p <github-password>
>>
>>    2. Issues this command in command line. It will write the output to a
>>    file names 'out.txt'.
>>
>>    stratos repositories -u <github-username> -p <github-password> >
>>    out.txt
>>
>>    3. Issues this command in command line. It will pipe the output to
>>    the grep command.
>>
>>    stratos repositories -u <github-username> -p <github-password> |
>>     grep JavaScript
>>
>>    4. Create a file with some commands, entered line by line, save it as
>>    commands.txt, then give this command while in CMD. It will execute the
>>    commands line by line and print the output to the console.
>>
>>    stratos < commands.txt
>>
>>    5. Create a file with some commands, entered line by line, save it as
>>    commands.txt, then give this command while in CMD. It will execute the
>>    commands line by line and print the output to out.txt file.
>>
>>    stratos < commands.txt > out.txt
>>
>>
>>
>>    ( I developed and tested  this on Linux with Python 2.7 version )
>>
>>
>
> On Thu, Mar 26, 2015 at 12:05 AM, Milindu Sanoj Kumarage <
> agentmilindu@gmail.com> wrote:
>
>> Hi Imesh,
>>
>> Here I have uploaded  a simple CLI demo to Pip, you can install it with
>> giving this command if you have Pip on your system.
>>
>> $ sudo pip install stratos
>>
>> then can invoke it simply calling it on CLI as,
>>
>> $ stratos
>>
>>
>> What I'm trying to demonstrate with this demo is the basic functionalists
>> of the CLI, like autocomplete option, help options, input/ output
>> redirection, etc. And ability to consume RESTful services via HTTP,
>> authenticating with HTTP Basic authentication. And also my ability to
>> create Python distributions.
>>
>> I'm using Github's API currently in order to demonstrate the ability to
>> make requests to API and get responses. Connecting to Github API with HTTP
>> Basic authentication.
>>
>>
>> *In the Interactive mode*
>>
>>    1. Give the 'user' command as follows. You will see your name and
>>    email retrieved from the Github API.
>>
>>    user -u <github-username> -p <github-password>
>>
>>    2. Type 're' and press Tab, it will complete the command.
>>    3. Type 'de' and press Tab, then the command will be completed up to
>>    'deploy-' then press Tab twice. It will show the possible commands.
>>    4. Type 'de' and press Tab, then the command will be completed up to
>>    'deploy-' then type 'u' and press Tab , it will complete the command.
>>    5. Type '?repositories' or 'help repositories' , this will show the
>>    help options for 'repositories' command.
>>    6. Give the 'repositories' command as follows. You will see 5 of your
>>    Github repositories in tabular format, retrieved from the Github API.
>>
>>    repositories -u <github-username> -p <github-password>
>>
>>    +----------------------+------------+
>>    |         Name         |  language  |
>>    +======================+============+
>>    | backbone-boilerplate | JavaScript |
>>    | CRUD.js              |        CSS |
>>    | DeciesGraph          |        CSS |
>>    | fancyBox             | JavaScript |
>>    | html5-boilerplate    | JavaScript |
>>    +----------------------+------------+
>>
>>    7. press up arrow key, you will the the last command issues, you can
>>    traverse through the history using up and down arrow keys.
>>    8. Try history command, Try list command.
>>    9. Try giving a shell command, it will work in the same way the bash
>>    works.
>>
>>    !ls
>>
>>    or
>>
>>    shell ls
>>
>> *In the single command mode*
>>
>>    1. Issues the commands in the same way as in interactive mode.
>>
>>    $ repositories -u <github-username> -p <github-password>
>>
>>    2. Issues this command in command line. It will write the output to a
>>    file names 'out.txt'.
>>
>>    stratos repositories -u <github-username> -p <github-password> >
>>    out.txt
>>
>>    3. Issues this command in command line. It will pipe the output to
>>    the grep command.
>>
>>    stratos repositories -u <github-username> -p <github-password> |
>>     grep JavaScript
>>
>>    4. Create a file with some commands, entered line by line, save it as
>>    commands.txt, then give this command while in CMD. It will execute the
>>    commands line by line and print the output to the console.
>>
>>    stratos < commands.txt
>>
>>    5. Create a file with some commands, entered line by line, save it as
>>    commands.txt, then give this command while in CMD. It will execute the
>>    commands line by line and print the output to out.txt file.
>>
>>    stratos < commands.txt > out.txt
>>
>>
>>
>>    ( I developed and tested  this on Linux with Python 2.7 version )
>>
>>
>

Re: GSoC 2015

Posted by Milindu Sanoj Kumarage <ag...@gmail.com>.
Hi,

I have updated the proposal including more implementation details, and the
demo app's details.

​​​​​
 Proposal : Python based Command Line Tool (CLI) for Stratos
<https://docs.google.com/document/d/1ORkVPtFnJQi6szswKaim8ZCIKMHi3d3eCVOuA18GOG4/edit?usp=drive_web>
​

Meanwhile, I'm implementing the tree printing functionality. What are the
details that need to be printed? It is data relates to clusters that comes
as a JSON, right? Can I have a sample JSON, please.



On Thu, Mar 26, 2015 at 12:05 AM, Milindu Sanoj Kumarage <
agentmilindu@gmail.com> wrote:

> Hi Imesh,
>
> Here I have uploaded  a simple CLI demo to Pip, you can install it with
> giving this command if you have Pip on your system.
>
> $ sudo pip install stratos
>
> then can invoke it simply calling it on CLI as,
>
> $ stratos
>
>
> What I'm trying to demonstrate with this demo is the basic functionalists
> of the CLI, like autocomplete option, help options, input/ output
> redirection, etc. And ability to consume RESTful services via HTTP,
> authenticating with HTTP Basic authentication. And also my ability to
> create Python distributions.
>
> I'm using Github's API currently in order to demonstrate the ability to
> make requests to API and get responses. Connecting to Github API with HTTP
> Basic authentication.
>
>
> *In the Interactive mode*
>
>    1. Give the 'user' command as follows. You will see your name and
>    email retrieved from the Github API.
>
>    user -u <github-username> -p <github-password>
>
>    2. Type 're' and press Tab, it will complete the command.
>    3. Type 'de' and press Tab, then the command will be completed up to
>    'deploy-' then press Tab twice. It will show the possible commands.
>    4. Type 'de' and press Tab, then the command will be completed up to
>    'deploy-' then type 'u' and press Tab , it will complete the command.
>    5. Type '?repositories' or 'help repositories' , this will show the
>    help options for 'repositories' command.
>    6. Give the 'repositories' command as follows. You will see 5 of your
>    Github repositories in tabular format, retrieved from the Github API.
>
>    repositories -u <github-username> -p <github-password>
>
>    +----------------------+------------+
>    |         Name         |  language  |
>    +======================+============+
>    | backbone-boilerplate | JavaScript |
>    | CRUD.js              |        CSS |
>    | DeciesGraph          |        CSS |
>    | fancyBox             | JavaScript |
>    | html5-boilerplate    | JavaScript |
>    +----------------------+------------+
>
>    7. press up arrow key, you will the the last command issues, you can
>    traverse through the history using up and down arrow keys.
>    8. Try history command, Try list command.
>    9. Try giving a shell command, it will work in the same way the bash
>    works.
>
>    !ls
>
>    or
>
>    shell ls
>
> *In the single command mode*
>
>    1. Issues the commands in the same way as in interactive mode.
>
>    $ repositories -u <github-username> -p <github-password>
>
>    2. Issues this command in command line. It will write the output to a
>    file names 'out.txt'.
>
>    stratos repositories -u <github-username> -p <github-password> >
>    out.txt
>
>    3. Issues this command in command line. It will pipe the output to the
>    grep command.
>
>    stratos repositories -u <github-username> -p <github-password> |  grep
>    JavaScript
>
>    4. Create a file with some commands, entered line by line, save it as
>    commands.txt, then give this command while in CMD. It will execute the
>    commands line by line and print the output to the console.
>
>    stratos < commands.txt
>
>    5. Create a file with some commands, entered line by line, save it as
>    commands.txt, then give this command while in CMD. It will execute the
>    commands line by line and print the output to out.txt file.
>
>    stratos < commands.txt > out.txt
>
>
>
>    ( I developed and tested  this on Linux with Python 2.7 version )
>
>

On Thu, Mar 26, 2015 at 12:05 AM, Milindu Sanoj Kumarage <
agentmilindu@gmail.com> wrote:

> Hi Imesh,
>
> Here I have uploaded  a simple CLI demo to Pip, you can install it with
> giving this command if you have Pip on your system.
>
> $ sudo pip install stratos
>
> then can invoke it simply calling it on CLI as,
>
> $ stratos
>
>
> What I'm trying to demonstrate with this demo is the basic functionalists
> of the CLI, like autocomplete option, help options, input/ output
> redirection, etc. And ability to consume RESTful services via HTTP,
> authenticating with HTTP Basic authentication. And also my ability to
> create Python distributions.
>
> I'm using Github's API currently in order to demonstrate the ability to
> make requests to API and get responses. Connecting to Github API with HTTP
> Basic authentication.
>
>
> *In the Interactive mode*
>
>    1. Give the 'user' command as follows. You will see your name and
>    email retrieved from the Github API.
>
>    user -u <github-username> -p <github-password>
>
>    2. Type 're' and press Tab, it will complete the command.
>    3. Type 'de' and press Tab, then the command will be completed up to
>    'deploy-' then press Tab twice. It will show the possible commands.
>    4. Type 'de' and press Tab, then the command will be completed up to
>    'deploy-' then type 'u' and press Tab , it will complete the command.
>    5. Type '?repositories' or 'help repositories' , this will show the
>    help options for 'repositories' command.
>    6. Give the 'repositories' command as follows. You will see 5 of your
>    Github repositories in tabular format, retrieved from the Github API.
>
>    repositories -u <github-username> -p <github-password>
>
>    +----------------------+------------+
>    |         Name         |  language  |
>    +======================+============+
>    | backbone-boilerplate | JavaScript |
>    | CRUD.js              |        CSS |
>    | DeciesGraph          |        CSS |
>    | fancyBox             | JavaScript |
>    | html5-boilerplate    | JavaScript |
>    +----------------------+------------+
>
>    7. press up arrow key, you will the the last command issues, you can
>    traverse through the history using up and down arrow keys.
>    8. Try history command, Try list command.
>    9. Try giving a shell command, it will work in the same way the bash
>    works.
>
>    !ls
>
>    or
>
>    shell ls
>
> *In the single command mode*
>
>    1. Issues the commands in the same way as in interactive mode.
>
>    $ repositories -u <github-username> -p <github-password>
>
>    2. Issues this command in command line. It will write the output to a
>    file names 'out.txt'.
>
>    stratos repositories -u <github-username> -p <github-password> >
>    out.txt
>
>    3. Issues this command in command line. It will pipe the output to the
>    grep command.
>
>    stratos repositories -u <github-username> -p <github-password> |  grep
>    JavaScript
>
>    4. Create a file with some commands, entered line by line, save it as
>    commands.txt, then give this command while in CMD. It will execute the
>    commands line by line and print the output to the console.
>
>    stratos < commands.txt
>
>    5. Create a file with some commands, entered line by line, save it as
>    commands.txt, then give this command while in CMD. It will execute the
>    commands line by line and print the output to out.txt file.
>
>    stratos < commands.txt > out.txt
>
>
>
>    ( I developed and tested  this on Linux with Python 2.7 version )
>
>

Re: GSoC 2015

Posted by Milindu Sanoj Kumarage <ag...@gmail.com>.
Hi Imesh,

Here I have uploaded  a simple CLI demo to Pip, you can install it with
giving this command if you have Pip on your system.

$ sudo pip install stratos

then can invoke it simply calling it on CLI as,

$ stratos


What I'm trying to demonstrate with this demo is the basic functionalists
of the CLI, like autocomplete option, help options, input/ output
redirection, etc. And ability to consume RESTful services via HTTP,
authenticating with HTTP Basic authentication. And also my ability to
create Python distributions.

I'm using Github's API currently in order to demonstrate the ability to
make requests to API and get responses. Connecting to Github API with HTTP
Basic authentication.


*In the Interactive mode*

   1. Give the 'user' command as follows. You will see your name and email
   retrieved from the Github API.

   user -u <github-username> -p <github-password>

   2. Type 're' and press Tab, it will complete the command.
   3. Type 'de' and press Tab, then the command will be completed up to
   'deploy-' then press Tab twice. It will show the possible commands.
   4. Type 'de' and press Tab, then the command will be completed up to
   'deploy-' then type 'u' and press Tab , it will complete the command.
   5. Type '?repositories' or 'help repositories' , this will show the help
   options for 'repositories' command.
   6. Give the 'repositories' command as follows. You will see 5 of your
   Github repositories in tabular format, retrieved from the Github API.

   repositories -u <github-username> -p <github-password>

   +----------------------+------------+
   |         Name         |  language  |
   +======================+============+
   | backbone-boilerplate | JavaScript |
   | CRUD.js              |        CSS |
   | DeciesGraph          |        CSS |
   | fancyBox             | JavaScript |
   | html5-boilerplate    | JavaScript |
   +----------------------+------------+

   7. press up arrow key, you will the the last command issues, you can
   traverse through the history using up and down arrow keys.
   8. Try history command, Try list command.
   9. Try giving a shell command, it will work in the same way the bash
   works.

   !ls

   or

   shell ls

*In the single command mode*

   1. Issues the commands in the same way as in interactive mode.

   $ repositories -u <github-username> -p <github-password>

   2. Issues this command in command line. It will write the output to a
   file names 'out.txt'.

   stratos repositories -u <github-username> -p <github-password> > out.txt

   3. Issues this command in command line. It will pipe the output to the
   grep command.

   stratos repositories -u <github-username> -p <github-password> |  grep
   JavaScript

   4. Create a file with some commands, entered line by line, save it as
   commands.txt, then give this command while in CMD. It will execute the
   commands line by line and print the output to the console.

   stratos < commands.txt

   5. Create a file with some commands, entered line by line, save it as
   commands.txt, then give this command while in CMD. It will execute the
   commands line by line and print the output to out.txt file.

   stratos < commands.txt > out.txt



   ( I developed and tested  this on Linux with Python 2.7 version )

Re: GSoC 2015

Posted by Milindu Sanoj Kumarage <ag...@gmail.com>.
Hi Imesh,

Yes, sure, let's have a Google Hangout. I'm okay with 2.30pm.

Thanks.

Re: GSoC 2015

Posted by Imesh Gunaratne <im...@apache.org>.
Hi Milindu,

Your project proposal looks good. Shall we have a quick Google Hangout to
discuss this? Will you be able to make it today the 24th March at 2.30 PM
IST?

Thanks

On Tue, Mar 24, 2015 at 5:55 AM, Milindu Sanoj Kumarage <
agentmilindu@gmail.com> wrote:

> Hi,
>
> I started writing the proposal, here I have attached it. I would be
> thankful if you can help me improve it.
> ​
>  Proposal : Python based Command Line Tool (CLI) for Stratos
> <https://docs.google.com/document/d/1ORkVPtFnJQi6szswKaim8ZCIKMHi3d3eCVOuA18GOG4/edit?usp=drive_web>
> ​
>
> On Wed, Mar 11, 2015 at 12:57 AM, Imesh Gunaratne <im...@apache.org>
> wrote:
>
>> Hi Milindu,
>>
>> Yes you seems to be on track. Please use Kubernetes getting started guide
>> here:
>> https://gist.github.com/imesh/b8f81fac8de39183a504
>>
>> Thanks
>>
>>
>> On Mon, Mar 9, 2015 at 8:22 PM, Milindu Sanoj Kumarage <
>> agentmilindu@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I could fix that "-" problem, everything is now works exactly as Java
>>> CLI. I think I can do a demo app with some functionality, then we can
>>> discuss further, right?
>>>
>>> And I'm currently setting up the Stratos on my machine, it seems setting
>>> up  OpenStack ( DevStack ) is not easy, I found that Kubernetes Vagrant
>>> Setup, trying it, and seems it is working fine. Going on that path would
>>> not  be a problem, right?
>>>
>>>
>>>
>>> On Fri, Mar 6, 2015 at 9:37 AM, Imesh Gunaratne <im...@apache.org>
>>> wrote:
>>>
>>>> Great! Nice to hear that. We might not need to use "_", it would be
>>>> better if auto completion could also use commands with "-" pattern.
>>>>
>>>> At the moment we do not have much client side validations, most of them
>>>> are done in server. You could refer [1] for this.
>>>>
>>>> [1] https://cwiki.apache.org/confluence/display/STRATOS/4.1.0+CLI+Guide
>>>>
>>>> On Thu, Mar 5, 2015 at 6:23 PM, Milindu Sanoj Kumarage <
>>>> agentmilindu@gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> With this workaround ( actually it is not a workaround, Cmd2 really
>>>>> has aliases feature! but in different name ) we can have both "
>>>>> list-tenants" and "list_tenants" working without a problem. Therefor
>>>>> the  Single command line mode would work exactly like the Java CLI, and
>>>>> also the Interactive mode. But in Interactive mode, auto-complete still
>>>>>  suggests "list_tenants" instead of "list-tenants". we can change
>>>>> that too if you really need, but needs some alternations that may not be
>>>>> very beautiful, but not ugly too.
>>>>>
>>>>> one more question, we have to validate the parameters before sending
>>>>> to the REST API, right? Do we have any document for these validations, or
>>>>> is it the codes I have to follow?
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Mar 5, 2015 at 3:50 AM, Imesh Gunaratne <im...@apache.org>
>>>>> wrote:
>>>>>
>>>>>> Hi Milindu,
>>>>>>
>>>>>> Great work! We will have a look at this and get back to you. In the
>>>>>> mean time can you provide some details on this sample?
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> On Thu, Mar 5, 2015 at 12:12 AM, Milindu Sanoj Kumarage <
>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>> I spend last few days investigating a workarounds to solve that '-'
>>>>>>> problem :) It seems it is possible.
>>>>>>>
>>>>>>> BTW, I checked the possibility of uploading the final product to Pip
>>>>>>> where anyone can  install Stratos CLI using Pip like
>>>>>>> $Pip install stratos
>>>>>>>
>>>>>>> and then run like
>>>>>>>
>>>>>>> $ stratos -u abcdef
>>>>>>>
>>>>>>> What's your idea on that? ( We can also provide python script with a
>>>>>>> wrapper for Windows and Linux  )
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Feb 27, 2015 at 9:45 PM, Milindu Sanoj Kumarage <
>>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> the reason is  Cmd2 ( and most of the python CLI frameworks ) uses
>>>>>>>> function mapping to CLI commands, that is,
>>>>>>>>
>>>>>>>> // stratos>greet
>>>>>>>> def do_greet():
>>>>>>>>     print("hi")
>>>>>>>>
>>>>>>>> will become the 'greet' command.
>>>>>>>>
>>>>>>>> But if we need,
>>>>>>>>
>>>>>>>> 'list-tenants' we have to code it as
>>>>>>>>
>>>>>>>> def do_list-tenants:
>>>>>>>>    #codes of list tenant command
>>>>>>>>
>>>>>>>> But using '-' in names of functions ( def*enitions* ) in Python is
>>>>>>>> not allowed.
>>>>>>>> What shall we do? I'm okay even to write it from the scratch.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Fri, Feb 27, 2015 at 9:29 PM, Imesh Gunaratne <im...@apache.org>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Hi Milindu,
>>>>>>>>>
>>>>>>>>> Is there any way of using "-" in the CLI commands. I did not get
>>>>>>>>> why a CLI framework would block "-" character.
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>>
>>>>>>>>> On Fri, Feb 27, 2015 at 2:49 PM, Milindu Sanoj Kumarage <
>>>>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> Then shall we go with Cmd2 python package? Only change we have to
>>>>>>>>>> do is call CLI commands with '_ '  instead '-', like 'list_tenants' instead
>>>>>>>>>> of 'list-tenants'.
>>>>>>>>>>
>>>>>>>>>> And for HTTP request/response handling,  we can use either
>>>>>>>>>> Python's urllib3 or Requests, a wrapper around urllib3 which gives much
>>>>>>>>>> simpler API that leads to  cleaner codes. It's been praised in the
>>>>>>>>>> community from the beginning.
>>>>>>>>>>
>>>>>>>>>> Licence: Apache2
>>>>>>>>>>
>>>>>>>>>> http://docs.python-requests.org/en/latest/#
>>>>>>>>>>
>>>>>>>>>> On Wed, Feb 25, 2015 at 3:26 PM, Milindu Sanoj Kumarage <
>>>>>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> Here I have included the licences of each framework :)
>>>>>>>>>>>
>>>>>>>>>>> *Cement *(6/10)
>>>>>>>>>>> A complex framework, every CLI commands is bound to a separate
>>>>>>>>>>> Python class that acts like an controller, and each controller have several
>>>>>>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>>>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>>>>>>>>>> via aliases. But no much developments in Github repo recently.
>>>>>>>>>>>
>>>>>>>>>>> http://cement.readthedocs.org/
>>>>>>>>>>>
>>>>>>>>>>> Licence : http://cement.readthedocs.org/en/latest/license/
>>>>>>>>>>> Redistribution and use in source and binary forms, with or
>>>>>>>>>>> without modification, are permitted under given conditions.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> *Click *(7/10)
>>>>>>>>>>> Rich with features, uses Python Decorators to bind CLI commands
>>>>>>>>>>> to functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>>>>> mode'.
>>>>>>>>>>>
>>>>>>>>>>> http://click.pocoo.org/3/
>>>>>>>>>>>
>>>>>>>>>>> Licence :  http://click.pocoo.org/3/license/
>>>>>>>>>>>  three-clause BSD License
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> *Plac *(4/10)
>>>>>>>>>>> A scaled down version of Python argparse package.  Uses set of
>>>>>>>>>>> if else statements to process the commands. But no 'Interactive Mode'
>>>>>>>>>>> support.
>>>>>>>>>>>
>>>>>>>>>>> http://plac.googlecode.com/hg/doc/plac.html
>>>>>>>>>>>
>>>>>>>>>>> Licence: http://plac.googlecode.com/hg/doc/plac.html
>>>>>>>>>>> BSD license
>>>>>>>>>>>
>>>>>>>>>>> *Cliapp *(3/10)
>>>>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>>>>
>>>>>>>>>>> http://code.liw.fi/cliapp/docs/
>>>>>>>>>>>
>>>>>>>>>>> Licence : https://github.com/rshk/CliApp/blob/master/LICENSE
>>>>>>>>>>> Apache License
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> *pyCLI  *(3/10)
>>>>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>>>>
>>>>>>>>>>> http://pythonhosted.org//pyCLI/
>>>>>>>>>>>
>>>>>>>>>>> Licence: http://sourceforge.net/projects/pycli/
>>>>>>>>>>> GNU General Public License version 2.0 (GPLv2)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> *Cliff *(9/10)
>>>>>>>>>>> A framework for building command line programs by OpenStack. It
>>>>>>>>>>> uses plugins to define sub-commands, output formatters, and other
>>>>>>>>>>> extensions.
>>>>>>>>>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>>>>>>>>>
>>>>>>>>>>> http://docs.openstack.org/developer/cliff/index.html
>>>>>>>>>>>
>>>>>>>>>>> Licence: https://launchpad.net/python-cliff
>>>>>>>>>>> Apache Licence
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> *cmd *(8/10)
>>>>>>>>>>> Python in built packages for 'Interactive Mode' applications.
>>>>>>>>>>> Maps CLI commands to functions by function name, as def
>>>>>>>>>>> do_<whatever the command name> ( eg: def do_command1 is for
>>>>>>>>>>> command1 ). Support only arguments but no support for Unix-style flags.
>>>>>>>>>>> Have features like automatic command completion in 'Interactive Mode'.
>>>>>>>>>>>
>>>>>>>>>>> https://docs.python.org/2/library/cmd.html
>>>>>>>>>>>
>>>>>>>>>>> Licence: https://docs.python.org/2/license.html
>>>>>>>>>>> GPL compatible
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> *cmd2 *(9/10)
>>>>>>>>>>> Extends the Python Standard Library’s cmd package.  Can handle
>>>>>>>>>>> arguments and flags.  Supports for Output Redirection and Piping ( As in a
>>>>>>>>>>> Unix shell ). Searchable command history (  bash-like history list editing
>>>>>>>>>>> ), can get last commands with arrow keys. Able to perform shell commands
>>>>>>>>>>> while in Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output
>>>>>>>>>>> can be colored.
>>>>>>>>>>>
>>>>>>>>>>> https://pythonhosted.org/cmd2
>>>>>>>>>>>
>>>>>>>>>>> Licence: https://pypi.python.org/pypi/cmd2/0.6.8
>>>>>>>>>>> MIT License
>>>>>>>>>>>
>>>>>>>>>>> On Wed, Feb 25, 2015 at 10:29 AM, Chamila De Alwis <
>>>>>>>>>>> chamilad@wso2.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Great work Milindu. It would be better to add the licenses for
>>>>>>>>>>>> each library too, in case any non-compatible or ambiguous ones might be
>>>>>>>>>>>> there.
>>>>>>>>>>>>
>>>>>>>>>>>> IMO using a framework from the standard library would be
>>>>>>>>>>>> better, since the pre-requisites will be minimal.
>>>>>>>>>>>> On Feb 25, 2015 9:55 AM, "Milindu Sanoj Kumarage" <
>>>>>>>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Here is the JIRA issue on this,
>>>>>>>>>>>>> https://issues.apache.org/jira/browse/STRATOS-1187
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Here I have added some of the Python CLI frameworks I checked,
>>>>>>>>>>>>> I have added a brief for each of them. I also have state a score out of 10
>>>>>>>>>>>>> to indicate how best they matches for our need. ( But they are as of my
>>>>>>>>>>>>> understanding! I may not be very correct in some cases.  Because some of
>>>>>>>>>>>>> the ones I could write some codes and check, but for some I could not,
>>>>>>>>>>>>> manly because of errors )
>>>>>>>>>>>>>
>>>>>>>>>>>>> *Cement *(6/10)
>>>>>>>>>>>>> A complex framework, every CLI commands is bound to a separate
>>>>>>>>>>>>> Python class that acts like an controller, and each controller have several
>>>>>>>>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>>>>>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>>>>>>>>>>>> via aliases. But no much developments in Github repo recently.
>>>>>>>>>>>>>
>>>>>>>>>>>>> http://cement.readthedocs.org/
>>>>>>>>>>>>>
>>>>>>>>>>>>> *Click *(7/10)
>>>>>>>>>>>>> Rich with features, uses Python Decorators to bind CLI
>>>>>>>>>>>>> commands to functions. But no 'Interactive Mode' support, just 'Single
>>>>>>>>>>>>> command line mode'.
>>>>>>>>>>>>>
>>>>>>>>>>>>> http://click.pocoo.org/3/
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> *Plac *(4/10)
>>>>>>>>>>>>> A scaled down version of Python argparse package.  Uses set of
>>>>>>>>>>>>> if else statements to process the commands. But no 'Interactive Mode'
>>>>>>>>>>>>> support.
>>>>>>>>>>>>>
>>>>>>>>>>>>> http://plac.googlecode.com/hg/doc/plac.html
>>>>>>>>>>>>>
>>>>>>>>>>>>> *Cliapp *(3/10)
>>>>>>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>>>>>>
>>>>>>>>>>>>> http://code.liw.fi/cliapp/docs/
>>>>>>>>>>>>>
>>>>>>>>>>>>> *pyCLI  *(3/10)
>>>>>>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>>>>>>
>>>>>>>>>>>>> http://pythonhosted.org//pyCLI/
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> *Cliff *(9/10)
>>>>>>>>>>>>> A framework for building command line programs by OpenStack.
>>>>>>>>>>>>> It uses plugins to define sub-commands, output formatters, and other
>>>>>>>>>>>>> extensions.
>>>>>>>>>>>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>>>>>>>>>>>
>>>>>>>>>>>>> http://docs.openstack.org/developer/cliff/index.html
>>>>>>>>>>>>>
>>>>>>>>>>>>> *cmd *(8/10)
>>>>>>>>>>>>> Python in built packages for 'Interactive Mode' applications.
>>>>>>>>>>>>> Maps CLI commands to functions by function name, as def
>>>>>>>>>>>>> do_<whatever the command name> ( eg: def do_command1 is for
>>>>>>>>>>>>> command1 ). Support only arguments but no support for Unix-style flags.
>>>>>>>>>>>>> Have features like automatic command completion in 'Interactive Mode'.
>>>>>>>>>>>>>
>>>>>>>>>>>>> https://docs.python.org/2/library/cmd.html
>>>>>>>>>>>>>
>>>>>>>>>>>>> *cmd2 *(9/10)
>>>>>>>>>>>>> Extends the Python Standard Library’s cmd package.  Can handle
>>>>>>>>>>>>> arguments and flags.  Supports for Output Redirection and Piping ( As in a
>>>>>>>>>>>>> Unix shell ). Searchable command history (  bash-like history list editing
>>>>>>>>>>>>> ), can get last commands with arrow keys. Able to perform shell commands
>>>>>>>>>>>>> while in Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output
>>>>>>>>>>>>> can be colored.
>>>>>>>>>>>>>
>>>>>>>>>>>>> https://pythonhosted.org/cmd2
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Imesh Gunaratne
>>>>>>>>>
>>>>>>>>> Technical Lead, WSO2
>>>>>>>>> Committer & PMC Member, Apache Stratos
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Imesh Gunaratne
>>>>>>
>>>>>> Technical Lead, WSO2
>>>>>> Committer & PMC Member, Apache Stratos
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Imesh Gunaratne
>>>>
>>>> Technical Lead, WSO2
>>>> Committer & PMC Member, Apache Stratos
>>>>
>>>
>>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PMC Member, Apache Stratos
>>
>
>


-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: GSoC 2015

Posted by Milindu Sanoj Kumarage <ag...@gmail.com>.
Hi,

I started writing the proposal, here I have attached it. I would be
thankful if you can help me improve it.
​
 Proposal : Python based Command Line Tool (CLI) for Stratos
<https://docs.google.com/document/d/1ORkVPtFnJQi6szswKaim8ZCIKMHi3d3eCVOuA18GOG4/edit?usp=drive_web>
​

On Wed, Mar 11, 2015 at 12:57 AM, Imesh Gunaratne <im...@apache.org> wrote:

> Hi Milindu,
>
> Yes you seems to be on track. Please use Kubernetes getting started guide
> here:
> https://gist.github.com/imesh/b8f81fac8de39183a504
>
> Thanks
>
>
> On Mon, Mar 9, 2015 at 8:22 PM, Milindu Sanoj Kumarage <
> agentmilindu@gmail.com> wrote:
>
>> Hi,
>>
>> I could fix that "-" problem, everything is now works exactly as Java
>> CLI. I think I can do a demo app with some functionality, then we can
>> discuss further, right?
>>
>> And I'm currently setting up the Stratos on my machine, it seems setting
>> up  OpenStack ( DevStack ) is not easy, I found that Kubernetes Vagrant
>> Setup, trying it, and seems it is working fine. Going on that path would
>> not  be a problem, right?
>>
>>
>>
>> On Fri, Mar 6, 2015 at 9:37 AM, Imesh Gunaratne <im...@apache.org> wrote:
>>
>>> Great! Nice to hear that. We might not need to use "_", it would be
>>> better if auto completion could also use commands with "-" pattern.
>>>
>>> At the moment we do not have much client side validations, most of them
>>> are done in server. You could refer [1] for this.
>>>
>>> [1] https://cwiki.apache.org/confluence/display/STRATOS/4.1.0+CLI+Guide
>>>
>>> On Thu, Mar 5, 2015 at 6:23 PM, Milindu Sanoj Kumarage <
>>> agentmilindu@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> With this workaround ( actually it is not a workaround, Cmd2 really has
>>>> aliases feature! but in different name ) we can have both "list-tenants"
>>>> and "list_tenants" working without a problem. Therefor the  Single
>>>> command line mode would work exactly like the Java CLI, and also the
>>>> Interactive mode. But in Interactive mode, auto-complete still  suggests "
>>>> list_tenants" instead of "list-tenants". we can change that too if you
>>>> really need, but needs some alternations that may not be very beautiful,
>>>> but not ugly too.
>>>>
>>>> one more question, we have to validate the parameters before sending to
>>>> the REST API, right? Do we have any document for these validations, or is
>>>> it the codes I have to follow?
>>>>
>>>>
>>>>
>>>> On Thu, Mar 5, 2015 at 3:50 AM, Imesh Gunaratne <im...@apache.org>
>>>> wrote:
>>>>
>>>>> Hi Milindu,
>>>>>
>>>>> Great work! We will have a look at this and get back to you. In the
>>>>> mean time can you provide some details on this sample?
>>>>>
>>>>> Thanks
>>>>>
>>>>> On Thu, Mar 5, 2015 at 12:12 AM, Milindu Sanoj Kumarage <
>>>>> agentmilindu@gmail.com> wrote:
>>>>>
>>>>>> Hi,
>>>>>> I spend last few days investigating a workarounds to solve that '-'
>>>>>> problem :) It seems it is possible.
>>>>>>
>>>>>> BTW, I checked the possibility of uploading the final product to Pip
>>>>>> where anyone can  install Stratos CLI using Pip like
>>>>>> $Pip install stratos
>>>>>>
>>>>>> and then run like
>>>>>>
>>>>>> $ stratos -u abcdef
>>>>>>
>>>>>> What's your idea on that? ( We can also provide python script with a
>>>>>> wrapper for Windows and Linux  )
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Fri, Feb 27, 2015 at 9:45 PM, Milindu Sanoj Kumarage <
>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> the reason is  Cmd2 ( and most of the python CLI frameworks ) uses
>>>>>>> function mapping to CLI commands, that is,
>>>>>>>
>>>>>>> // stratos>greet
>>>>>>> def do_greet():
>>>>>>>     print("hi")
>>>>>>>
>>>>>>> will become the 'greet' command.
>>>>>>>
>>>>>>> But if we need,
>>>>>>>
>>>>>>> 'list-tenants' we have to code it as
>>>>>>>
>>>>>>> def do_list-tenants:
>>>>>>>    #codes of list tenant command
>>>>>>>
>>>>>>> But using '-' in names of functions ( def*enitions* ) in Python is
>>>>>>> not allowed.
>>>>>>> What shall we do? I'm okay even to write it from the scratch.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Feb 27, 2015 at 9:29 PM, Imesh Gunaratne <im...@apache.org>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi Milindu,
>>>>>>>>
>>>>>>>> Is there any way of using "-" in the CLI commands. I did not get
>>>>>>>> why a CLI framework would block "-" character.
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>>
>>>>>>>> On Fri, Feb 27, 2015 at 2:49 PM, Milindu Sanoj Kumarage <
>>>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> Then shall we go with Cmd2 python package? Only change we have to
>>>>>>>>> do is call CLI commands with '_ '  instead '-', like 'list_tenants' instead
>>>>>>>>> of 'list-tenants'.
>>>>>>>>>
>>>>>>>>> And for HTTP request/response handling,  we can use either
>>>>>>>>> Python's urllib3 or Requests, a wrapper around urllib3 which gives much
>>>>>>>>> simpler API that leads to  cleaner codes. It's been praised in the
>>>>>>>>> community from the beginning.
>>>>>>>>>
>>>>>>>>> Licence: Apache2
>>>>>>>>>
>>>>>>>>> http://docs.python-requests.org/en/latest/#
>>>>>>>>>
>>>>>>>>> On Wed, Feb 25, 2015 at 3:26 PM, Milindu Sanoj Kumarage <
>>>>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> Here I have included the licences of each framework :)
>>>>>>>>>>
>>>>>>>>>> *Cement *(6/10)
>>>>>>>>>> A complex framework, every CLI commands is bound to a separate
>>>>>>>>>> Python class that acts like an controller, and each controller have several
>>>>>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>>>>>>>>> via aliases. But no much developments in Github repo recently.
>>>>>>>>>>
>>>>>>>>>> http://cement.readthedocs.org/
>>>>>>>>>>
>>>>>>>>>> Licence : http://cement.readthedocs.org/en/latest/license/
>>>>>>>>>> Redistribution and use in source and binary forms, with or
>>>>>>>>>> without modification, are permitted under given conditions.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> *Click *(7/10)
>>>>>>>>>> Rich with features, uses Python Decorators to bind CLI commands
>>>>>>>>>> to functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>>>> mode'.
>>>>>>>>>>
>>>>>>>>>> http://click.pocoo.org/3/
>>>>>>>>>>
>>>>>>>>>> Licence :  http://click.pocoo.org/3/license/
>>>>>>>>>>  three-clause BSD License
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> *Plac *(4/10)
>>>>>>>>>> A scaled down version of Python argparse package.  Uses set of if
>>>>>>>>>> else statements to process the commands. But no 'Interactive Mode' support.
>>>>>>>>>>
>>>>>>>>>> http://plac.googlecode.com/hg/doc/plac.html
>>>>>>>>>>
>>>>>>>>>> Licence: http://plac.googlecode.com/hg/doc/plac.html
>>>>>>>>>> BSD license
>>>>>>>>>>
>>>>>>>>>> *Cliapp *(3/10)
>>>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>>>
>>>>>>>>>> http://code.liw.fi/cliapp/docs/
>>>>>>>>>>
>>>>>>>>>> Licence : https://github.com/rshk/CliApp/blob/master/LICENSE
>>>>>>>>>> Apache License
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> *pyCLI  *(3/10)
>>>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>>>
>>>>>>>>>> http://pythonhosted.org//pyCLI/
>>>>>>>>>>
>>>>>>>>>> Licence: http://sourceforge.net/projects/pycli/
>>>>>>>>>> GNU General Public License version 2.0 (GPLv2)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> *Cliff *(9/10)
>>>>>>>>>> A framework for building command line programs by OpenStack. It
>>>>>>>>>> uses plugins to define sub-commands, output formatters, and other
>>>>>>>>>> extensions.
>>>>>>>>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>>>>>>>>
>>>>>>>>>> http://docs.openstack.org/developer/cliff/index.html
>>>>>>>>>>
>>>>>>>>>> Licence: https://launchpad.net/python-cliff
>>>>>>>>>> Apache Licence
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> *cmd *(8/10)
>>>>>>>>>> Python in built packages for 'Interactive Mode' applications.
>>>>>>>>>> Maps CLI commands to functions by function name, as def
>>>>>>>>>> do_<whatever the command name> ( eg: def do_command1 is for
>>>>>>>>>> command1 ). Support only arguments but no support for Unix-style flags.
>>>>>>>>>> Have features like automatic command completion in 'Interactive Mode'.
>>>>>>>>>>
>>>>>>>>>> https://docs.python.org/2/library/cmd.html
>>>>>>>>>>
>>>>>>>>>> Licence: https://docs.python.org/2/license.html
>>>>>>>>>> GPL compatible
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> *cmd2 *(9/10)
>>>>>>>>>> Extends the Python Standard Library’s cmd package.  Can handle
>>>>>>>>>> arguments and flags.  Supports for Output Redirection and Piping ( As in a
>>>>>>>>>> Unix shell ). Searchable command history (  bash-like history list editing
>>>>>>>>>> ), can get last commands with arrow keys. Able to perform shell commands
>>>>>>>>>> while in Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output
>>>>>>>>>> can be colored.
>>>>>>>>>>
>>>>>>>>>> https://pythonhosted.org/cmd2
>>>>>>>>>>
>>>>>>>>>> Licence: https://pypi.python.org/pypi/cmd2/0.6.8
>>>>>>>>>> MIT License
>>>>>>>>>>
>>>>>>>>>> On Wed, Feb 25, 2015 at 10:29 AM, Chamila De Alwis <
>>>>>>>>>> chamilad@wso2.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> Great work Milindu. It would be better to add the licenses for
>>>>>>>>>>> each library too, in case any non-compatible or ambiguous ones might be
>>>>>>>>>>> there.
>>>>>>>>>>>
>>>>>>>>>>> IMO using a framework from the standard library would be better,
>>>>>>>>>>> since the pre-requisites will be minimal.
>>>>>>>>>>> On Feb 25, 2015 9:55 AM, "Milindu Sanoj Kumarage" <
>>>>>>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Hi,
>>>>>>>>>>>>
>>>>>>>>>>>> Here is the JIRA issue on this,
>>>>>>>>>>>> https://issues.apache.org/jira/browse/STRATOS-1187
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Here I have added some of the Python CLI frameworks I checked,
>>>>>>>>>>>> I have added a brief for each of them. I also have state a score out of 10
>>>>>>>>>>>> to indicate how best they matches for our need. ( But they are as of my
>>>>>>>>>>>> understanding! I may not be very correct in some cases.  Because some of
>>>>>>>>>>>> the ones I could write some codes and check, but for some I could not,
>>>>>>>>>>>> manly because of errors )
>>>>>>>>>>>>
>>>>>>>>>>>> *Cement *(6/10)
>>>>>>>>>>>> A complex framework, every CLI commands is bound to a separate
>>>>>>>>>>>> Python class that acts like an controller, and each controller have several
>>>>>>>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>>>>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>>>>>>>>>>> via aliases. But no much developments in Github repo recently.
>>>>>>>>>>>>
>>>>>>>>>>>> http://cement.readthedocs.org/
>>>>>>>>>>>>
>>>>>>>>>>>> *Click *(7/10)
>>>>>>>>>>>> Rich with features, uses Python Decorators to bind CLI commands
>>>>>>>>>>>> to functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>>>>>> mode'.
>>>>>>>>>>>>
>>>>>>>>>>>> http://click.pocoo.org/3/
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> *Plac *(4/10)
>>>>>>>>>>>> A scaled down version of Python argparse package.  Uses set of
>>>>>>>>>>>> if else statements to process the commands. But no 'Interactive Mode'
>>>>>>>>>>>> support.
>>>>>>>>>>>>
>>>>>>>>>>>> http://plac.googlecode.com/hg/doc/plac.html
>>>>>>>>>>>>
>>>>>>>>>>>> *Cliapp *(3/10)
>>>>>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>>>>>
>>>>>>>>>>>> http://code.liw.fi/cliapp/docs/
>>>>>>>>>>>>
>>>>>>>>>>>> *pyCLI  *(3/10)
>>>>>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>>>>>
>>>>>>>>>>>> http://pythonhosted.org//pyCLI/
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> *Cliff *(9/10)
>>>>>>>>>>>> A framework for building command line programs by OpenStack. It
>>>>>>>>>>>> uses plugins to define sub-commands, output formatters, and other
>>>>>>>>>>>> extensions.
>>>>>>>>>>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>>>>>>>>>>
>>>>>>>>>>>> http://docs.openstack.org/developer/cliff/index.html
>>>>>>>>>>>>
>>>>>>>>>>>> *cmd *(8/10)
>>>>>>>>>>>> Python in built packages for 'Interactive Mode' applications.
>>>>>>>>>>>> Maps CLI commands to functions by function name, as def
>>>>>>>>>>>> do_<whatever the command name> ( eg: def do_command1 is for
>>>>>>>>>>>> command1 ). Support only arguments but no support for Unix-style flags.
>>>>>>>>>>>> Have features like automatic command completion in 'Interactive Mode'.
>>>>>>>>>>>>
>>>>>>>>>>>> https://docs.python.org/2/library/cmd.html
>>>>>>>>>>>>
>>>>>>>>>>>> *cmd2 *(9/10)
>>>>>>>>>>>> Extends the Python Standard Library’s cmd package.  Can handle
>>>>>>>>>>>> arguments and flags.  Supports for Output Redirection and Piping ( As in a
>>>>>>>>>>>> Unix shell ). Searchable command history (  bash-like history list editing
>>>>>>>>>>>> ), can get last commands with arrow keys. Able to perform shell commands
>>>>>>>>>>>> while in Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output
>>>>>>>>>>>> can be colored.
>>>>>>>>>>>>
>>>>>>>>>>>> https://pythonhosted.org/cmd2
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Imesh Gunaratne
>>>>>>>>
>>>>>>>> Technical Lead, WSO2
>>>>>>>> Committer & PMC Member, Apache Stratos
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Imesh Gunaratne
>>>>>
>>>>> Technical Lead, WSO2
>>>>> Committer & PMC Member, Apache Stratos
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Technical Lead, WSO2
>>> Committer & PMC Member, Apache Stratos
>>>
>>
>>
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>

Re: GSoC 2015

Posted by Imesh Gunaratne <im...@apache.org>.
Hi Milindu,

Yes you seems to be on track. Please use Kubernetes getting started guide
here:
https://gist.github.com/imesh/b8f81fac8de39183a504

Thanks


On Mon, Mar 9, 2015 at 8:22 PM, Milindu Sanoj Kumarage <
agentmilindu@gmail.com> wrote:

> Hi,
>
> I could fix that "-" problem, everything is now works exactly as Java CLI.
> I think I can do a demo app with some functionality, then we can discuss
> further, right?
>
> And I'm currently setting up the Stratos on my machine, it seems setting
> up  OpenStack ( DevStack ) is not easy, I found that Kubernetes Vagrant
> Setup, trying it, and seems it is working fine. Going on that path would
> not  be a problem, right?
>
>
>
> On Fri, Mar 6, 2015 at 9:37 AM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> Great! Nice to hear that. We might not need to use "_", it would be
>> better if auto completion could also use commands with "-" pattern.
>>
>> At the moment we do not have much client side validations, most of them
>> are done in server. You could refer [1] for this.
>>
>> [1] https://cwiki.apache.org/confluence/display/STRATOS/4.1.0+CLI+Guide
>>
>> On Thu, Mar 5, 2015 at 6:23 PM, Milindu Sanoj Kumarage <
>> agentmilindu@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> With this workaround ( actually it is not a workaround, Cmd2 really has
>>> aliases feature! but in different name ) we can have both "list-tenants"
>>> and "list_tenants" working without a problem. Therefor the  Single
>>> command line mode would work exactly like the Java CLI, and also the
>>> Interactive mode. But in Interactive mode, auto-complete still  suggests "
>>> list_tenants" instead of "list-tenants". we can change that too if you
>>> really need, but needs some alternations that may not be very beautiful,
>>> but not ugly too.
>>>
>>> one more question, we have to validate the parameters before sending to
>>> the REST API, right? Do we have any document for these validations, or is
>>> it the codes I have to follow?
>>>
>>>
>>>
>>> On Thu, Mar 5, 2015 at 3:50 AM, Imesh Gunaratne <im...@apache.org>
>>> wrote:
>>>
>>>> Hi Milindu,
>>>>
>>>> Great work! We will have a look at this and get back to you. In the
>>>> mean time can you provide some details on this sample?
>>>>
>>>> Thanks
>>>>
>>>> On Thu, Mar 5, 2015 at 12:12 AM, Milindu Sanoj Kumarage <
>>>> agentmilindu@gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>> I spend last few days investigating a workarounds to solve that '-'
>>>>> problem :) It seems it is possible.
>>>>>
>>>>> BTW, I checked the possibility of uploading the final product to Pip
>>>>> where anyone can  install Stratos CLI using Pip like
>>>>> $Pip install stratos
>>>>>
>>>>> and then run like
>>>>>
>>>>> $ stratos -u abcdef
>>>>>
>>>>> What's your idea on that? ( We can also provide python script with a
>>>>> wrapper for Windows and Linux  )
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Feb 27, 2015 at 9:45 PM, Milindu Sanoj Kumarage <
>>>>> agentmilindu@gmail.com> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> the reason is  Cmd2 ( and most of the python CLI frameworks ) uses
>>>>>> function mapping to CLI commands, that is,
>>>>>>
>>>>>> // stratos>greet
>>>>>> def do_greet():
>>>>>>     print("hi")
>>>>>>
>>>>>> will become the 'greet' command.
>>>>>>
>>>>>> But if we need,
>>>>>>
>>>>>> 'list-tenants' we have to code it as
>>>>>>
>>>>>> def do_list-tenants:
>>>>>>    #codes of list tenant command
>>>>>>
>>>>>> But using '-' in names of functions ( def*enitions* ) in Python is
>>>>>> not allowed.
>>>>>> What shall we do? I'm okay even to write it from the scratch.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Fri, Feb 27, 2015 at 9:29 PM, Imesh Gunaratne <im...@apache.org>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi Milindu,
>>>>>>>
>>>>>>> Is there any way of using "-" in the CLI commands. I did not get why
>>>>>>> a CLI framework would block "-" character.
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>> On Fri, Feb 27, 2015 at 2:49 PM, Milindu Sanoj Kumarage <
>>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Then shall we go with Cmd2 python package? Only change we have to
>>>>>>>> do is call CLI commands with '_ '  instead '-', like 'list_tenants' instead
>>>>>>>> of 'list-tenants'.
>>>>>>>>
>>>>>>>> And for HTTP request/response handling,  we can use either Python's
>>>>>>>> urllib3 or Requests, a wrapper around urllib3 which gives much simpler API
>>>>>>>> that leads to  cleaner codes. It's been praised in the community from the
>>>>>>>> beginning.
>>>>>>>>
>>>>>>>> Licence: Apache2
>>>>>>>>
>>>>>>>> http://docs.python-requests.org/en/latest/#
>>>>>>>>
>>>>>>>> On Wed, Feb 25, 2015 at 3:26 PM, Milindu Sanoj Kumarage <
>>>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> Here I have included the licences of each framework :)
>>>>>>>>>
>>>>>>>>> *Cement *(6/10)
>>>>>>>>> A complex framework, every CLI commands is bound to a separate
>>>>>>>>> Python class that acts like an controller, and each controller have several
>>>>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>>>>>>>> via aliases. But no much developments in Github repo recently.
>>>>>>>>>
>>>>>>>>> http://cement.readthedocs.org/
>>>>>>>>>
>>>>>>>>> Licence : http://cement.readthedocs.org/en/latest/license/
>>>>>>>>> Redistribution and use in source and binary forms, with or without
>>>>>>>>> modification, are permitted under given conditions.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> *Click *(7/10)
>>>>>>>>> Rich with features, uses Python Decorators to bind CLI commands to
>>>>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>>> mode'.
>>>>>>>>>
>>>>>>>>> http://click.pocoo.org/3/
>>>>>>>>>
>>>>>>>>> Licence :  http://click.pocoo.org/3/license/
>>>>>>>>>  three-clause BSD License
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> *Plac *(4/10)
>>>>>>>>> A scaled down version of Python argparse package.  Uses set of if
>>>>>>>>> else statements to process the commands. But no 'Interactive Mode' support.
>>>>>>>>>
>>>>>>>>> http://plac.googlecode.com/hg/doc/plac.html
>>>>>>>>>
>>>>>>>>> Licence: http://plac.googlecode.com/hg/doc/plac.html
>>>>>>>>> BSD license
>>>>>>>>>
>>>>>>>>> *Cliapp *(3/10)
>>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>>
>>>>>>>>> http://code.liw.fi/cliapp/docs/
>>>>>>>>>
>>>>>>>>> Licence : https://github.com/rshk/CliApp/blob/master/LICENSE
>>>>>>>>> Apache License
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> *pyCLI  *(3/10)
>>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>>
>>>>>>>>> http://pythonhosted.org//pyCLI/
>>>>>>>>>
>>>>>>>>> Licence: http://sourceforge.net/projects/pycli/
>>>>>>>>> GNU General Public License version 2.0 (GPLv2)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> *Cliff *(9/10)
>>>>>>>>> A framework for building command line programs by OpenStack. It
>>>>>>>>> uses plugins to define sub-commands, output formatters, and other
>>>>>>>>> extensions.
>>>>>>>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>>>>>>>
>>>>>>>>> http://docs.openstack.org/developer/cliff/index.html
>>>>>>>>>
>>>>>>>>> Licence: https://launchpad.net/python-cliff
>>>>>>>>> Apache Licence
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> *cmd *(8/10)
>>>>>>>>> Python in built packages for 'Interactive Mode' applications. Maps
>>>>>>>>> CLI commands to functions by function name, as def do_<whatever
>>>>>>>>> the command name> ( eg: def do_command1 is for command1 ).
>>>>>>>>> Support only arguments but no support for Unix-style flags. Have features
>>>>>>>>> like automatic command completion in 'Interactive Mode'.
>>>>>>>>>
>>>>>>>>> https://docs.python.org/2/library/cmd.html
>>>>>>>>>
>>>>>>>>> Licence: https://docs.python.org/2/license.html
>>>>>>>>> GPL compatible
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> *cmd2 *(9/10)
>>>>>>>>> Extends the Python Standard Library’s cmd package.  Can handle
>>>>>>>>> arguments and flags.  Supports for Output Redirection and Piping ( As in a
>>>>>>>>> Unix shell ). Searchable command history (  bash-like history list editing
>>>>>>>>> ), can get last commands with arrow keys. Able to perform shell commands
>>>>>>>>> while in Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output
>>>>>>>>> can be colored.
>>>>>>>>>
>>>>>>>>> https://pythonhosted.org/cmd2
>>>>>>>>>
>>>>>>>>> Licence: https://pypi.python.org/pypi/cmd2/0.6.8
>>>>>>>>> MIT License
>>>>>>>>>
>>>>>>>>> On Wed, Feb 25, 2015 at 10:29 AM, Chamila De Alwis <
>>>>>>>>> chamilad@wso2.com> wrote:
>>>>>>>>>
>>>>>>>>>> Great work Milindu. It would be better to add the licenses for
>>>>>>>>>> each library too, in case any non-compatible or ambiguous ones might be
>>>>>>>>>> there.
>>>>>>>>>>
>>>>>>>>>> IMO using a framework from the standard library would be better,
>>>>>>>>>> since the pre-requisites will be minimal.
>>>>>>>>>> On Feb 25, 2015 9:55 AM, "Milindu Sanoj Kumarage" <
>>>>>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> Here is the JIRA issue on this,
>>>>>>>>>>> https://issues.apache.org/jira/browse/STRATOS-1187
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Here I have added some of the Python CLI frameworks I checked, I
>>>>>>>>>>> have added a brief for each of them. I also have state a score out of 10 to
>>>>>>>>>>> indicate how best they matches for our need. ( But they are as of my
>>>>>>>>>>> understanding! I may not be very correct in some cases.  Because some of
>>>>>>>>>>> the ones I could write some codes and check, but for some I could not,
>>>>>>>>>>> manly because of errors )
>>>>>>>>>>>
>>>>>>>>>>> *Cement *(6/10)
>>>>>>>>>>> A complex framework, every CLI commands is bound to a separate
>>>>>>>>>>> Python class that acts like an controller, and each controller have several
>>>>>>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>>>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>>>>>>>>>> via aliases. But no much developments in Github repo recently.
>>>>>>>>>>>
>>>>>>>>>>> http://cement.readthedocs.org/
>>>>>>>>>>>
>>>>>>>>>>> *Click *(7/10)
>>>>>>>>>>> Rich with features, uses Python Decorators to bind CLI commands
>>>>>>>>>>> to functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>>>>> mode'.
>>>>>>>>>>>
>>>>>>>>>>> http://click.pocoo.org/3/
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> *Plac *(4/10)
>>>>>>>>>>> A scaled down version of Python argparse package.  Uses set of
>>>>>>>>>>> if else statements to process the commands. But no 'Interactive Mode'
>>>>>>>>>>> support.
>>>>>>>>>>>
>>>>>>>>>>> http://plac.googlecode.com/hg/doc/plac.html
>>>>>>>>>>>
>>>>>>>>>>> *Cliapp *(3/10)
>>>>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>>>>
>>>>>>>>>>> http://code.liw.fi/cliapp/docs/
>>>>>>>>>>>
>>>>>>>>>>> *pyCLI  *(3/10)
>>>>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>>>>
>>>>>>>>>>> http://pythonhosted.org//pyCLI/
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> *Cliff *(9/10)
>>>>>>>>>>> A framework for building command line programs by OpenStack. It
>>>>>>>>>>> uses plugins to define sub-commands, output formatters, and other
>>>>>>>>>>> extensions.
>>>>>>>>>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>>>>>>>>>
>>>>>>>>>>> http://docs.openstack.org/developer/cliff/index.html
>>>>>>>>>>>
>>>>>>>>>>> *cmd *(8/10)
>>>>>>>>>>> Python in built packages for 'Interactive Mode' applications.
>>>>>>>>>>> Maps CLI commands to functions by function name, as def
>>>>>>>>>>> do_<whatever the command name> ( eg: def do_command1 is for
>>>>>>>>>>> command1 ). Support only arguments but no support for Unix-style flags.
>>>>>>>>>>> Have features like automatic command completion in 'Interactive Mode'.
>>>>>>>>>>>
>>>>>>>>>>> https://docs.python.org/2/library/cmd.html
>>>>>>>>>>>
>>>>>>>>>>> *cmd2 *(9/10)
>>>>>>>>>>> Extends the Python Standard Library’s cmd package.  Can handle
>>>>>>>>>>> arguments and flags.  Supports for Output Redirection and Piping ( As in a
>>>>>>>>>>> Unix shell ). Searchable command history (  bash-like history list editing
>>>>>>>>>>> ), can get last commands with arrow keys. Able to perform shell commands
>>>>>>>>>>> while in Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output
>>>>>>>>>>> can be colored.
>>>>>>>>>>>
>>>>>>>>>>> https://pythonhosted.org/cmd2
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Imesh Gunaratne
>>>>>>>
>>>>>>> Technical Lead, WSO2
>>>>>>> Committer & PMC Member, Apache Stratos
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Imesh Gunaratne
>>>>
>>>> Technical Lead, WSO2
>>>> Committer & PMC Member, Apache Stratos
>>>>
>>>
>>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PMC Member, Apache Stratos
>>
>
>


-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: GSoC 2015

Posted by Milindu Sanoj Kumarage <ag...@gmail.com>.
Hi,

I could fix that "-" problem, everything is now works exactly as Java CLI.
I think I can do a demo app with some functionality, then we can discuss
further, right?

And I'm currently setting up the Stratos on my machine, it seems setting up
 OpenStack ( DevStack ) is not easy, I found that Kubernetes Vagrant Setup,
trying it, and seems it is working fine. Going on that path would not  be a
problem, right?



On Fri, Mar 6, 2015 at 9:37 AM, Imesh Gunaratne <im...@apache.org> wrote:

> Great! Nice to hear that. We might not need to use "_", it would be better
> if auto completion could also use commands with "-" pattern.
>
> At the moment we do not have much client side validations, most of them
> are done in server. You could refer [1] for this.
>
> [1] https://cwiki.apache.org/confluence/display/STRATOS/4.1.0+CLI+Guide
>
> On Thu, Mar 5, 2015 at 6:23 PM, Milindu Sanoj Kumarage <
> agentmilindu@gmail.com> wrote:
>
>> Hi,
>>
>> With this workaround ( actually it is not a workaround, Cmd2 really has
>> aliases feature! but in different name ) we can have both "list-tenants"
>> and "list_tenants" working without a problem. Therefor the  Single
>> command line mode would work exactly like the Java CLI, and also the
>> Interactive mode. But in Interactive mode, auto-complete still  suggests "
>> list_tenants" instead of "list-tenants". we can change that too if you
>> really need, but needs some alternations that may not be very beautiful,
>> but not ugly too.
>>
>> one more question, we have to validate the parameters before sending to
>> the REST API, right? Do we have any document for these validations, or is
>> it the codes I have to follow?
>>
>>
>>
>> On Thu, Mar 5, 2015 at 3:50 AM, Imesh Gunaratne <im...@apache.org> wrote:
>>
>>> Hi Milindu,
>>>
>>> Great work! We will have a look at this and get back to you. In the mean
>>> time can you provide some details on this sample?
>>>
>>> Thanks
>>>
>>> On Thu, Mar 5, 2015 at 12:12 AM, Milindu Sanoj Kumarage <
>>> agentmilindu@gmail.com> wrote:
>>>
>>>> Hi,
>>>> I spend last few days investigating a workarounds to solve that '-'
>>>> problem :) It seems it is possible.
>>>>
>>>> BTW, I checked the possibility of uploading the final product to Pip
>>>> where anyone can  install Stratos CLI using Pip like
>>>> $Pip install stratos
>>>>
>>>> and then run like
>>>>
>>>> $ stratos -u abcdef
>>>>
>>>> What's your idea on that? ( We can also provide python script with a
>>>> wrapper for Windows and Linux  )
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Fri, Feb 27, 2015 at 9:45 PM, Milindu Sanoj Kumarage <
>>>> agentmilindu@gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> the reason is  Cmd2 ( and most of the python CLI frameworks ) uses
>>>>> function mapping to CLI commands, that is,
>>>>>
>>>>> // stratos>greet
>>>>> def do_greet():
>>>>>     print("hi")
>>>>>
>>>>> will become the 'greet' command.
>>>>>
>>>>> But if we need,
>>>>>
>>>>> 'list-tenants' we have to code it as
>>>>>
>>>>> def do_list-tenants:
>>>>>    #codes of list tenant command
>>>>>
>>>>> But using '-' in names of functions ( def*enitions* ) in Python is
>>>>> not allowed.
>>>>> What shall we do? I'm okay even to write it from the scratch.
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Feb 27, 2015 at 9:29 PM, Imesh Gunaratne <im...@apache.org>
>>>>> wrote:
>>>>>
>>>>>> Hi Milindu,
>>>>>>
>>>>>> Is there any way of using "-" in the CLI commands. I did not get why
>>>>>> a CLI framework would block "-" character.
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> On Fri, Feb 27, 2015 at 2:49 PM, Milindu Sanoj Kumarage <
>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Then shall we go with Cmd2 python package? Only change we have to do
>>>>>>> is call CLI commands with '_ '  instead '-', like 'list_tenants' instead of
>>>>>>> 'list-tenants'.
>>>>>>>
>>>>>>> And for HTTP request/response handling,  we can use either Python's
>>>>>>> urllib3 or Requests, a wrapper around urllib3 which gives much simpler API
>>>>>>> that leads to  cleaner codes. It's been praised in the community from the
>>>>>>> beginning.
>>>>>>>
>>>>>>> Licence: Apache2
>>>>>>>
>>>>>>> http://docs.python-requests.org/en/latest/#
>>>>>>>
>>>>>>> On Wed, Feb 25, 2015 at 3:26 PM, Milindu Sanoj Kumarage <
>>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Here I have included the licences of each framework :)
>>>>>>>>
>>>>>>>> *Cement *(6/10)
>>>>>>>> A complex framework, every CLI commands is bound to a separate
>>>>>>>> Python class that acts like an controller, and each controller have several
>>>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>>>>>>> via aliases. But no much developments in Github repo recently.
>>>>>>>>
>>>>>>>> http://cement.readthedocs.org/
>>>>>>>>
>>>>>>>> Licence : http://cement.readthedocs.org/en/latest/license/
>>>>>>>> Redistribution and use in source and binary forms, with or without
>>>>>>>> modification, are permitted under given conditions.
>>>>>>>>
>>>>>>>>
>>>>>>>> *Click *(7/10)
>>>>>>>> Rich with features, uses Python Decorators to bind CLI commands to
>>>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>> mode'.
>>>>>>>>
>>>>>>>> http://click.pocoo.org/3/
>>>>>>>>
>>>>>>>> Licence :  http://click.pocoo.org/3/license/
>>>>>>>>  three-clause BSD License
>>>>>>>>
>>>>>>>>
>>>>>>>> *Plac *(4/10)
>>>>>>>> A scaled down version of Python argparse package.  Uses set of if
>>>>>>>> else statements to process the commands. But no 'Interactive Mode' support.
>>>>>>>>
>>>>>>>> http://plac.googlecode.com/hg/doc/plac.html
>>>>>>>>
>>>>>>>> Licence: http://plac.googlecode.com/hg/doc/plac.html
>>>>>>>> BSD license
>>>>>>>>
>>>>>>>> *Cliapp *(3/10)
>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>
>>>>>>>> http://code.liw.fi/cliapp/docs/
>>>>>>>>
>>>>>>>> Licence : https://github.com/rshk/CliApp/blob/master/LICENSE
>>>>>>>> Apache License
>>>>>>>>
>>>>>>>>
>>>>>>>> *pyCLI  *(3/10)
>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>
>>>>>>>> http://pythonhosted.org//pyCLI/
>>>>>>>>
>>>>>>>> Licence: http://sourceforge.net/projects/pycli/
>>>>>>>> GNU General Public License version 2.0 (GPLv2)
>>>>>>>>
>>>>>>>>
>>>>>>>> *Cliff *(9/10)
>>>>>>>> A framework for building command line programs by OpenStack. It
>>>>>>>> uses plugins to define sub-commands, output formatters, and other
>>>>>>>> extensions.
>>>>>>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>>>>>>
>>>>>>>> http://docs.openstack.org/developer/cliff/index.html
>>>>>>>>
>>>>>>>> Licence: https://launchpad.net/python-cliff
>>>>>>>> Apache Licence
>>>>>>>>
>>>>>>>>
>>>>>>>> *cmd *(8/10)
>>>>>>>> Python in built packages for 'Interactive Mode' applications. Maps
>>>>>>>> CLI commands to functions by function name, as def do_<whatever
>>>>>>>> the command name> ( eg: def do_command1 is for command1 ). Support
>>>>>>>> only arguments but no support for Unix-style flags. Have features like
>>>>>>>> automatic command completion in 'Interactive Mode'.
>>>>>>>>
>>>>>>>> https://docs.python.org/2/library/cmd.html
>>>>>>>>
>>>>>>>> Licence: https://docs.python.org/2/license.html
>>>>>>>> GPL compatible
>>>>>>>>
>>>>>>>>
>>>>>>>> *cmd2 *(9/10)
>>>>>>>> Extends the Python Standard Library’s cmd package.  Can handle
>>>>>>>> arguments and flags.  Supports for Output Redirection and Piping ( As in a
>>>>>>>> Unix shell ). Searchable command history (  bash-like history list editing
>>>>>>>> ), can get last commands with arrow keys. Able to perform shell commands
>>>>>>>> while in Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output
>>>>>>>> can be colored.
>>>>>>>>
>>>>>>>> https://pythonhosted.org/cmd2
>>>>>>>>
>>>>>>>> Licence: https://pypi.python.org/pypi/cmd2/0.6.8
>>>>>>>> MIT License
>>>>>>>>
>>>>>>>> On Wed, Feb 25, 2015 at 10:29 AM, Chamila De Alwis <
>>>>>>>> chamilad@wso2.com> wrote:
>>>>>>>>
>>>>>>>>> Great work Milindu. It would be better to add the licenses for
>>>>>>>>> each library too, in case any non-compatible or ambiguous ones might be
>>>>>>>>> there.
>>>>>>>>>
>>>>>>>>> IMO using a framework from the standard library would be better,
>>>>>>>>> since the pre-requisites will be minimal.
>>>>>>>>> On Feb 25, 2015 9:55 AM, "Milindu Sanoj Kumarage" <
>>>>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> Here is the JIRA issue on this,
>>>>>>>>>> https://issues.apache.org/jira/browse/STRATOS-1187
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Here I have added some of the Python CLI frameworks I checked, I
>>>>>>>>>> have added a brief for each of them. I also have state a score out of 10 to
>>>>>>>>>> indicate how best they matches for our need. ( But they are as of my
>>>>>>>>>> understanding! I may not be very correct in some cases.  Because some of
>>>>>>>>>> the ones I could write some codes and check, but for some I could not,
>>>>>>>>>> manly because of errors )
>>>>>>>>>>
>>>>>>>>>> *Cement *(6/10)
>>>>>>>>>> A complex framework, every CLI commands is bound to a separate
>>>>>>>>>> Python class that acts like an controller, and each controller have several
>>>>>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>>>>>>>>> via aliases. But no much developments in Github repo recently.
>>>>>>>>>>
>>>>>>>>>> http://cement.readthedocs.org/
>>>>>>>>>>
>>>>>>>>>> *Click *(7/10)
>>>>>>>>>> Rich with features, uses Python Decorators to bind CLI commands
>>>>>>>>>> to functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>>>> mode'.
>>>>>>>>>>
>>>>>>>>>> http://click.pocoo.org/3/
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> *Plac *(4/10)
>>>>>>>>>> A scaled down version of Python argparse package.  Uses set of if
>>>>>>>>>> else statements to process the commands. But no 'Interactive Mode' support.
>>>>>>>>>>
>>>>>>>>>> http://plac.googlecode.com/hg/doc/plac.html
>>>>>>>>>>
>>>>>>>>>> *Cliapp *(3/10)
>>>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>>>
>>>>>>>>>> http://code.liw.fi/cliapp/docs/
>>>>>>>>>>
>>>>>>>>>> *pyCLI  *(3/10)
>>>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>>>
>>>>>>>>>> http://pythonhosted.org//pyCLI/
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> *Cliff *(9/10)
>>>>>>>>>> A framework for building command line programs by OpenStack. It
>>>>>>>>>> uses plugins to define sub-commands, output formatters, and other
>>>>>>>>>> extensions.
>>>>>>>>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>>>>>>>>
>>>>>>>>>> http://docs.openstack.org/developer/cliff/index.html
>>>>>>>>>>
>>>>>>>>>> *cmd *(8/10)
>>>>>>>>>> Python in built packages for 'Interactive Mode' applications.
>>>>>>>>>> Maps CLI commands to functions by function name, as def
>>>>>>>>>> do_<whatever the command name> ( eg: def do_command1 is for
>>>>>>>>>> command1 ). Support only arguments but no support for Unix-style flags.
>>>>>>>>>> Have features like automatic command completion in 'Interactive Mode'.
>>>>>>>>>>
>>>>>>>>>> https://docs.python.org/2/library/cmd.html
>>>>>>>>>>
>>>>>>>>>> *cmd2 *(9/10)
>>>>>>>>>> Extends the Python Standard Library’s cmd package.  Can handle
>>>>>>>>>> arguments and flags.  Supports for Output Redirection and Piping ( As in a
>>>>>>>>>> Unix shell ). Searchable command history (  bash-like history list editing
>>>>>>>>>> ), can get last commands with arrow keys. Able to perform shell commands
>>>>>>>>>> while in Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output
>>>>>>>>>> can be colored.
>>>>>>>>>>
>>>>>>>>>> https://pythonhosted.org/cmd2
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Imesh Gunaratne
>>>>>>
>>>>>> Technical Lead, WSO2
>>>>>> Committer & PMC Member, Apache Stratos
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Technical Lead, WSO2
>>> Committer & PMC Member, Apache Stratos
>>>
>>
>>
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>

Re: GSoC 2015

Posted by Imesh Gunaratne <im...@apache.org>.
Great! Nice to hear that. We might not need to use "_", it would be better
if auto completion could also use commands with "-" pattern.

At the moment we do not have much client side validations, most of them are
done in server. You could refer [1] for this.

[1] https://cwiki.apache.org/confluence/display/STRATOS/4.1.0+CLI+Guide

On Thu, Mar 5, 2015 at 6:23 PM, Milindu Sanoj Kumarage <
agentmilindu@gmail.com> wrote:

> Hi,
>
> With this workaround ( actually it is not a workaround, Cmd2 really has
> aliases feature! but in different name ) we can have both "list-tenants"
> and "list_tenants" working without a problem. Therefor the  Single
> command line mode would work exactly like the Java CLI, and also the
> Interactive mode. But in Interactive mode, auto-complete still  suggests "
> list_tenants" instead of "list-tenants". we can change that too if you
> really need, but needs some alternations that may not be very beautiful,
> but not ugly too.
>
> one more question, we have to validate the parameters before sending to
> the REST API, right? Do we have any document for these validations, or is
> it the codes I have to follow?
>
>
>
> On Thu, Mar 5, 2015 at 3:50 AM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> Hi Milindu,
>>
>> Great work! We will have a look at this and get back to you. In the mean
>> time can you provide some details on this sample?
>>
>> Thanks
>>
>> On Thu, Mar 5, 2015 at 12:12 AM, Milindu Sanoj Kumarage <
>> agentmilindu@gmail.com> wrote:
>>
>>> Hi,
>>> I spend last few days investigating a workarounds to solve that '-'
>>> problem :) It seems it is possible.
>>>
>>> BTW, I checked the possibility of uploading the final product to Pip
>>> where anyone can  install Stratos CLI using Pip like
>>> $Pip install stratos
>>>
>>> and then run like
>>>
>>> $ stratos -u abcdef
>>>
>>> What's your idea on that? ( We can also provide python script with a
>>> wrapper for Windows and Linux  )
>>>
>>>
>>>
>>>
>>>
>>> On Fri, Feb 27, 2015 at 9:45 PM, Milindu Sanoj Kumarage <
>>> agentmilindu@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> the reason is  Cmd2 ( and most of the python CLI frameworks ) uses
>>>> function mapping to CLI commands, that is,
>>>>
>>>> // stratos>greet
>>>> def do_greet():
>>>>     print("hi")
>>>>
>>>> will become the 'greet' command.
>>>>
>>>> But if we need,
>>>>
>>>> 'list-tenants' we have to code it as
>>>>
>>>> def do_list-tenants:
>>>>    #codes of list tenant command
>>>>
>>>> But using '-' in names of functions ( def*enitions* ) in Python is not
>>>> allowed.
>>>> What shall we do? I'm okay even to write it from the scratch.
>>>>
>>>>
>>>>
>>>> On Fri, Feb 27, 2015 at 9:29 PM, Imesh Gunaratne <im...@apache.org>
>>>> wrote:
>>>>
>>>>> Hi Milindu,
>>>>>
>>>>> Is there any way of using "-" in the CLI commands. I did not get why a
>>>>> CLI framework would block "-" character.
>>>>>
>>>>> Thanks
>>>>>
>>>>> On Fri, Feb 27, 2015 at 2:49 PM, Milindu Sanoj Kumarage <
>>>>> agentmilindu@gmail.com> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Then shall we go with Cmd2 python package? Only change we have to do
>>>>>> is call CLI commands with '_ '  instead '-', like 'list_tenants' instead of
>>>>>> 'list-tenants'.
>>>>>>
>>>>>> And for HTTP request/response handling,  we can use either Python's
>>>>>> urllib3 or Requests, a wrapper around urllib3 which gives much simpler API
>>>>>> that leads to  cleaner codes. It's been praised in the community from the
>>>>>> beginning.
>>>>>>
>>>>>> Licence: Apache2
>>>>>>
>>>>>> http://docs.python-requests.org/en/latest/#
>>>>>>
>>>>>> On Wed, Feb 25, 2015 at 3:26 PM, Milindu Sanoj Kumarage <
>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Here I have included the licences of each framework :)
>>>>>>>
>>>>>>> *Cement *(6/10)
>>>>>>> A complex framework, every CLI commands is bound to a separate
>>>>>>> Python class that acts like an controller, and each controller have several
>>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>>>>>> via aliases. But no much developments in Github repo recently.
>>>>>>>
>>>>>>> http://cement.readthedocs.org/
>>>>>>>
>>>>>>> Licence : http://cement.readthedocs.org/en/latest/license/
>>>>>>> Redistribution and use in source and binary forms, with or without
>>>>>>> modification, are permitted under given conditions.
>>>>>>>
>>>>>>>
>>>>>>> *Click *(7/10)
>>>>>>> Rich with features, uses Python Decorators to bind CLI commands to
>>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>> mode'.
>>>>>>>
>>>>>>> http://click.pocoo.org/3/
>>>>>>>
>>>>>>> Licence :  http://click.pocoo.org/3/license/
>>>>>>>  three-clause BSD License
>>>>>>>
>>>>>>>
>>>>>>> *Plac *(4/10)
>>>>>>> A scaled down version of Python argparse package.  Uses set of if
>>>>>>> else statements to process the commands. But no 'Interactive Mode' support.
>>>>>>>
>>>>>>> http://plac.googlecode.com/hg/doc/plac.html
>>>>>>>
>>>>>>> Licence: http://plac.googlecode.com/hg/doc/plac.html
>>>>>>> BSD license
>>>>>>>
>>>>>>> *Cliapp *(3/10)
>>>>>>> No 'Interactive Mode' support.
>>>>>>>
>>>>>>> http://code.liw.fi/cliapp/docs/
>>>>>>>
>>>>>>> Licence : https://github.com/rshk/CliApp/blob/master/LICENSE
>>>>>>> Apache License
>>>>>>>
>>>>>>>
>>>>>>> *pyCLI  *(3/10)
>>>>>>> No 'Interactive Mode' support.
>>>>>>>
>>>>>>> http://pythonhosted.org//pyCLI/
>>>>>>>
>>>>>>> Licence: http://sourceforge.net/projects/pycli/
>>>>>>> GNU General Public License version 2.0 (GPLv2)
>>>>>>>
>>>>>>>
>>>>>>> *Cliff *(9/10)
>>>>>>> A framework for building command line programs by OpenStack. It uses
>>>>>>> plugins to define sub-commands, output formatters, and other extensions.
>>>>>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>>>>>
>>>>>>> http://docs.openstack.org/developer/cliff/index.html
>>>>>>>
>>>>>>> Licence: https://launchpad.net/python-cliff
>>>>>>> Apache Licence
>>>>>>>
>>>>>>>
>>>>>>> *cmd *(8/10)
>>>>>>> Python in built packages for 'Interactive Mode' applications. Maps
>>>>>>> CLI commands to functions by function name, as def do_<whatever the
>>>>>>> command name> ( eg: def do_command1 is for command1 ). Support only
>>>>>>> arguments but no support for Unix-style flags. Have features like automatic
>>>>>>> command completion in 'Interactive Mode'.
>>>>>>>
>>>>>>> https://docs.python.org/2/library/cmd.html
>>>>>>>
>>>>>>> Licence: https://docs.python.org/2/license.html
>>>>>>> GPL compatible
>>>>>>>
>>>>>>>
>>>>>>> *cmd2 *(9/10)
>>>>>>> Extends the Python Standard Library’s cmd package.  Can handle
>>>>>>> arguments and flags.  Supports for Output Redirection and Piping ( As in a
>>>>>>> Unix shell ). Searchable command history (  bash-like history list editing
>>>>>>> ), can get last commands with arrow keys. Able to perform shell commands
>>>>>>> while in Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output
>>>>>>> can be colored.
>>>>>>>
>>>>>>> https://pythonhosted.org/cmd2
>>>>>>>
>>>>>>> Licence: https://pypi.python.org/pypi/cmd2/0.6.8
>>>>>>> MIT License
>>>>>>>
>>>>>>> On Wed, Feb 25, 2015 at 10:29 AM, Chamila De Alwis <
>>>>>>> chamilad@wso2.com> wrote:
>>>>>>>
>>>>>>>> Great work Milindu. It would be better to add the licenses for each
>>>>>>>> library too, in case any non-compatible or ambiguous ones might be there.
>>>>>>>>
>>>>>>>> IMO using a framework from the standard library would be better,
>>>>>>>> since the pre-requisites will be minimal.
>>>>>>>> On Feb 25, 2015 9:55 AM, "Milindu Sanoj Kumarage" <
>>>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> Here is the JIRA issue on this,
>>>>>>>>> https://issues.apache.org/jira/browse/STRATOS-1187
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Here I have added some of the Python CLI frameworks I checked, I
>>>>>>>>> have added a brief for each of them. I also have state a score out of 10 to
>>>>>>>>> indicate how best they matches for our need. ( But they are as of my
>>>>>>>>> understanding! I may not be very correct in some cases.  Because some of
>>>>>>>>> the ones I could write some codes and check, but for some I could not,
>>>>>>>>> manly because of errors )
>>>>>>>>>
>>>>>>>>> *Cement *(6/10)
>>>>>>>>> A complex framework, every CLI commands is bound to a separate
>>>>>>>>> Python class that acts like an controller, and each controller have several
>>>>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>>>>>>>> via aliases. But no much developments in Github repo recently.
>>>>>>>>>
>>>>>>>>> http://cement.readthedocs.org/
>>>>>>>>>
>>>>>>>>> *Click *(7/10)
>>>>>>>>> Rich with features, uses Python Decorators to bind CLI commands to
>>>>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>>> mode'.
>>>>>>>>>
>>>>>>>>> http://click.pocoo.org/3/
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> *Plac *(4/10)
>>>>>>>>> A scaled down version of Python argparse package.  Uses set of if
>>>>>>>>> else statements to process the commands. But no 'Interactive Mode' support.
>>>>>>>>>
>>>>>>>>> http://plac.googlecode.com/hg/doc/plac.html
>>>>>>>>>
>>>>>>>>> *Cliapp *(3/10)
>>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>>
>>>>>>>>> http://code.liw.fi/cliapp/docs/
>>>>>>>>>
>>>>>>>>> *pyCLI  *(3/10)
>>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>>
>>>>>>>>> http://pythonhosted.org//pyCLI/
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> *Cliff *(9/10)
>>>>>>>>> A framework for building command line programs by OpenStack. It
>>>>>>>>> uses plugins to define sub-commands, output formatters, and other
>>>>>>>>> extensions.
>>>>>>>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>>>>>>>
>>>>>>>>> http://docs.openstack.org/developer/cliff/index.html
>>>>>>>>>
>>>>>>>>> *cmd *(8/10)
>>>>>>>>> Python in built packages for 'Interactive Mode' applications. Maps
>>>>>>>>> CLI commands to functions by function name, as def do_<whatever
>>>>>>>>> the command name> ( eg: def do_command1 is for command1 ).
>>>>>>>>> Support only arguments but no support for Unix-style flags. Have features
>>>>>>>>> like automatic command completion in 'Interactive Mode'.
>>>>>>>>>
>>>>>>>>> https://docs.python.org/2/library/cmd.html
>>>>>>>>>
>>>>>>>>> *cmd2 *(9/10)
>>>>>>>>> Extends the Python Standard Library’s cmd package.  Can handle
>>>>>>>>> arguments and flags.  Supports for Output Redirection and Piping ( As in a
>>>>>>>>> Unix shell ). Searchable command history (  bash-like history list editing
>>>>>>>>> ), can get last commands with arrow keys. Able to perform shell commands
>>>>>>>>> while in Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output
>>>>>>>>> can be colored.
>>>>>>>>>
>>>>>>>>> https://pythonhosted.org/cmd2
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Imesh Gunaratne
>>>>>
>>>>> Technical Lead, WSO2
>>>>> Committer & PMC Member, Apache Stratos
>>>>>
>>>>
>>>>
>>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PMC Member, Apache Stratos
>>
>
>


-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: GSoC 2015

Posted by Milindu Sanoj Kumarage <ag...@gmail.com>.
Hi,

With this workaround ( actually it is not a workaround, Cmd2 really has
aliases feature! but in different name ) we can have both "list-tenants"
and "list_tenants" working without a problem. Therefor the  Single command
line mode would work exactly like the Java CLI, and also the Interactive
mode. But in Interactive mode, auto-complete still  suggests "list_tenants"
instead of "list-tenants". we can change that too if you really need, but
needs some alternations that may not be very beautiful, but not ugly too.

one more question, we have to validate the parameters before sending to the
REST API, right? Do we have any document for these validations, or is it
the codes I have to follow?



On Thu, Mar 5, 2015 at 3:50 AM, Imesh Gunaratne <im...@apache.org> wrote:

> Hi Milindu,
>
> Great work! We will have a look at this and get back to you. In the mean
> time can you provide some details on this sample?
>
> Thanks
>
> On Thu, Mar 5, 2015 at 12:12 AM, Milindu Sanoj Kumarage <
> agentmilindu@gmail.com> wrote:
>
>> Hi,
>> I spend last few days investigating a workarounds to solve that '-'
>> problem :) It seems it is possible.
>>
>> BTW, I checked the possibility of uploading the final product to Pip
>> where anyone can  install Stratos CLI using Pip like
>> $Pip install stratos
>>
>> and then run like
>>
>> $ stratos -u abcdef
>>
>> What's your idea on that? ( We can also provide python script with a
>> wrapper for Windows and Linux  )
>>
>>
>>
>>
>>
>> On Fri, Feb 27, 2015 at 9:45 PM, Milindu Sanoj Kumarage <
>> agentmilindu@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> the reason is  Cmd2 ( and most of the python CLI frameworks ) uses
>>> function mapping to CLI commands, that is,
>>>
>>> // stratos>greet
>>> def do_greet():
>>>     print("hi")
>>>
>>> will become the 'greet' command.
>>>
>>> But if we need,
>>>
>>> 'list-tenants' we have to code it as
>>>
>>> def do_list-tenants:
>>>    #codes of list tenant command
>>>
>>> But using '-' in names of functions ( def*enitions* ) in Python is not
>>> allowed.
>>> What shall we do? I'm okay even to write it from the scratch.
>>>
>>>
>>>
>>> On Fri, Feb 27, 2015 at 9:29 PM, Imesh Gunaratne <im...@apache.org>
>>> wrote:
>>>
>>>> Hi Milindu,
>>>>
>>>> Is there any way of using "-" in the CLI commands. I did not get why a
>>>> CLI framework would block "-" character.
>>>>
>>>> Thanks
>>>>
>>>> On Fri, Feb 27, 2015 at 2:49 PM, Milindu Sanoj Kumarage <
>>>> agentmilindu@gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Then shall we go with Cmd2 python package? Only change we have to do
>>>>> is call CLI commands with '_ '  instead '-', like 'list_tenants' instead of
>>>>> 'list-tenants'.
>>>>>
>>>>> And for HTTP request/response handling,  we can use either Python's
>>>>> urllib3 or Requests, a wrapper around urllib3 which gives much simpler API
>>>>> that leads to  cleaner codes. It's been praised in the community from the
>>>>> beginning.
>>>>>
>>>>> Licence: Apache2
>>>>>
>>>>> http://docs.python-requests.org/en/latest/#
>>>>>
>>>>> On Wed, Feb 25, 2015 at 3:26 PM, Milindu Sanoj Kumarage <
>>>>> agentmilindu@gmail.com> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Here I have included the licences of each framework :)
>>>>>>
>>>>>> *Cement *(6/10)
>>>>>> A complex framework, every CLI commands is bound to a separate Python
>>>>>> class that acts like an controller, and each controller have several
>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>>>>> via aliases. But no much developments in Github repo recently.
>>>>>>
>>>>>> http://cement.readthedocs.org/
>>>>>>
>>>>>> Licence : http://cement.readthedocs.org/en/latest/license/
>>>>>> Redistribution and use in source and binary forms, with or without
>>>>>> modification, are permitted under given conditions.
>>>>>>
>>>>>>
>>>>>> *Click *(7/10)
>>>>>> Rich with features, uses Python Decorators to bind CLI commands to
>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>> mode'.
>>>>>>
>>>>>> http://click.pocoo.org/3/
>>>>>>
>>>>>> Licence :  http://click.pocoo.org/3/license/
>>>>>>  three-clause BSD License
>>>>>>
>>>>>>
>>>>>> *Plac *(4/10)
>>>>>> A scaled down version of Python argparse package.  Uses set of if
>>>>>> else statements to process the commands. But no 'Interactive Mode' support.
>>>>>>
>>>>>> http://plac.googlecode.com/hg/doc/plac.html
>>>>>>
>>>>>> Licence: http://plac.googlecode.com/hg/doc/plac.html
>>>>>> BSD license
>>>>>>
>>>>>> *Cliapp *(3/10)
>>>>>> No 'Interactive Mode' support.
>>>>>>
>>>>>> http://code.liw.fi/cliapp/docs/
>>>>>>
>>>>>> Licence : https://github.com/rshk/CliApp/blob/master/LICENSE
>>>>>> Apache License
>>>>>>
>>>>>>
>>>>>> *pyCLI  *(3/10)
>>>>>> No 'Interactive Mode' support.
>>>>>>
>>>>>> http://pythonhosted.org//pyCLI/
>>>>>>
>>>>>> Licence: http://sourceforge.net/projects/pycli/
>>>>>> GNU General Public License version 2.0 (GPLv2)
>>>>>>
>>>>>>
>>>>>> *Cliff *(9/10)
>>>>>> A framework for building command line programs by OpenStack. It uses
>>>>>> plugins to define sub-commands, output formatters, and other extensions.
>>>>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>>>>
>>>>>> http://docs.openstack.org/developer/cliff/index.html
>>>>>>
>>>>>> Licence: https://launchpad.net/python-cliff
>>>>>> Apache Licence
>>>>>>
>>>>>>
>>>>>> *cmd *(8/10)
>>>>>> Python in built packages for 'Interactive Mode' applications. Maps
>>>>>> CLI commands to functions by function name, as def do_<whatever the
>>>>>> command name> ( eg: def do_command1 is for command1 ). Support only
>>>>>> arguments but no support for Unix-style flags. Have features like automatic
>>>>>> command completion in 'Interactive Mode'.
>>>>>>
>>>>>> https://docs.python.org/2/library/cmd.html
>>>>>>
>>>>>> Licence: https://docs.python.org/2/license.html
>>>>>> GPL compatible
>>>>>>
>>>>>>
>>>>>> *cmd2 *(9/10)
>>>>>> Extends the Python Standard Library’s cmd package.  Can handle
>>>>>> arguments and flags.  Supports for Output Redirection and Piping ( As in a
>>>>>> Unix shell ). Searchable command history (  bash-like history list editing
>>>>>> ), can get last commands with arrow keys. Able to perform shell commands
>>>>>> while in Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output
>>>>>> can be colored.
>>>>>>
>>>>>> https://pythonhosted.org/cmd2
>>>>>>
>>>>>> Licence: https://pypi.python.org/pypi/cmd2/0.6.8
>>>>>> MIT License
>>>>>>
>>>>>> On Wed, Feb 25, 2015 at 10:29 AM, Chamila De Alwis <chamilad@wso2.com
>>>>>> > wrote:
>>>>>>
>>>>>>> Great work Milindu. It would be better to add the licenses for each
>>>>>>> library too, in case any non-compatible or ambiguous ones might be there.
>>>>>>>
>>>>>>> IMO using a framework from the standard library would be better,
>>>>>>> since the pre-requisites will be minimal.
>>>>>>> On Feb 25, 2015 9:55 AM, "Milindu Sanoj Kumarage" <
>>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Here is the JIRA issue on this,
>>>>>>>> https://issues.apache.org/jira/browse/STRATOS-1187
>>>>>>>>
>>>>>>>>
>>>>>>>> Here I have added some of the Python CLI frameworks I checked, I
>>>>>>>> have added a brief for each of them. I also have state a score out of 10 to
>>>>>>>> indicate how best they matches for our need. ( But they are as of my
>>>>>>>> understanding! I may not be very correct in some cases.  Because some of
>>>>>>>> the ones I could write some codes and check, but for some I could not,
>>>>>>>> manly because of errors )
>>>>>>>>
>>>>>>>> *Cement *(6/10)
>>>>>>>> A complex framework, every CLI commands is bound to a separate
>>>>>>>> Python class that acts like an controller, and each controller have several
>>>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>>>>>>> via aliases. But no much developments in Github repo recently.
>>>>>>>>
>>>>>>>> http://cement.readthedocs.org/
>>>>>>>>
>>>>>>>> *Click *(7/10)
>>>>>>>> Rich with features, uses Python Decorators to bind CLI commands to
>>>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>>> mode'.
>>>>>>>>
>>>>>>>> http://click.pocoo.org/3/
>>>>>>>>
>>>>>>>>
>>>>>>>> *Plac *(4/10)
>>>>>>>> A scaled down version of Python argparse package.  Uses set of if
>>>>>>>> else statements to process the commands. But no 'Interactive Mode' support.
>>>>>>>>
>>>>>>>> http://plac.googlecode.com/hg/doc/plac.html
>>>>>>>>
>>>>>>>> *Cliapp *(3/10)
>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>
>>>>>>>> http://code.liw.fi/cliapp/docs/
>>>>>>>>
>>>>>>>> *pyCLI  *(3/10)
>>>>>>>> No 'Interactive Mode' support.
>>>>>>>>
>>>>>>>> http://pythonhosted.org//pyCLI/
>>>>>>>>
>>>>>>>>
>>>>>>>> *Cliff *(9/10)
>>>>>>>> A framework for building command line programs by OpenStack. It
>>>>>>>> uses plugins to define sub-commands, output formatters, and other
>>>>>>>> extensions.
>>>>>>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>>>>>>
>>>>>>>> http://docs.openstack.org/developer/cliff/index.html
>>>>>>>>
>>>>>>>> *cmd *(8/10)
>>>>>>>> Python in built packages for 'Interactive Mode' applications. Maps
>>>>>>>> CLI commands to functions by function name, as def do_<whatever
>>>>>>>> the command name> ( eg: def do_command1 is for command1 ). Support
>>>>>>>> only arguments but no support for Unix-style flags. Have features like
>>>>>>>> automatic command completion in 'Interactive Mode'.
>>>>>>>>
>>>>>>>> https://docs.python.org/2/library/cmd.html
>>>>>>>>
>>>>>>>> *cmd2 *(9/10)
>>>>>>>> Extends the Python Standard Library’s cmd package.  Can handle
>>>>>>>> arguments and flags.  Supports for Output Redirection and Piping ( As in a
>>>>>>>> Unix shell ). Searchable command history (  bash-like history list editing
>>>>>>>> ), can get last commands with arrow keys. Able to perform shell commands
>>>>>>>> while in Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output
>>>>>>>> can be colored.
>>>>>>>>
>>>>>>>> https://pythonhosted.org/cmd2
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Imesh Gunaratne
>>>>
>>>> Technical Lead, WSO2
>>>> Committer & PMC Member, Apache Stratos
>>>>
>>>
>>>
>>
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>

Re: GSoC 2015

Posted by Imesh Gunaratne <im...@apache.org>.
Hi Milindu,

Great work! We will have a look at this and get back to you. In the mean
time can you provide some details on this sample?

Thanks

On Thu, Mar 5, 2015 at 12:12 AM, Milindu Sanoj Kumarage <
agentmilindu@gmail.com> wrote:

> Hi,
> I spend last few days investigating a workarounds to solve that '-'
> problem :) It seems it is possible.
>
> BTW, I checked the possibility of uploading the final product to Pip where
> anyone can  install Stratos CLI using Pip like
> $Pip install stratos
>
> and then run like
>
> $ stratos -u abcdef
>
> What's your idea on that? ( We can also provide python script with a
> wrapper for Windows and Linux  )
>
>
>
>
>
> On Fri, Feb 27, 2015 at 9:45 PM, Milindu Sanoj Kumarage <
> agentmilindu@gmail.com> wrote:
>
>> Hi,
>>
>> the reason is  Cmd2 ( and most of the python CLI frameworks ) uses
>> function mapping to CLI commands, that is,
>>
>> // stratos>greet
>> def do_greet():
>>     print("hi")
>>
>> will become the 'greet' command.
>>
>> But if we need,
>>
>> 'list-tenants' we have to code it as
>>
>> def do_list-tenants:
>>    #codes of list tenant command
>>
>> But using '-' in names of functions ( def*enitions* ) in Python is not
>> allowed.
>> What shall we do? I'm okay even to write it from the scratch.
>>
>>
>>
>> On Fri, Feb 27, 2015 at 9:29 PM, Imesh Gunaratne <im...@apache.org>
>> wrote:
>>
>>> Hi Milindu,
>>>
>>> Is there any way of using "-" in the CLI commands. I did not get why a
>>> CLI framework would block "-" character.
>>>
>>> Thanks
>>>
>>> On Fri, Feb 27, 2015 at 2:49 PM, Milindu Sanoj Kumarage <
>>> agentmilindu@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> Then shall we go with Cmd2 python package? Only change we have to do is
>>>> call CLI commands with '_ '  instead '-', like 'list_tenants' instead of
>>>> 'list-tenants'.
>>>>
>>>> And for HTTP request/response handling,  we can use either Python's
>>>> urllib3 or Requests, a wrapper around urllib3 which gives much simpler API
>>>> that leads to  cleaner codes. It's been praised in the community from the
>>>> beginning.
>>>>
>>>> Licence: Apache2
>>>>
>>>> http://docs.python-requests.org/en/latest/#
>>>>
>>>> On Wed, Feb 25, 2015 at 3:26 PM, Milindu Sanoj Kumarage <
>>>> agentmilindu@gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Here I have included the licences of each framework :)
>>>>>
>>>>> *Cement *(6/10)
>>>>> A complex framework, every CLI commands is bound to a separate Python
>>>>> class that acts like an controller, and each controller have several
>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>>>> via aliases. But no much developments in Github repo recently.
>>>>>
>>>>> http://cement.readthedocs.org/
>>>>>
>>>>> Licence : http://cement.readthedocs.org/en/latest/license/
>>>>> Redistribution and use in source and binary forms, with or without
>>>>> modification, are permitted under given conditions.
>>>>>
>>>>>
>>>>> *Click *(7/10)
>>>>> Rich with features, uses Python Decorators to bind CLI commands to
>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>> mode'.
>>>>>
>>>>> http://click.pocoo.org/3/
>>>>>
>>>>> Licence :  http://click.pocoo.org/3/license/
>>>>>  three-clause BSD License
>>>>>
>>>>>
>>>>> *Plac *(4/10)
>>>>> A scaled down version of Python argparse package.  Uses set of if else
>>>>> statements to process the commands. But no 'Interactive Mode' support.
>>>>>
>>>>> http://plac.googlecode.com/hg/doc/plac.html
>>>>>
>>>>> Licence: http://plac.googlecode.com/hg/doc/plac.html
>>>>> BSD license
>>>>>
>>>>> *Cliapp *(3/10)
>>>>> No 'Interactive Mode' support.
>>>>>
>>>>> http://code.liw.fi/cliapp/docs/
>>>>>
>>>>> Licence : https://github.com/rshk/CliApp/blob/master/LICENSE
>>>>> Apache License
>>>>>
>>>>>
>>>>> *pyCLI  *(3/10)
>>>>> No 'Interactive Mode' support.
>>>>>
>>>>> http://pythonhosted.org//pyCLI/
>>>>>
>>>>> Licence: http://sourceforge.net/projects/pycli/
>>>>> GNU General Public License version 2.0 (GPLv2)
>>>>>
>>>>>
>>>>> *Cliff *(9/10)
>>>>> A framework for building command line programs by OpenStack. It uses
>>>>> plugins to define sub-commands, output formatters, and other extensions.
>>>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>>>
>>>>> http://docs.openstack.org/developer/cliff/index.html
>>>>>
>>>>> Licence: https://launchpad.net/python-cliff
>>>>> Apache Licence
>>>>>
>>>>>
>>>>> *cmd *(8/10)
>>>>> Python in built packages for 'Interactive Mode' applications. Maps CLI
>>>>> commands to functions by function name, as def do_<whatever the
>>>>> command name> ( eg: def do_command1 is for command1 ). Support only
>>>>> arguments but no support for Unix-style flags. Have features like automatic
>>>>> command completion in 'Interactive Mode'.
>>>>>
>>>>> https://docs.python.org/2/library/cmd.html
>>>>>
>>>>> Licence: https://docs.python.org/2/license.html
>>>>> GPL compatible
>>>>>
>>>>>
>>>>> *cmd2 *(9/10)
>>>>> Extends the Python Standard Library’s cmd package.  Can handle
>>>>> arguments and flags.  Supports for Output Redirection and Piping ( As in a
>>>>> Unix shell ). Searchable command history (  bash-like history list editing
>>>>> ), can get last commands with arrow keys. Able to perform shell commands
>>>>> while in Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output
>>>>> can be colored.
>>>>>
>>>>> https://pythonhosted.org/cmd2
>>>>>
>>>>> Licence: https://pypi.python.org/pypi/cmd2/0.6.8
>>>>> MIT License
>>>>>
>>>>> On Wed, Feb 25, 2015 at 10:29 AM, Chamila De Alwis <ch...@wso2.com>
>>>>> wrote:
>>>>>
>>>>>> Great work Milindu. It would be better to add the licenses for each
>>>>>> library too, in case any non-compatible or ambiguous ones might be there.
>>>>>>
>>>>>> IMO using a framework from the standard library would be better,
>>>>>> since the pre-requisites will be minimal.
>>>>>> On Feb 25, 2015 9:55 AM, "Milindu Sanoj Kumarage" <
>>>>>> agentmilindu@gmail.com> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Here is the JIRA issue on this,
>>>>>>> https://issues.apache.org/jira/browse/STRATOS-1187
>>>>>>>
>>>>>>>
>>>>>>> Here I have added some of the Python CLI frameworks I checked, I
>>>>>>> have added a brief for each of them. I also have state a score out of 10 to
>>>>>>> indicate how best they matches for our need. ( But they are as of my
>>>>>>> understanding! I may not be very correct in some cases.  Because some of
>>>>>>> the ones I could write some codes and check, but for some I could not,
>>>>>>> manly because of errors )
>>>>>>>
>>>>>>> *Cement *(6/10)
>>>>>>> A complex framework, every CLI commands is bound to a separate
>>>>>>> Python class that acts like an controller, and each controller have several
>>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>>>>>> via aliases. But no much developments in Github repo recently.
>>>>>>>
>>>>>>> http://cement.readthedocs.org/
>>>>>>>
>>>>>>> *Click *(7/10)
>>>>>>> Rich with features, uses Python Decorators to bind CLI commands to
>>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>>> mode'.
>>>>>>>
>>>>>>> http://click.pocoo.org/3/
>>>>>>>
>>>>>>>
>>>>>>> *Plac *(4/10)
>>>>>>> A scaled down version of Python argparse package.  Uses set of if
>>>>>>> else statements to process the commands. But no 'Interactive Mode' support.
>>>>>>>
>>>>>>> http://plac.googlecode.com/hg/doc/plac.html
>>>>>>>
>>>>>>> *Cliapp *(3/10)
>>>>>>> No 'Interactive Mode' support.
>>>>>>>
>>>>>>> http://code.liw.fi/cliapp/docs/
>>>>>>>
>>>>>>> *pyCLI  *(3/10)
>>>>>>> No 'Interactive Mode' support.
>>>>>>>
>>>>>>> http://pythonhosted.org//pyCLI/
>>>>>>>
>>>>>>>
>>>>>>> *Cliff *(9/10)
>>>>>>> A framework for building command line programs by OpenStack. It uses
>>>>>>> plugins to define sub-commands, output formatters, and other extensions.
>>>>>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>>>>>
>>>>>>> http://docs.openstack.org/developer/cliff/index.html
>>>>>>>
>>>>>>> *cmd *(8/10)
>>>>>>> Python in built packages for 'Interactive Mode' applications. Maps
>>>>>>> CLI commands to functions by function name, as def do_<whatever the
>>>>>>> command name> ( eg: def do_command1 is for command1 ). Support only
>>>>>>> arguments but no support for Unix-style flags. Have features like automatic
>>>>>>> command completion in 'Interactive Mode'.
>>>>>>>
>>>>>>> https://docs.python.org/2/library/cmd.html
>>>>>>>
>>>>>>> *cmd2 *(9/10)
>>>>>>> Extends the Python Standard Library’s cmd package.  Can handle
>>>>>>> arguments and flags.  Supports for Output Redirection and Piping ( As in a
>>>>>>> Unix shell ). Searchable command history (  bash-like history list editing
>>>>>>> ), can get last commands with arrow keys. Able to perform shell commands
>>>>>>> while in Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output
>>>>>>> can be colored.
>>>>>>>
>>>>>>> https://pythonhosted.org/cmd2
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Technical Lead, WSO2
>>> Committer & PMC Member, Apache Stratos
>>>
>>
>>
>


-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: GSoC 2015

Posted by Milindu Sanoj Kumarage <ag...@gmail.com>.
Hi,
I spend last few days investigating a workarounds to solve that '-' problem
:) It seems it is possible.

BTW, I checked the possibility of uploading the final product to Pip where
anyone can  install Stratos CLI using Pip like
$Pip install stratos

and then run like

$ stratos -u abcdef

What's your idea on that? ( We can also provide python script with a
wrapper for Windows and Linux  )





On Fri, Feb 27, 2015 at 9:45 PM, Milindu Sanoj Kumarage <
agentmilindu@gmail.com> wrote:

> Hi,
>
> the reason is  Cmd2 ( and most of the python CLI frameworks ) uses
> function mapping to CLI commands, that is,
>
> // stratos>greet
> def do_greet():
>     print("hi")
>
> will become the 'greet' command.
>
> But if we need,
>
> 'list-tenants' we have to code it as
>
> def do_list-tenants:
>    #codes of list tenant command
>
> But using '-' in names of functions ( def*enitions* ) in Python is not
> allowed.
> What shall we do? I'm okay even to write it from the scratch.
>
>
>
> On Fri, Feb 27, 2015 at 9:29 PM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> Hi Milindu,
>>
>> Is there any way of using "-" in the CLI commands. I did not get why a
>> CLI framework would block "-" character.
>>
>> Thanks
>>
>> On Fri, Feb 27, 2015 at 2:49 PM, Milindu Sanoj Kumarage <
>> agentmilindu@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> Then shall we go with Cmd2 python package? Only change we have to do is
>>> call CLI commands with '_ '  instead '-', like 'list_tenants' instead of
>>> 'list-tenants'.
>>>
>>> And for HTTP request/response handling,  we can use either Python's
>>> urllib3 or Requests, a wrapper around urllib3 which gives much simpler API
>>> that leads to  cleaner codes. It's been praised in the community from the
>>> beginning.
>>>
>>> Licence: Apache2
>>>
>>> http://docs.python-requests.org/en/latest/#
>>>
>>> On Wed, Feb 25, 2015 at 3:26 PM, Milindu Sanoj Kumarage <
>>> agentmilindu@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> Here I have included the licences of each framework :)
>>>>
>>>> *Cement *(6/10)
>>>> A complex framework, every CLI commands is bound to a separate Python
>>>> class that acts like an controller, and each controller have several
>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>>> via aliases. But no much developments in Github repo recently.
>>>>
>>>> http://cement.readthedocs.org/
>>>>
>>>> Licence : http://cement.readthedocs.org/en/latest/license/
>>>> Redistribution and use in source and binary forms, with or without
>>>> modification, are permitted under given conditions.
>>>>
>>>>
>>>> *Click *(7/10)
>>>> Rich with features, uses Python Decorators to bind CLI commands to
>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>> mode'.
>>>>
>>>> http://click.pocoo.org/3/
>>>>
>>>> Licence :  http://click.pocoo.org/3/license/
>>>>  three-clause BSD License
>>>>
>>>>
>>>> *Plac *(4/10)
>>>> A scaled down version of Python argparse package.  Uses set of if else
>>>> statements to process the commands. But no 'Interactive Mode' support.
>>>>
>>>> http://plac.googlecode.com/hg/doc/plac.html
>>>>
>>>> Licence: http://plac.googlecode.com/hg/doc/plac.html
>>>> BSD license
>>>>
>>>> *Cliapp *(3/10)
>>>> No 'Interactive Mode' support.
>>>>
>>>> http://code.liw.fi/cliapp/docs/
>>>>
>>>> Licence : https://github.com/rshk/CliApp/blob/master/LICENSE
>>>> Apache License
>>>>
>>>>
>>>> *pyCLI  *(3/10)
>>>> No 'Interactive Mode' support.
>>>>
>>>> http://pythonhosted.org//pyCLI/
>>>>
>>>> Licence: http://sourceforge.net/projects/pycli/
>>>> GNU General Public License version 2.0 (GPLv2)
>>>>
>>>>
>>>> *Cliff *(9/10)
>>>> A framework for building command line programs by OpenStack. It uses
>>>> plugins to define sub-commands, output formatters, and other extensions.
>>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>>
>>>> http://docs.openstack.org/developer/cliff/index.html
>>>>
>>>> Licence: https://launchpad.net/python-cliff
>>>> Apache Licence
>>>>
>>>>
>>>> *cmd *(8/10)
>>>> Python in built packages for 'Interactive Mode' applications. Maps CLI
>>>> commands to functions by function name, as def do_<whatever the
>>>> command name> ( eg: def do_command1 is for command1 ). Support only
>>>> arguments but no support for Unix-style flags. Have features like automatic
>>>> command completion in 'Interactive Mode'.
>>>>
>>>> https://docs.python.org/2/library/cmd.html
>>>>
>>>> Licence: https://docs.python.org/2/license.html
>>>> GPL compatible
>>>>
>>>>
>>>> *cmd2 *(9/10)
>>>> Extends the Python Standard Library’s cmd package.  Can handle
>>>> arguments and flags.  Supports for Output Redirection and Piping ( As in a
>>>> Unix shell ). Searchable command history (  bash-like history list editing
>>>> ), can get last commands with arrow keys. Able to perform shell commands
>>>> while in Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output
>>>> can be colored.
>>>>
>>>> https://pythonhosted.org/cmd2
>>>>
>>>> Licence: https://pypi.python.org/pypi/cmd2/0.6.8
>>>> MIT License
>>>>
>>>> On Wed, Feb 25, 2015 at 10:29 AM, Chamila De Alwis <ch...@wso2.com>
>>>> wrote:
>>>>
>>>>> Great work Milindu. It would be better to add the licenses for each
>>>>> library too, in case any non-compatible or ambiguous ones might be there.
>>>>>
>>>>> IMO using a framework from the standard library would be better, since
>>>>> the pre-requisites will be minimal.
>>>>> On Feb 25, 2015 9:55 AM, "Milindu Sanoj Kumarage" <
>>>>> agentmilindu@gmail.com> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Here is the JIRA issue on this,
>>>>>> https://issues.apache.org/jira/browse/STRATOS-1187
>>>>>>
>>>>>>
>>>>>> Here I have added some of the Python CLI frameworks I checked, I have
>>>>>> added a brief for each of them. I also have state a score out of 10 to
>>>>>> indicate how best they matches for our need. ( But they are as of my
>>>>>> understanding! I may not be very correct in some cases.  Because some of
>>>>>> the ones I could write some codes and check, but for some I could not,
>>>>>> manly because of errors )
>>>>>>
>>>>>> *Cement *(6/10)
>>>>>> A complex framework, every CLI commands is bound to a separate Python
>>>>>> class that acts like an controller, and each controller have several
>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>>>>> via aliases. But no much developments in Github repo recently.
>>>>>>
>>>>>> http://cement.readthedocs.org/
>>>>>>
>>>>>> *Click *(7/10)
>>>>>> Rich with features, uses Python Decorators to bind CLI commands to
>>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>>> mode'.
>>>>>>
>>>>>> http://click.pocoo.org/3/
>>>>>>
>>>>>>
>>>>>> *Plac *(4/10)
>>>>>> A scaled down version of Python argparse package.  Uses set of if
>>>>>> else statements to process the commands. But no 'Interactive Mode' support.
>>>>>>
>>>>>> http://plac.googlecode.com/hg/doc/plac.html
>>>>>>
>>>>>> *Cliapp *(3/10)
>>>>>> No 'Interactive Mode' support.
>>>>>>
>>>>>> http://code.liw.fi/cliapp/docs/
>>>>>>
>>>>>> *pyCLI  *(3/10)
>>>>>> No 'Interactive Mode' support.
>>>>>>
>>>>>> http://pythonhosted.org//pyCLI/
>>>>>>
>>>>>>
>>>>>> *Cliff *(9/10)
>>>>>> A framework for building command line programs by OpenStack. It uses
>>>>>> plugins to define sub-commands, output formatters, and other extensions.
>>>>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>>>>
>>>>>> http://docs.openstack.org/developer/cliff/index.html
>>>>>>
>>>>>> *cmd *(8/10)
>>>>>> Python in built packages for 'Interactive Mode' applications. Maps
>>>>>> CLI commands to functions by function name, as def do_<whatever the
>>>>>> command name> ( eg: def do_command1 is for command1 ). Support only
>>>>>> arguments but no support for Unix-style flags. Have features like automatic
>>>>>> command completion in 'Interactive Mode'.
>>>>>>
>>>>>> https://docs.python.org/2/library/cmd.html
>>>>>>
>>>>>> *cmd2 *(9/10)
>>>>>> Extends the Python Standard Library’s cmd package.  Can handle
>>>>>> arguments and flags.  Supports for Output Redirection and Piping ( As in a
>>>>>> Unix shell ). Searchable command history (  bash-like history list editing
>>>>>> ), can get last commands with arrow keys. Able to perform shell commands
>>>>>> while in Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output
>>>>>> can be colored.
>>>>>>
>>>>>> https://pythonhosted.org/cmd2
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PMC Member, Apache Stratos
>>
>
>

Re: GSoC 2015

Posted by Milindu Sanoj Kumarage <ag...@gmail.com>.
Hi,

the reason is  Cmd2 ( and most of the python CLI frameworks ) uses function
mapping to CLI commands, that is,

// stratos>greet
def do_greet():
    print("hi")

will become the 'greet' command.

But if we need,

'list-tenants' we have to code it as

def do_list-tenants:
   #codes of list tenant command

But using '-' in names of functions ( def*enitions* ) in Python is not
allowed.
What shall we do? I'm okay even to write it from the scratch.



On Fri, Feb 27, 2015 at 9:29 PM, Imesh Gunaratne <im...@apache.org> wrote:

> Hi Milindu,
>
> Is there any way of using "-" in the CLI commands. I did not get why a CLI
> framework would block "-" character.
>
> Thanks
>
> On Fri, Feb 27, 2015 at 2:49 PM, Milindu Sanoj Kumarage <
> agentmilindu@gmail.com> wrote:
>
>> Hi,
>>
>> Then shall we go with Cmd2 python package? Only change we have to do is
>> call CLI commands with '_ '  instead '-', like 'list_tenants' instead of
>> 'list-tenants'.
>>
>> And for HTTP request/response handling,  we can use either Python's
>> urllib3 or Requests, a wrapper around urllib3 which gives much simpler API
>> that leads to  cleaner codes. It's been praised in the community from the
>> beginning.
>>
>> Licence: Apache2
>>
>> http://docs.python-requests.org/en/latest/#
>>
>> On Wed, Feb 25, 2015 at 3:26 PM, Milindu Sanoj Kumarage <
>> agentmilindu@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> Here I have included the licences of each framework :)
>>>
>>> *Cement *(6/10)
>>> A complex framework, every CLI commands is bound to a separate Python
>>> class that acts like an controller, and each controller have several
>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>> via aliases. But no much developments in Github repo recently.
>>>
>>> http://cement.readthedocs.org/
>>>
>>> Licence : http://cement.readthedocs.org/en/latest/license/
>>> Redistribution and use in source and binary forms, with or without
>>> modification, are permitted under given conditions.
>>>
>>>
>>> *Click *(7/10)
>>> Rich with features, uses Python Decorators to bind CLI commands to
>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>> mode'.
>>>
>>> http://click.pocoo.org/3/
>>>
>>> Licence :  http://click.pocoo.org/3/license/
>>>  three-clause BSD License
>>>
>>>
>>> *Plac *(4/10)
>>> A scaled down version of Python argparse package.  Uses set of if else
>>> statements to process the commands. But no 'Interactive Mode' support.
>>>
>>> http://plac.googlecode.com/hg/doc/plac.html
>>>
>>> Licence: http://plac.googlecode.com/hg/doc/plac.html
>>> BSD license
>>>
>>> *Cliapp *(3/10)
>>> No 'Interactive Mode' support.
>>>
>>> http://code.liw.fi/cliapp/docs/
>>>
>>> Licence : https://github.com/rshk/CliApp/blob/master/LICENSE
>>> Apache License
>>>
>>>
>>> *pyCLI  *(3/10)
>>> No 'Interactive Mode' support.
>>>
>>> http://pythonhosted.org//pyCLI/
>>>
>>> Licence: http://sourceforge.net/projects/pycli/
>>> GNU General Public License version 2.0 (GPLv2)
>>>
>>>
>>> *Cliff *(9/10)
>>> A framework for building command line programs by OpenStack. It uses
>>> plugins to define sub-commands, output formatters, and other extensions.
>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>
>>> http://docs.openstack.org/developer/cliff/index.html
>>>
>>> Licence: https://launchpad.net/python-cliff
>>> Apache Licence
>>>
>>>
>>> *cmd *(8/10)
>>> Python in built packages for 'Interactive Mode' applications. Maps CLI
>>> commands to functions by function name, as def do_<whatever the command
>>> name> ( eg: def do_command1 is for command1 ). Support only arguments
>>> but no support for Unix-style flags. Have features like automatic command
>>> completion in 'Interactive Mode'.
>>>
>>> https://docs.python.org/2/library/cmd.html
>>>
>>> Licence: https://docs.python.org/2/license.html
>>> GPL compatible
>>>
>>>
>>> *cmd2 *(9/10)
>>> Extends the Python Standard Library’s cmd package.  Can handle arguments
>>> and flags.  Supports for Output Redirection and Piping ( As in a Unix shell
>>> ). Searchable command history (  bash-like history list editing ), can get
>>> last commands with arrow keys. Able to perform shell commands while in
>>> Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output can be
>>> colored.
>>>
>>> https://pythonhosted.org/cmd2
>>>
>>> Licence: https://pypi.python.org/pypi/cmd2/0.6.8
>>> MIT License
>>>
>>> On Wed, Feb 25, 2015 at 10:29 AM, Chamila De Alwis <ch...@wso2.com>
>>> wrote:
>>>
>>>> Great work Milindu. It would be better to add the licenses for each
>>>> library too, in case any non-compatible or ambiguous ones might be there.
>>>>
>>>> IMO using a framework from the standard library would be better, since
>>>> the pre-requisites will be minimal.
>>>> On Feb 25, 2015 9:55 AM, "Milindu Sanoj Kumarage" <
>>>> agentmilindu@gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Here is the JIRA issue on this,
>>>>> https://issues.apache.org/jira/browse/STRATOS-1187
>>>>>
>>>>>
>>>>> Here I have added some of the Python CLI frameworks I checked, I have
>>>>> added a brief for each of them. I also have state a score out of 10 to
>>>>> indicate how best they matches for our need. ( But they are as of my
>>>>> understanding! I may not be very correct in some cases.  Because some of
>>>>> the ones I could write some codes and check, but for some I could not,
>>>>> manly because of errors )
>>>>>
>>>>> *Cement *(6/10)
>>>>> A complex framework, every CLI commands is bound to a separate Python
>>>>> class that acts like an controller, and each controller have several
>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>>>> via aliases. But no much developments in Github repo recently.
>>>>>
>>>>> http://cement.readthedocs.org/
>>>>>
>>>>> *Click *(7/10)
>>>>> Rich with features, uses Python Decorators to bind CLI commands to
>>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>>> mode'.
>>>>>
>>>>> http://click.pocoo.org/3/
>>>>>
>>>>>
>>>>> *Plac *(4/10)
>>>>> A scaled down version of Python argparse package.  Uses set of if else
>>>>> statements to process the commands. But no 'Interactive Mode' support.
>>>>>
>>>>> http://plac.googlecode.com/hg/doc/plac.html
>>>>>
>>>>> *Cliapp *(3/10)
>>>>> No 'Interactive Mode' support.
>>>>>
>>>>> http://code.liw.fi/cliapp/docs/
>>>>>
>>>>> *pyCLI  *(3/10)
>>>>> No 'Interactive Mode' support.
>>>>>
>>>>> http://pythonhosted.org//pyCLI/
>>>>>
>>>>>
>>>>> *Cliff *(9/10)
>>>>> A framework for building command line programs by OpenStack. It uses
>>>>> plugins to define sub-commands, output formatters, and other extensions.
>>>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>>>
>>>>> http://docs.openstack.org/developer/cliff/index.html
>>>>>
>>>>> *cmd *(8/10)
>>>>> Python in built packages for 'Interactive Mode' applications. Maps CLI
>>>>> commands to functions by function name, as def do_<whatever the
>>>>> command name> ( eg: def do_command1 is for command1 ). Support only
>>>>> arguments but no support for Unix-style flags. Have features like automatic
>>>>> command completion in 'Interactive Mode'.
>>>>>
>>>>> https://docs.python.org/2/library/cmd.html
>>>>>
>>>>> *cmd2 *(9/10)
>>>>> Extends the Python Standard Library’s cmd package.  Can handle
>>>>> arguments and flags.  Supports for Output Redirection and Piping ( As in a
>>>>> Unix shell ). Searchable command history (  bash-like history list editing
>>>>> ), can get last commands with arrow keys. Able to perform shell commands
>>>>> while in Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output
>>>>> can be colored.
>>>>>
>>>>> https://pythonhosted.org/cmd2
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>

Re: GSoC 2015

Posted by Imesh Gunaratne <im...@apache.org>.
Hi Milindu,

Is there any way of using "-" in the CLI commands. I did not get why a CLI
framework would block "-" character.

Thanks

On Fri, Feb 27, 2015 at 2:49 PM, Milindu Sanoj Kumarage <
agentmilindu@gmail.com> wrote:

> Hi,
>
> Then shall we go with Cmd2 python package? Only change we have to do is
> call CLI commands with '_ '  instead '-', like 'list_tenants' instead of
> 'list-tenants'.
>
> And for HTTP request/response handling,  we can use either Python's
> urllib3 or Requests, a wrapper around urllib3 which gives much simpler API
> that leads to  cleaner codes. It's been praised in the community from the
> beginning.
>
> Licence: Apache2
>
> http://docs.python-requests.org/en/latest/#
>
> On Wed, Feb 25, 2015 at 3:26 PM, Milindu Sanoj Kumarage <
> agentmilindu@gmail.com> wrote:
>
>> Hi,
>>
>> Here I have included the licences of each framework :)
>>
>> *Cement *(6/10)
>> A complex framework, every CLI commands is bound to a separate Python
>> class that acts like an controller, and each controller have several
>> functions. But no 'Interactive Mode' support, just 'Single command line
>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>> via aliases. But no much developments in Github repo recently.
>>
>> http://cement.readthedocs.org/
>>
>> Licence : http://cement.readthedocs.org/en/latest/license/
>> Redistribution and use in source and binary forms, with or without
>> modification, are permitted under given conditions.
>>
>>
>> *Click *(7/10)
>> Rich with features, uses Python Decorators to bind CLI commands to
>> functions. But no 'Interactive Mode' support, just 'Single command line
>> mode'.
>>
>> http://click.pocoo.org/3/
>>
>> Licence :  http://click.pocoo.org/3/license/
>>  three-clause BSD License
>>
>>
>> *Plac *(4/10)
>> A scaled down version of Python argparse package.  Uses set of if else
>> statements to process the commands. But no 'Interactive Mode' support.
>>
>> http://plac.googlecode.com/hg/doc/plac.html
>>
>> Licence: http://plac.googlecode.com/hg/doc/plac.html
>> BSD license
>>
>> *Cliapp *(3/10)
>> No 'Interactive Mode' support.
>>
>> http://code.liw.fi/cliapp/docs/
>>
>> Licence : https://github.com/rshk/CliApp/blob/master/LICENSE
>> Apache License
>>
>>
>> *pyCLI  *(3/10)
>> No 'Interactive Mode' support.
>>
>> http://pythonhosted.org//pyCLI/
>>
>> Licence: http://sourceforge.net/projects/pycli/
>> GNU General Public License version 2.0 (GPLv2)
>>
>>
>> *Cliff *(9/10)
>> A framework for building command line programs by OpenStack. It uses
>> plugins to define sub-commands, output formatters, and other extensions.
>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>
>> http://docs.openstack.org/developer/cliff/index.html
>>
>> Licence: https://launchpad.net/python-cliff
>> Apache Licence
>>
>>
>> *cmd *(8/10)
>> Python in built packages for 'Interactive Mode' applications. Maps CLI
>> commands to functions by function name, as def do_<whatever the command
>> name> ( eg: def do_command1 is for command1 ). Support only arguments
>> but no support for Unix-style flags. Have features like automatic command
>> completion in 'Interactive Mode'.
>>
>> https://docs.python.org/2/library/cmd.html
>>
>> Licence: https://docs.python.org/2/license.html
>> GPL compatible
>>
>>
>> *cmd2 *(9/10)
>> Extends the Python Standard Library’s cmd package.  Can handle arguments
>> and flags.  Supports for Output Redirection and Piping ( As in a Unix shell
>> ). Searchable command history (  bash-like history list editing ), can get
>> last commands with arrow keys. Able to perform shell commands while in
>> Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output can be
>> colored.
>>
>> https://pythonhosted.org/cmd2
>>
>> Licence: https://pypi.python.org/pypi/cmd2/0.6.8
>> MIT License
>>
>> On Wed, Feb 25, 2015 at 10:29 AM, Chamila De Alwis <ch...@wso2.com>
>> wrote:
>>
>>> Great work Milindu. It would be better to add the licenses for each
>>> library too, in case any non-compatible or ambiguous ones might be there.
>>>
>>> IMO using a framework from the standard library would be better, since
>>> the pre-requisites will be minimal.
>>> On Feb 25, 2015 9:55 AM, "Milindu Sanoj Kumarage" <
>>> agentmilindu@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> Here is the JIRA issue on this,
>>>> https://issues.apache.org/jira/browse/STRATOS-1187
>>>>
>>>>
>>>> Here I have added some of the Python CLI frameworks I checked, I have
>>>> added a brief for each of them. I also have state a score out of 10 to
>>>> indicate how best they matches for our need. ( But they are as of my
>>>> understanding! I may not be very correct in some cases.  Because some of
>>>> the ones I could write some codes and check, but for some I could not,
>>>> manly because of errors )
>>>>
>>>> *Cement *(6/10)
>>>> A complex framework, every CLI commands is bound to a separate Python
>>>> class that acts like an controller, and each controller have several
>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>>> via aliases. But no much developments in Github repo recently.
>>>>
>>>> http://cement.readthedocs.org/
>>>>
>>>> *Click *(7/10)
>>>> Rich with features, uses Python Decorators to bind CLI commands to
>>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>>> mode'.
>>>>
>>>> http://click.pocoo.org/3/
>>>>
>>>>
>>>> *Plac *(4/10)
>>>> A scaled down version of Python argparse package.  Uses set of if else
>>>> statements to process the commands. But no 'Interactive Mode' support.
>>>>
>>>> http://plac.googlecode.com/hg/doc/plac.html
>>>>
>>>> *Cliapp *(3/10)
>>>> No 'Interactive Mode' support.
>>>>
>>>> http://code.liw.fi/cliapp/docs/
>>>>
>>>> *pyCLI  *(3/10)
>>>> No 'Interactive Mode' support.
>>>>
>>>> http://pythonhosted.org//pyCLI/
>>>>
>>>>
>>>> *Cliff *(9/10)
>>>> A framework for building command line programs by OpenStack. It uses
>>>> plugins to define sub-commands, output formatters, and other extensions.
>>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>>
>>>> http://docs.openstack.org/developer/cliff/index.html
>>>>
>>>> *cmd *(8/10)
>>>> Python in built packages for 'Interactive Mode' applications. Maps CLI
>>>> commands to functions by function name, as def do_<whatever the
>>>> command name> ( eg: def do_command1 is for command1 ). Support only
>>>> arguments but no support for Unix-style flags. Have features like automatic
>>>> command completion in 'Interactive Mode'.
>>>>
>>>> https://docs.python.org/2/library/cmd.html
>>>>
>>>> *cmd2 *(9/10)
>>>> Extends the Python Standard Library’s cmd package.  Can handle
>>>> arguments and flags.  Supports for Output Redirection and Piping ( As in a
>>>> Unix shell ). Searchable command history (  bash-like history list editing
>>>> ), can get last commands with arrow keys. Able to perform shell commands
>>>> while in Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output
>>>> can be colored.
>>>>
>>>> https://pythonhosted.org/cmd2
>>>>
>>>>
>>>>
>>>>
>>>>
>>
>


-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: GSoC 2015

Posted by Milindu Sanoj Kumarage <ag...@gmail.com>.
Hi,

Then shall we go with Cmd2 python package? Only change we have to do is
call CLI commands with '_ '  instead '-', like 'list_tenants' instead of
'list-tenants'.

And for HTTP request/response handling,  we can use either Python's urllib3
or Requests, a wrapper around urllib3 which gives much simpler API that
leads to  cleaner codes. It's been praised in the community from the
beginning.

Licence: Apache2

http://docs.python-requests.org/en/latest/#

On Wed, Feb 25, 2015 at 3:26 PM, Milindu Sanoj Kumarage <
agentmilindu@gmail.com> wrote:

> Hi,
>
> Here I have included the licences of each framework :)
>
> *Cement *(6/10)
> A complex framework, every CLI commands is bound to a separate Python
> class that acts like an controller, and each controller have several
> functions. But no 'Interactive Mode' support, just 'Single command line
> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
> via aliases. But no much developments in Github repo recently.
>
> http://cement.readthedocs.org/
>
> Licence : http://cement.readthedocs.org/en/latest/license/
> Redistribution and use in source and binary forms, with or without
> modification, are permitted under given conditions.
>
>
> *Click *(7/10)
> Rich with features, uses Python Decorators to bind CLI commands to
> functions. But no 'Interactive Mode' support, just 'Single command line
> mode'.
>
> http://click.pocoo.org/3/
>
> Licence :  http://click.pocoo.org/3/license/
>  three-clause BSD License
>
>
> *Plac *(4/10)
> A scaled down version of Python argparse package.  Uses set of if else
> statements to process the commands. But no 'Interactive Mode' support.
>
> http://plac.googlecode.com/hg/doc/plac.html
>
> Licence: http://plac.googlecode.com/hg/doc/plac.html
> BSD license
>
> *Cliapp *(3/10)
> No 'Interactive Mode' support.
>
> http://code.liw.fi/cliapp/docs/
>
> Licence : https://github.com/rshk/CliApp/blob/master/LICENSE
> Apache License
>
>
> *pyCLI  *(3/10)
> No 'Interactive Mode' support.
>
> http://pythonhosted.org//pyCLI/
>
> Licence: http://sourceforge.net/projects/pycli/
> GNU General Public License version 2.0 (GPLv2)
>
>
> *Cliff *(9/10)
> A framework for building command line programs by OpenStack. It uses
> plugins to define sub-commands, output formatters, and other extensions.
> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>
> http://docs.openstack.org/developer/cliff/index.html
>
> Licence: https://launchpad.net/python-cliff
> Apache Licence
>
>
> *cmd *(8/10)
> Python in built packages for 'Interactive Mode' applications. Maps CLI
> commands to functions by function name, as def do_<whatever the command
> name> ( eg: def do_command1 is for command1 ). Support only arguments but
> no support for Unix-style flags. Have features like automatic command
> completion in 'Interactive Mode'.
>
> https://docs.python.org/2/library/cmd.html
>
> Licence: https://docs.python.org/2/license.html
> GPL compatible
>
>
> *cmd2 *(9/10)
> Extends the Python Standard Library’s cmd package.  Can handle arguments
> and flags.  Supports for Output Redirection and Piping ( As in a Unix shell
> ). Searchable command history (  bash-like history list editing ), can get
> last commands with arrow keys. Able to perform shell commands while in
> Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output can be
> colored.
>
> https://pythonhosted.org/cmd2
>
> Licence: https://pypi.python.org/pypi/cmd2/0.6.8
> MIT License
>
> On Wed, Feb 25, 2015 at 10:29 AM, Chamila De Alwis <ch...@wso2.com>
> wrote:
>
>> Great work Milindu. It would be better to add the licenses for each
>> library too, in case any non-compatible or ambiguous ones might be there.
>>
>> IMO using a framework from the standard library would be better, since
>> the pre-requisites will be minimal.
>> On Feb 25, 2015 9:55 AM, "Milindu Sanoj Kumarage" <ag...@gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> Here is the JIRA issue on this,
>>> https://issues.apache.org/jira/browse/STRATOS-1187
>>>
>>>
>>> Here I have added some of the Python CLI frameworks I checked, I have
>>> added a brief for each of them. I also have state a score out of 10 to
>>> indicate how best they matches for our need. ( But they are as of my
>>> understanding! I may not be very correct in some cases.  Because some of
>>> the ones I could write some codes and check, but for some I could not,
>>> manly because of errors )
>>>
>>> *Cement *(6/10)
>>> A complex framework, every CLI commands is bound to a separate Python
>>> class that acts like an controller, and each controller have several
>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>>> via aliases. But no much developments in Github repo recently.
>>>
>>> http://cement.readthedocs.org/
>>>
>>> *Click *(7/10)
>>> Rich with features, uses Python Decorators to bind CLI commands to
>>> functions. But no 'Interactive Mode' support, just 'Single command line
>>> mode'.
>>>
>>> http://click.pocoo.org/3/
>>>
>>>
>>> *Plac *(4/10)
>>> A scaled down version of Python argparse package.  Uses set of if else
>>> statements to process the commands. But no 'Interactive Mode' support.
>>>
>>> http://plac.googlecode.com/hg/doc/plac.html
>>>
>>> *Cliapp *(3/10)
>>> No 'Interactive Mode' support.
>>>
>>> http://code.liw.fi/cliapp/docs/
>>>
>>> *pyCLI  *(3/10)
>>> No 'Interactive Mode' support.
>>>
>>> http://pythonhosted.org//pyCLI/
>>>
>>>
>>> *Cliff *(9/10)
>>> A framework for building command line programs by OpenStack. It uses
>>> plugins to define sub-commands, output formatters, and other extensions.
>>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>>
>>> http://docs.openstack.org/developer/cliff/index.html
>>>
>>> *cmd *(8/10)
>>> Python in built packages for 'Interactive Mode' applications. Maps CLI
>>> commands to functions by function name, as def do_<whatever the command
>>> name> ( eg: def do_command1 is for command1 ). Support only arguments
>>> but no support for Unix-style flags. Have features like automatic command
>>> completion in 'Interactive Mode'.
>>>
>>> https://docs.python.org/2/library/cmd.html
>>>
>>> *cmd2 *(9/10)
>>> Extends the Python Standard Library’s cmd package.  Can handle arguments
>>> and flags.  Supports for Output Redirection and Piping ( As in a Unix shell
>>> ). Searchable command history (  bash-like history list editing ), can get
>>> last commands with arrow keys. Able to perform shell commands while in
>>> Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output can be
>>> colored.
>>>
>>> https://pythonhosted.org/cmd2
>>>
>>>
>>>
>>>
>>>
>

Re: GSoC 2015

Posted by Milindu Sanoj Kumarage <ag...@gmail.com>.
Hi,

Here I have included the licences of each framework :)

*Cement *(6/10)
A complex framework, every CLI commands is bound to a separate Python class
that acts like an controller, and each controller have several functions.
But no 'Interactive Mode' support, just 'Single command line mode'.
Supports having  '-' in CLI Commands ( like 'create-tenant' ) via aliases.
But no much developments in Github repo recently.

http://cement.readthedocs.org/

Licence : http://cement.readthedocs.org/en/latest/license/
Redistribution and use in source and binary forms, with or without
modification, are permitted under given conditions.


*Click *(7/10)
Rich with features, uses Python Decorators to bind CLI commands to
functions. But no 'Interactive Mode' support, just 'Single command line
mode'.

http://click.pocoo.org/3/

Licence :  http://click.pocoo.org/3/license/
 three-clause BSD License


*Plac *(4/10)
A scaled down version of Python argparse package.  Uses set of if else
statements to process the commands. But no 'Interactive Mode' support.

http://plac.googlecode.com/hg/doc/plac.html

Licence: http://plac.googlecode.com/hg/doc/plac.html
BSD license

*Cliapp *(3/10)
No 'Interactive Mode' support.

http://code.liw.fi/cliapp/docs/

Licence : https://github.com/rshk/CliApp/blob/master/LICENSE
Apache License


*pyCLI  *(3/10)
No 'Interactive Mode' support.

http://pythonhosted.org//pyCLI/

Licence: http://sourceforge.net/projects/pycli/
GNU General Public License version 2.0 (GPLv2)


*Cliff *(9/10)
A framework for building command line programs by OpenStack. It uses
plugins to define sub-commands, output formatters, and other extensions.
Supports  'Interactive Mode'  using 'cmd2' and 'cmd'

http://docs.openstack.org/developer/cliff/index.html

Licence: https://launchpad.net/python-cliff
Apache Licence


*cmd *(8/10)
Python in built packages for 'Interactive Mode' applications. Maps CLI
commands to functions by function name, as def do_<whatever the command
name> ( eg: def do_command1 is for command1 ). Support only arguments but
no support for Unix-style flags. Have features like automatic command
completion in 'Interactive Mode'.

https://docs.python.org/2/library/cmd.html

Licence: https://docs.python.org/2/license.html
GPL compatible


*cmd2 *(9/10)
Extends the Python Standard Library’s cmd package.  Can handle arguments
and flags.  Supports for Output Redirection and Piping ( As in a Unix shell
). Searchable command history (  bash-like history list editing ), can get
last commands with arrow keys. Able to perform shell commands while in
Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output can be
colored.

https://pythonhosted.org/cmd2

Licence: https://pypi.python.org/pypi/cmd2/0.6.8
MIT License

On Wed, Feb 25, 2015 at 10:29 AM, Chamila De Alwis <ch...@wso2.com>
wrote:

> Great work Milindu. It would be better to add the licenses for each
> library too, in case any non-compatible or ambiguous ones might be there.
>
> IMO using a framework from the standard library would be better, since the
> pre-requisites will be minimal.
> On Feb 25, 2015 9:55 AM, "Milindu Sanoj Kumarage" <ag...@gmail.com>
> wrote:
>
>> Hi,
>>
>> Here is the JIRA issue on this,
>> https://issues.apache.org/jira/browse/STRATOS-1187
>>
>>
>> Here I have added some of the Python CLI frameworks I checked, I have
>> added a brief for each of them. I also have state a score out of 10 to
>> indicate how best they matches for our need. ( But they are as of my
>> understanding! I may not be very correct in some cases.  Because some of
>> the ones I could write some codes and check, but for some I could not,
>> manly because of errors )
>>
>> *Cement *(6/10)
>> A complex framework, every CLI commands is bound to a separate Python
>> class that acts like an controller, and each controller have several
>> functions. But no 'Interactive Mode' support, just 'Single command line
>> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
>> via aliases. But no much developments in Github repo recently.
>>
>> http://cement.readthedocs.org/
>>
>> *Click *(7/10)
>> Rich with features, uses Python Decorators to bind CLI commands to
>> functions. But no 'Interactive Mode' support, just 'Single command line
>> mode'.
>>
>> http://click.pocoo.org/3/
>>
>>
>> *Plac *(4/10)
>> A scaled down version of Python argparse package.  Uses set of if else
>> statements to process the commands. But no 'Interactive Mode' support.
>>
>> http://plac.googlecode.com/hg/doc/plac.html
>>
>> *Cliapp *(3/10)
>> No 'Interactive Mode' support.
>>
>> http://code.liw.fi/cliapp/docs/
>>
>> *pyCLI  *(3/10)
>> No 'Interactive Mode' support.
>>
>> http://pythonhosted.org//pyCLI/
>>
>>
>> *Cliff *(9/10)
>> A framework for building command line programs by OpenStack. It uses
>> plugins to define sub-commands, output formatters, and other extensions.
>> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>>
>> http://docs.openstack.org/developer/cliff/index.html
>>
>> *cmd *(8/10)
>> Python in built packages for 'Interactive Mode' applications. Maps CLI
>> commands to functions by function name, as def do_<whatever the command
>> name> ( eg: def do_command1 is for command1 ). Support only arguments
>> but no support for Unix-style flags. Have features like automatic command
>> completion in 'Interactive Mode'.
>>
>> https://docs.python.org/2/library/cmd.html
>>
>> *cmd2 *(9/10)
>> Extends the Python Standard Library’s cmd package.  Can handle arguments
>> and flags.  Supports for Output Redirection and Piping ( As in a Unix shell
>> ). Searchable command history (  bash-like history list editing ), can get
>> last commands with arrow keys. Able to perform shell commands while in
>> Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output can be
>> colored.
>>
>> https://pythonhosted.org/cmd2
>>
>>
>>
>>
>>

Re: GSoC 2015

Posted by Chamila De Alwis <ch...@wso2.com>.
Great work Milindu. It would be better to add the licenses for each library
too, in case any non-compatible or ambiguous ones might be there.

IMO using a framework from the standard library would be better, since the
pre-requisites will be minimal.
On Feb 25, 2015 9:55 AM, "Milindu Sanoj Kumarage" <ag...@gmail.com>
wrote:

> Hi,
>
> Here is the JIRA issue on this,
> https://issues.apache.org/jira/browse/STRATOS-1187
>
>
> Here I have added some of the Python CLI frameworks I checked, I have
> added a brief for each of them. I also have state a score out of 10 to
> indicate how best they matches for our need. ( But they are as of my
> understanding! I may not be very correct in some cases.  Because some of
> the ones I could write some codes and check, but for some I could not,
> manly because of errors )
>
> *Cement *(6/10)
> A complex framework, every CLI commands is bound to a separate Python
> class that acts like an controller, and each controller have several
> functions. But no 'Interactive Mode' support, just 'Single command line
> mode'. Supports having  '-' in CLI Commands ( like 'create-tenant' )
> via aliases. But no much developments in Github repo recently.
>
> http://cement.readthedocs.org/
>
> *Click *(7/10)
> Rich with features, uses Python Decorators to bind CLI commands to
> functions. But no 'Interactive Mode' support, just 'Single command line
> mode'.
>
> http://click.pocoo.org/3/
>
>
> *Plac *(4/10)
> A scaled down version of Python argparse package.  Uses set of if else
> statements to process the commands. But no 'Interactive Mode' support.
>
> http://plac.googlecode.com/hg/doc/plac.html
>
> *Cliapp *(3/10)
> No 'Interactive Mode' support.
>
> http://code.liw.fi/cliapp/docs/
>
> *pyCLI  *(3/10)
> No 'Interactive Mode' support.
>
> http://pythonhosted.org//pyCLI/
>
>
> *Cliff *(9/10)
> A framework for building command line programs by OpenStack. It uses
> plugins to define sub-commands, output formatters, and other extensions.
> Supports  'Interactive Mode'  using 'cmd2' and 'cmd'
>
> http://docs.openstack.org/developer/cliff/index.html
>
> *cmd *(8/10)
> Python in built packages for 'Interactive Mode' applications. Maps CLI
> commands to functions by function name, as def do_<whatever the command
> name> ( eg: def do_command1 is for command1 ). Support only arguments but
> no support for Unix-style flags. Have features like automatic command
> completion in 'Interactive Mode'.
>
> https://docs.python.org/2/library/cmd.html
>
> *cmd2 *(9/10)
> Extends the Python Standard Library’s cmd package.  Can handle arguments
> and flags.  Supports for Output Redirection and Piping ( As in a Unix shell
> ). Searchable command history (  bash-like history list editing ), can get
> last commands with arrow keys. Able to perform shell commands while in
> Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output can be
> colored.
>
> https://pythonhosted.org/cmd2
>
>
>
>
>

Re: GSoC 2015

Posted by Milindu Sanoj Kumarage <ag...@gmail.com>.
Hi,

Here is the JIRA issue on this,
https://issues.apache.org/jira/browse/STRATOS-1187


Here I have added some of the Python CLI frameworks I checked, I have added
a brief for each of them. I also have state a score out of 10 to indicate
how best they matches for our need. ( But they are as of my understanding!
I may not be very correct in some cases.  Because some of the ones I could
write some codes and check, but for some I could not, manly because of
errors )

*Cement *(6/10)
A complex framework, every CLI commands is bound to a separate Python class
that acts like an controller, and each controller have several functions.
But no 'Interactive Mode' support, just 'Single command line mode'.
Supports having  '-' in CLI Commands ( like 'create-tenant' ) via aliases.
But no much developments in Github repo recently.

http://cement.readthedocs.org/

*Click *(7/10)
Rich with features, uses Python Decorators to bind CLI commands to
functions. But no 'Interactive Mode' support, just 'Single command line
mode'.

http://click.pocoo.org/3/


*Plac *(4/10)
A scaled down version of Python argparse package.  Uses set of if else
statements to process the commands. But no 'Interactive Mode' support.

http://plac.googlecode.com/hg/doc/plac.html

*Cliapp *(3/10)
No 'Interactive Mode' support.

http://code.liw.fi/cliapp/docs/

*pyCLI  *(3/10)
No 'Interactive Mode' support.

http://pythonhosted.org//pyCLI/


*Cliff *(9/10)
A framework for building command line programs by OpenStack. It uses
plugins to define sub-commands, output formatters, and other extensions.
Supports  'Interactive Mode'  using 'cmd2' and 'cmd'

http://docs.openstack.org/developer/cliff/index.html

*cmd *(8/10)
Python in built packages for 'Interactive Mode' applications. Maps CLI
commands to functions by function name, as def do_<whatever the command
name> ( eg: def do_command1 is for command1 ). Support only arguments but
no support for Unix-style flags. Have features like automatic command
completion in 'Interactive Mode'.

https://docs.python.org/2/library/cmd.html

*cmd2 *(9/10)
Extends the Python Standard Library’s cmd package.  Can handle arguments
and flags.  Supports for Output Redirection and Piping ( As in a Unix shell
). Searchable command history (  bash-like history list editing ), can get
last commands with arrow keys. Able to perform shell commands while in
Interactive mode.  ( eg: stratos>!ls or stratos>shell ls ) output can be
colored.

https://pythonhosted.org/cmd2

Re: GSoC 2015

Posted by Milindu Sanoj Kumarage <ag...@gmail.com>.
Hi,

Sure, I will prepare a detailed comparison for each framework and package I
checked.

Is this character limitation only for CLI commands OR for any argument that
> is passed?


   yes, only for the CLI commands only.

Re: GSoC 2015

Posted by Lahiru Sandaruwan <la...@wso2.com>.
Hi,

Great to see the project is progressing!

What is the Jira to track this?

Thanks.



On Tue, Feb 24, 2015 at 12:33 PM, Akila Ravihansa Perera <ravihansa@wso2.com
> wrote:

> Hi Milindu,
>
> Welcome to Stratos!
>
> It's great to see that you've already started working on this. Regarding
> your suggestion to use cmd2, I think it's better if you can do some
> research on alternative libraries and list down pros and cons. This is to
> make sure that we're making the best decision possible and not missing out
> on anything much better.
>
> And for the support for "-" character. Perhaps I mis-understood the
> problem but I don't see how this could affect passing an alias value with a
> hyphen character. Is this character limitation only for CLI commands OR for
> any argument that is passed?
>
> Having to use "create tenant <tenant param>" OR "create_tenant <tenant
> param>" is okay, IMO.
>
> Thanks.
>
> On Mon, Feb 23, 2015 at 10:52 PM, Imesh Gunaratne <im...@apache.org>
> wrote:
>
>> Hi Milindu,
>>
>> Good work on researching Python CLI frameworks. It would be great if you
>> could provide a list of available options and reasons for your selection.
>>
>> Regarding the word separator issue, I agree with Martin. We might need to
>> support "-".
>>
>> Thanks
>>
>> On Tue, Feb 24, 2015 at 2:30 AM, Martin Eppel (meppel) <me...@cisco.com>
>> wrote:
>>
>>>  Hi Milindu,
>>>
>>>
>>>
>>> IMHO, not supporting “-“ could be an issue or at least very inconvenient
>>> (not sure what the cli will cover), for example currently alias validation
>>> (e.g. application alias) is set to exclude “_” but to allow “-“ (although I
>>> am not entirely clear why we ?)
>>>
>>>
>>>
>>> I would argue for patterns consistency across all stratos (java and
>>> python), WDYT ?
>>>
>>>
>>>
>>> Thanks
>>>
>>>
>>>
>>> Martin
>>>
>>>
>>>
>>> See ApplicationUtils.java:
>>>
>>> ….
>>>
>>> Pattern ALIAS_PATTERN = Pattern.compile("([a-z0-9]+([-][a-z0-9])*)+");
>>>
>>>
>>>
>>> *From:* Milindu Sanoj Kumarage [mailto:agentmilindu@gmail.com]
>>> *Sent:* Monday, February 23, 2015 12:28 PM
>>> *To:* dev@stratos.apache.org
>>> *Subject:* Re: GSoC 2015
>>>
>>>
>>>
>>> Hi,
>>>
>>>
>>>
>>> Thanks for the quick and detailed reply, I'm confident that I can work
>>> on this. I'll start creating the project proposal.
>>>
>>>
>>>
>>> I have some questions,
>>>
>>> I considered several Python CLI frameworks and packages ( Click, Plac,
>>> Cement, etc ) and found cmd2 package is more suitable for the need.
>>>
>>> It supports both  Interactive mode and Single command line mode. Have
>>> lot of features like auto-complete, history, executing shell commands while
>>> in Interactive Mode, etc. Their coding styles are also very clean and easy
>>> to understand.
>>>
>>>
>>>
>>> do_greet(self, arg):
>>>
>>>     print("Hello ", arg)
>>>
>>>
>>>
>>> this would be,
>>>
>>> stratos>greet Milindu
>>>
>>> Hello Milindu
>>>
>>>
>>>
>>> And it supports Unix-style flags also.
>>>
>>>
>>>
>>>
>>>
>>> Only thing that is `-` can not be used. but `_` is possible.
>>>
>>>
>>>
>>> def do_create_tenant(self, arg):
>>>
>>>     print("Created ")
>>>
>>>
>>>
>>> this could be invoked as either,
>>>
>>>
>>>
>>> stratos>create_tenant
>>>
>>>
>>>
>>> or
>>>
>>>
>>>
>>> stratos>create tenant
>>>
>>>
>>>
>>> Would this be a problem? (  have to accommodate  workarounds to get `-`
>>> into action if you really need them ) I think I  can provide a basic
>>> implementation if you are interested.
>>>
>>>
>>>
>>> Thank you
>>>
>>>
>>>
>>>
>>>
>>> On Mon, Feb 23, 2015 at 9:58 AM, Imesh Gunaratne <im...@apache.org>
>>> wrote:
>>>
>>> Hi Milindu,
>>>
>>>
>>>
>>> It's nice to hear from you! Thanks for introducing yourself, it seems
>>> like you have a good background for this project.
>>>
>>>
>>>
>>> On Mon, Feb 23, 2015 at 1:15 AM, Milindu Sanoj Kumarage <
>>> agentmilindu@gmail.com> wrote:
>>>
>>>
>>>
>>>      1. I'm thinking of using a Python CLI framework instead of writing
>>> from the scratch, in order to increase the reliability and
>>> maintainability.  What's your idea on that?
>>>
>>>
>>>
>>>  Yes definitely! Better to use a Python CLI framework rather than
>>> writing it from scratch.
>>>
>>>
>>>
>>>     2. The final product would be a python script that we run like `$
>>> python stratos.py login` (  or with a wrapper for Linux and Windows
>>> environments like `stratos-cli.sh` ) or python package submitted to Pip
>>> that can be installed to a system as `$pip install stratos-cli`  and
>>> run as `$stratos-cli login`?
>>>
>>>
>>>
>>>  Yes the final deliverable would be a Python based CLI for Stratos
>>> which may include following:
>>>
>>>
>>>
>>> - Need to be implemented for Stratos 4.1.0
>>>
>>> - Communicate with Stratos REST API via HTTPS
>>>
>>> - Authenticate users using Basic Auth/OAuth
>>>
>>> - Implement CLI commands for API methods
>>>
>>> - Each command should have standard CLI features (help, auto-complete,
>>> etc)
>>>
>>> - CLI commands which receives data from the server needs to be properly
>>> printed
>>>
>>> - There are two CLI commands which needs to print Tree structures
>>> (Application definition and Application runtime)
>>>
>>> - Documentation for CLI in Stratos Wiki
>>>
>>>
>>>
>>> It would be great if you could go through the Stratos 4.1.0 API and
>>> existing Java based CLI and prepare a project proposal. Once it is ready we
>>> can review the plan and move forward.
>>>
>>>
>>>
>>> Thanks
>>>
>>>
>>>
>>> --
>>>
>>> Imesh Gunaratne
>>>
>>>
>>>
>>> Technical Lead, WSO2
>>>
>>> Committer & PMC Member, Apache Stratos
>>>
>>>
>>>
>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PMC Member, Apache Stratos
>>
>
>
>
> --
> Akila Ravihansa Perera
> Software Engineer, WSO2
>
> Blog: http://ravihansa3000.blogspot.com
>



-- 
--
Lahiru Sandaruwan
Committer and PMC member, Apache Stratos,
Senior Software Engineer,
WSO2 Inc., http://wso2.com
lean.enterprise.middleware

email: lahirus@wso2.com blog: http://lahiruwrites.blogspot.com/
linked-in: http://lk.linkedin.com/pub/lahiru-sandaruwan/16/153/146

Re: GSoC 2015

Posted by Akila Ravihansa Perera <ra...@wso2.com>.
Hi Milindu,

Welcome to Stratos!

It's great to see that you've already started working on this. Regarding
your suggestion to use cmd2, I think it's better if you can do some
research on alternative libraries and list down pros and cons. This is to
make sure that we're making the best decision possible and not missing out
on anything much better.

And for the support for "-" character. Perhaps I mis-understood the problem
but I don't see how this could affect passing an alias value with a hyphen
character. Is this character limitation only for CLI commands OR for any
argument that is passed?

Having to use "create tenant <tenant param>" OR "create_tenant <tenant
param>" is okay, IMO.

Thanks.

On Mon, Feb 23, 2015 at 10:52 PM, Imesh Gunaratne <im...@apache.org> wrote:

> Hi Milindu,
>
> Good work on researching Python CLI frameworks. It would be great if you
> could provide a list of available options and reasons for your selection.
>
> Regarding the word separator issue, I agree with Martin. We might need to
> support "-".
>
> Thanks
>
> On Tue, Feb 24, 2015 at 2:30 AM, Martin Eppel (meppel) <me...@cisco.com>
> wrote:
>
>>  Hi Milindu,
>>
>>
>>
>> IMHO, not supporting “-“ could be an issue or at least very inconvenient
>> (not sure what the cli will cover), for example currently alias validation
>> (e.g. application alias) is set to exclude “_” but to allow “-“ (although I
>> am not entirely clear why we ?)
>>
>>
>>
>> I would argue for patterns consistency across all stratos (java and
>> python), WDYT ?
>>
>>
>>
>> Thanks
>>
>>
>>
>> Martin
>>
>>
>>
>> See ApplicationUtils.java:
>>
>> ….
>>
>> Pattern ALIAS_PATTERN = Pattern.compile("([a-z0-9]+([-][a-z0-9])*)+");
>>
>>
>>
>> *From:* Milindu Sanoj Kumarage [mailto:agentmilindu@gmail.com]
>> *Sent:* Monday, February 23, 2015 12:28 PM
>> *To:* dev@stratos.apache.org
>> *Subject:* Re: GSoC 2015
>>
>>
>>
>> Hi,
>>
>>
>>
>> Thanks for the quick and detailed reply, I'm confident that I can work on
>> this. I'll start creating the project proposal.
>>
>>
>>
>> I have some questions,
>>
>> I considered several Python CLI frameworks and packages ( Click, Plac,
>> Cement, etc ) and found cmd2 package is more suitable for the need.
>>
>> It supports both  Interactive mode and Single command line mode. Have lot
>> of features like auto-complete, history, executing shell commands while in
>> Interactive Mode, etc. Their coding styles are also very clean and easy to
>> understand.
>>
>>
>>
>> do_greet(self, arg):
>>
>>     print("Hello ", arg)
>>
>>
>>
>> this would be,
>>
>> stratos>greet Milindu
>>
>> Hello Milindu
>>
>>
>>
>> And it supports Unix-style flags also.
>>
>>
>>
>>
>>
>> Only thing that is `-` can not be used. but `_` is possible.
>>
>>
>>
>> def do_create_tenant(self, arg):
>>
>>     print("Created ")
>>
>>
>>
>> this could be invoked as either,
>>
>>
>>
>> stratos>create_tenant
>>
>>
>>
>> or
>>
>>
>>
>> stratos>create tenant
>>
>>
>>
>> Would this be a problem? (  have to accommodate  workarounds to get `-`
>> into action if you really need them ) I think I  can provide a basic
>> implementation if you are interested.
>>
>>
>>
>> Thank you
>>
>>
>>
>>
>>
>> On Mon, Feb 23, 2015 at 9:58 AM, Imesh Gunaratne <im...@apache.org>
>> wrote:
>>
>> Hi Milindu,
>>
>>
>>
>> It's nice to hear from you! Thanks for introducing yourself, it seems
>> like you have a good background for this project.
>>
>>
>>
>> On Mon, Feb 23, 2015 at 1:15 AM, Milindu Sanoj Kumarage <
>> agentmilindu@gmail.com> wrote:
>>
>>
>>
>>      1. I'm thinking of using a Python CLI framework instead of writing
>> from the scratch, in order to increase the reliability and
>> maintainability.  What's your idea on that?
>>
>>
>>
>>  Yes definitely! Better to use a Python CLI framework rather than
>> writing it from scratch.
>>
>>
>>
>>     2. The final product would be a python script that we run like `$
>> python stratos.py login` (  or with a wrapper for Linux and Windows
>> environments like `stratos-cli.sh` ) or python package submitted to Pip
>> that can be installed to a system as `$pip install stratos-cli`  and run
>> as `$stratos-cli login`?
>>
>>
>>
>>  Yes the final deliverable would be a Python based CLI for Stratos which
>> may include following:
>>
>>
>>
>> - Need to be implemented for Stratos 4.1.0
>>
>> - Communicate with Stratos REST API via HTTPS
>>
>> - Authenticate users using Basic Auth/OAuth
>>
>> - Implement CLI commands for API methods
>>
>> - Each command should have standard CLI features (help, auto-complete,
>> etc)
>>
>> - CLI commands which receives data from the server needs to be properly
>> printed
>>
>> - There are two CLI commands which needs to print Tree structures
>> (Application definition and Application runtime)
>>
>> - Documentation for CLI in Stratos Wiki
>>
>>
>>
>> It would be great if you could go through the Stratos 4.1.0 API and
>> existing Java based CLI and prepare a project proposal. Once it is ready we
>> can review the plan and move forward.
>>
>>
>>
>> Thanks
>>
>>
>>
>> --
>>
>> Imesh Gunaratne
>>
>>
>>
>> Technical Lead, WSO2
>>
>> Committer & PMC Member, Apache Stratos
>>
>>
>>
>
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>



-- 
Akila Ravihansa Perera
Software Engineer, WSO2

Blog: http://ravihansa3000.blogspot.com

Re: GSoC 2015

Posted by Imesh Gunaratne <im...@apache.org>.
Hi Milindu,

Good work on researching Python CLI frameworks. It would be great if you
could provide a list of available options and reasons for your selection.

Regarding the word separator issue, I agree with Martin. We might need to
support "-".

Thanks

On Tue, Feb 24, 2015 at 2:30 AM, Martin Eppel (meppel) <me...@cisco.com>
wrote:

>  Hi Milindu,
>
>
>
> IMHO, not supporting “-“ could be an issue or at least very inconvenient
> (not sure what the cli will cover), for example currently alias validation
> (e.g. application alias) is set to exclude “_” but to allow “-“ (although I
> am not entirely clear why we ?)
>
>
>
> I would argue for patterns consistency across all stratos (java and
> python), WDYT ?
>
>
>
> Thanks
>
>
>
> Martin
>
>
>
> See ApplicationUtils.java:
>
> ….
>
> Pattern ALIAS_PATTERN = Pattern.compile("([a-z0-9]+([-][a-z0-9])*)+");
>
>
>
> *From:* Milindu Sanoj Kumarage [mailto:agentmilindu@gmail.com]
> *Sent:* Monday, February 23, 2015 12:28 PM
> *To:* dev@stratos.apache.org
> *Subject:* Re: GSoC 2015
>
>
>
> Hi,
>
>
>
> Thanks for the quick and detailed reply, I'm confident that I can work on
> this. I'll start creating the project proposal.
>
>
>
> I have some questions,
>
> I considered several Python CLI frameworks and packages ( Click, Plac,
> Cement, etc ) and found cmd2 package is more suitable for the need.
>
> It supports both  Interactive mode and Single command line mode. Have lot
> of features like auto-complete, history, executing shell commands while in
> Interactive Mode, etc. Their coding styles are also very clean and easy to
> understand.
>
>
>
> do_greet(self, arg):
>
>     print("Hello ", arg)
>
>
>
> this would be,
>
> stratos>greet Milindu
>
> Hello Milindu
>
>
>
> And it supports Unix-style flags also.
>
>
>
>
>
> Only thing that is `-` can not be used. but `_` is possible.
>
>
>
> def do_create_tenant(self, arg):
>
>     print("Created ")
>
>
>
> this could be invoked as either,
>
>
>
> stratos>create_tenant
>
>
>
> or
>
>
>
> stratos>create tenant
>
>
>
> Would this be a problem? (  have to accommodate  workarounds to get `-`
> into action if you really need them ) I think I  can provide a basic
> implementation if you are interested.
>
>
>
> Thank you
>
>
>
>
>
> On Mon, Feb 23, 2015 at 9:58 AM, Imesh Gunaratne <im...@apache.org> wrote:
>
> Hi Milindu,
>
>
>
> It's nice to hear from you! Thanks for introducing yourself, it seems like
> you have a good background for this project.
>
>
>
> On Mon, Feb 23, 2015 at 1:15 AM, Milindu Sanoj Kumarage <
> agentmilindu@gmail.com> wrote:
>
>
>
>      1. I'm thinking of using a Python CLI framework instead of writing
> from the scratch, in order to increase the reliability and
> maintainability.  What's your idea on that?
>
>
>
>  Yes definitely! Better to use a Python CLI framework rather than writing
> it from scratch.
>
>
>
>     2. The final product would be a python script that we run like `$
> python stratos.py login` (  or with a wrapper for Linux and Windows
> environments like `stratos-cli.sh` ) or python package submitted to Pip
> that can be installed to a system as `$pip install stratos-cli`  and run
> as `$stratos-cli login`?
>
>
>
>  Yes the final deliverable would be a Python based CLI for Stratos which
> may include following:
>
>
>
> - Need to be implemented for Stratos 4.1.0
>
> - Communicate with Stratos REST API via HTTPS
>
> - Authenticate users using Basic Auth/OAuth
>
> - Implement CLI commands for API methods
>
> - Each command should have standard CLI features (help, auto-complete, etc)
>
> - CLI commands which receives data from the server needs to be properly
> printed
>
> - There are two CLI commands which needs to print Tree structures
> (Application definition and Application runtime)
>
> - Documentation for CLI in Stratos Wiki
>
>
>
> It would be great if you could go through the Stratos 4.1.0 API and
> existing Java based CLI and prepare a project proposal. Once it is ready we
> can review the plan and move forward.
>
>
>
> Thanks
>
>
>
> --
>
> Imesh Gunaratne
>
>
>
> Technical Lead, WSO2
>
> Committer & PMC Member, Apache Stratos
>
>
>



-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

RE: GSoC 2015

Posted by "Martin Eppel (meppel)" <me...@cisco.com>.
Hi Milindu,

IMHO, not supporting “-“ could be an issue or at least very inconvenient (not sure what the cli will cover), for example currently alias validation (e.g. application alias) is set to exclude “_” but to allow “-“ (although I am not entirely clear why we ?)

I would argue for patterns consistency across all stratos (java and python), WDYT ?

Thanks

Martin

See ApplicationUtils.java:
….
Pattern ALIAS_PATTERN = Pattern.compile("([a-z0-9]+([-][a-z0-9])*)+");

From: Milindu Sanoj Kumarage [mailto:agentmilindu@gmail.com]
Sent: Monday, February 23, 2015 12:28 PM
To: dev@stratos.apache.org
Subject: Re: GSoC 2015

Hi,

Thanks for the quick and detailed reply, I'm confident that I can work on this. I'll start creating the project proposal.

I have some questions,
I considered several Python CLI frameworks and packages ( Click, Plac, Cement, etc ) and found cmd2 package is more suitable for the need.
It supports both  Interactive mode and Single command line mode. Have lot of features like auto-complete, history, executing shell commands while in Interactive Mode, etc. Their coding styles are also very clean and easy to understand.

do_greet(self, arg):
    print("Hello ", arg)

this would be,
stratos>greet Milindu
Hello Milindu

And it supports Unix-style flags also.


Only thing that is `-` can not be used. but `_` is possible.

def do_create_tenant(self, arg):
    print("Created ")

this could be invoked as either,

stratos>create_tenant

or

stratos>create tenant

Would this be a problem? (  have to accommodate  workarounds to get `-` into action if you really need them ) I think I  can provide a basic implementation if you are interested.

Thank you


On Mon, Feb 23, 2015 at 9:58 AM, Imesh Gunaratne <im...@apache.org>> wrote:
Hi Milindu,

It's nice to hear from you! Thanks for introducing yourself, it seems like you have a good background for this project.

On Mon, Feb 23, 2015 at 1:15 AM, Milindu Sanoj Kumarage <ag...@gmail.com>> wrote:

    1. I'm thinking of using a Python CLI framework instead of writing from the scratch, in order to increase the reliability and maintainability.  What's your idea on that?

Yes definitely! Better to use a Python CLI framework rather than writing it from scratch.

   2. The final product would be a python script that we run like `$ python stratos.py login` (  or with a wrapper for Linux and Windows environments like `stratos-cli.sh` ) or python package submitted to Pip that can be installed to a system as `$pip install stratos-cli`  and run as `$stratos-cli login`?

Yes the final deliverable would be a Python based CLI for Stratos which may include following:

- Need to be implemented for Stratos 4.1.0
- Communicate with Stratos REST API via HTTPS
- Authenticate users using Basic Auth/OAuth
- Implement CLI commands for API methods
- Each command should have standard CLI features (help, auto-complete, etc)
- CLI commands which receives data from the server needs to be properly printed
- There are two CLI commands which needs to print Tree structures (Application definition and Application runtime)
- Documentation for CLI in Stratos Wiki

It would be great if you could go through the Stratos 4.1.0 API and existing Java based CLI and prepare a project proposal. Once it is ready we can review the plan and move forward.

Thanks

--
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos


Re: GSoC 2015

Posted by Milindu Sanoj Kumarage <ag...@gmail.com>.
Hi,

Thanks for the quick and detailed reply, I'm confident that I can work on
this. I'll start creating the project proposal.

I have some questions,
I considered several Python CLI frameworks and packages ( Click, Plac,
Cement, etc ) and found cmd2 package is more suitable for the need.
It supports both  Interactive mode and Single command line mode. Have lot
of features like auto-complete, history, executing shell commands while in
Interactive Mode, etc. Their coding styles are also very clean and easy to
understand.

do_greet(self, arg):
    print("Hello ", arg)

this would be,

stratos>greet Milindu
Hello Milindu

And it supports Unix-style flags also.


Only thing that is `-` can not be used. but `_` is possible.

def do_create_tenant(self, arg):
    print("Created ")

this could be invoked as either,

stratos>create_tenant

or

stratos>create tenant

Would this be a problem? (  have to accommodate  workarounds to get `-`
into action if you really need them ) I think I  can provide a basic
implementation if you are interested.

Thank you


On Mon, Feb 23, 2015 at 9:58 AM, Imesh Gunaratne <im...@apache.org> wrote:

> Hi Milindu,
>
> It's nice to hear from you! Thanks for introducing yourself, it seems like
> you have a good background for this project.
>
> On Mon, Feb 23, 2015 at 1:15 AM, Milindu Sanoj Kumarage <
> agentmilindu@gmail.com> wrote:
>
>>
>>     1. I'm thinking of using a Python CLI framework instead of writing
>> from the scratch, in order to increase the reliability and
>> maintainability.  What's your idea on that?
>>
>
>>
> Yes definitely! Better to use a Python CLI framework rather than writing
> it from scratch.
>
>
>>    2. The final product would be a python script that we run like `$
>> python stratos.py login` (  or with a wrapper for Linux and Windows
>> environments like `stratos-cli.sh` ) or python package submitted to Pip
>> that can be installed to a system as `$pip install stratos-cli`  and run
>> as `$stratos-cli login`?
>>
>> Yes the final deliverable would be a Python based CLI for Stratos which
> may include following:
>
> - Need to be implemented for Stratos 4.1.0
> - Communicate with Stratos REST API via HTTPS
> - Authenticate users using Basic Auth/OAuth
> - Implement CLI commands for API methods
> - Each command should have standard CLI features (help, auto-complete, etc)
> - CLI commands which receives data from the server needs to be properly
> printed
> - There are two CLI commands which needs to print Tree structures
> (Application definition and Application runtime)
> - Documentation for CLI in Stratos Wiki
>
> It would be great if you could go through the Stratos 4.1.0 API and
> existing Java based CLI and prepare a project proposal. Once it is ready we
> can review the plan and move forward.
>
> Thanks
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>

Re: GSoC 2015

Posted by Imesh Gunaratne <im...@apache.org>.
Hi Milindu,

It's nice to hear from you! Thanks for introducing yourself, it seems like
you have a good background for this project.

On Mon, Feb 23, 2015 at 1:15 AM, Milindu Sanoj Kumarage <
agentmilindu@gmail.com> wrote:

>
>     1. I'm thinking of using a Python CLI framework instead of writing
> from the scratch, in order to increase the reliability and
> maintainability.  What's your idea on that?
>

>
Yes definitely! Better to use a Python CLI framework rather than writing it
from scratch.


>    2. The final product would be a python script that we run like `$
> python stratos.py login` (  or with a wrapper for Linux and Windows
> environments like `stratos-cli.sh` ) or python package submitted to Pip
> that can be installed to a system as `$pip install stratos-cli`  and run
> as `$stratos-cli login`?
>
> Yes the final deliverable would be a Python based CLI for Stratos which
may include following:

- Need to be implemented for Stratos 4.1.0
- Communicate with Stratos REST API via HTTPS
- Authenticate users using Basic Auth/OAuth
- Implement CLI commands for API methods
- Each command should have standard CLI features (help, auto-complete, etc)
- CLI commands which receives data from the server needs to be properly
printed
- There are two CLI commands which needs to print Tree structures
(Application definition and Application runtime)
- Documentation for CLI in Stratos Wiki

It would be great if you could go through the Stratos 4.1.0 API and
existing Java based CLI and prepare a project proposal. Once it is ready we
can review the plan and move forward.

Thanks

-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos