9 Commits

Author SHA1 Message Date
Rohit Yadav
233c0adcf3 cli: Fix common.py's cfg fields grouped under similarites like ui, core, user etc.
Changes config path to ~/.cloudmonkey this will break cfg path but all configs are
still backward compatible. We need folder to put a lot of stuff that is coming
for ex. themes and plugins

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-28 17:52:40 -08:00
Rohit Yadav
ddb794d960 cli: generate verbs on the fly, fix autocompletion whitespace bug
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-26 17:14:09 -08:00
Prasanna Santhanam
75b059e6e4 cloudmonkey: misses a couple of verbs for 'lock' and 'disassociate'
The following api commands have no cloudmonkey equivalent because
cloudmonkey grammar misses the related verbs.

~/tools/cli/cloudmonkey/marvin/cloudstackAPI(branch:master*) $ ls disassociateIpAddress.py
disassociateIpAddress.py

------------------------------------------------------------
~/tools/cli/cloudmonkey/marvin/cloudstackAPI(branch:master*) $ ls lock*
lockAccount.py lockUser.py
------------------------------------------------------------

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-01-23 16:05:41 +05:30
Rohit Yadav
8f51c630bd CLOUDSTACK-545: Tabularize cloudmonkey's response using filter=<fields,> argument
- 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>
2012-12-20 16:33:08 -08:00
Rohit Yadav
3b2e715888 cli: string fixes, use the major,minor version numbers same as CloudStack
<cloudstack major>.<cloudstack minor>.<cloudmonkey increment number>

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-20 14:56:34 +05:30
Rohit Yadav
5a2e15f67c CLOUDSTACK-522: Log requests in cloudmonkey's log
Patch fixes cloudmonkey to log requests in the log_file.
Summary:
  - Fixes logger
  - Fixes color print issue
  - Fixes welcome message
  - Makes code pep8 compliant

BUG-ID : CLOUDSTACK-522
Reviewed-by: Rohit Yadav <bhaisaab@apache.org>
Reported-by: Rohit Yadav

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-20 12:20:23 +05:30
Chip Childers
311ef69a77 CLOUDSTACK-514: Added protocol and path support to cloudmonkey.
This is the second half of making cloudmonkey and marvin more
flexible in environments that may have https enabled and / or
a different path for the cloudstack API.

Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-11-19 14:24:10 -05:00
Rohit Yadav
dc3c263d0f cli: move common code to common module
- Move config, grammar to common
- Cleanup cloudmonkey.py, import from common
- Import precached verbs, if fails init to {}

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-19 05:28:23 +05:30
Rohit Yadav
7f08c9db57 cli: rename version to common
The idea is to refactor and put common code in common module

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-19 05:28:23 +05:30