- Adds new cloudmonkey config field, tabularize
- If tabularize is set to true, all the list of dict in response are printed as
table
- The columns of the tables can be filtered using the filter= argument, for ex:
list domains listall=true filter=id,name,path
- filter arg will take comma separated values, if they have space put them under
quotes
- Empty filter argument will cause it to print the whole table
- Multiple fields with the same name will cause it to print the column again
- In case there is a typo in the field, that column is skipped. It takes an
intersection of response dict keys and filter keys provided
- Uses opensource prettytable library to pretty print tabular data
TODOs:
- Handle recursive table printing for nested list of dicts
- Colorize table columns if community wants such a feature
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
- fix weird autocompletion bug which won't let you enter the letter b [0]
- make set params, api and secret key vars lowercase
- use partition to get strings for do_set
- while installing, check and only then add readline (requires gcc and can fail)
- show monkey prompt by default, let users change if needed
[0] http://superuser.com/questions/297527/cant-type-the-b-letter-in-python-shell-in-os-x
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
Patch makes cloudmonkey installable and redistributable using source dist from
pypi under apache compliant license. Most visible issues have been solved and
cloudmonkey should work well with CloudStack 4.0 and master, also until APIs do
not change.
To install now:
pip install cloudmonkey
or, if you have to:
easy_install cloudmonkey
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
Version are named in reflection of CloudStack.
<cli major-version>.<cloudstack minor>.<cloudstack.major>
So, for CloudStack 4.1.0, version for cli should be 0.1.4
To create distribution:
python setup.py sdist
python setup.py install
Using pip:
pip install dist/cloudmonkey*
Or pretty soon, from cheese shop:
pip install cloudmonkey
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>