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:[email protected]]
Sent: Monday, February 23, 2015 12:28 PM
To: [email protected]
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
<[email protected]<mailto:[email protected]>> 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
<[email protected]<mailto:[email protected]>> 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