After some discussion on the dev ML[1], we decided to move tools/cli which
contained cloudmonkey to a new git repository [2]. We did that by retaining
its history. In this commit, we remove tools/cli and add information on where
to find cloudmonkey. This is help us speed up cloudmonkey's development and
releases, now that with ApiDiscovery it's completely independent of any other
CloudStack modules.
[1] http://markmail.org/message/tjlr753xfhpw4uk4
[2] https://git-wip-us.apache.org/repos/asf?p=cloudstack-cloudmonkey.git
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This fix removes junk from 6e22843acb6bbd61260849fac171bba61ac6650f which was
supposed to just improve error messages and not messup the whole async block
logic and go into an infinite recursion or fail with some key error.
Signed-off-by: Rohit Yadav <rohit.yadav@wingify.com>
Fixed list processing that uses lambdas to use x.lower() assuming x is string,
and not forced/caster str.lower(obj)
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
- Remove tabularize field
- Now display types are: default, json and table
- Make requester pep8 compliant
- Remove unnecessary comments, if we want them we should put them on each method
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
Added
1. display = [default|json|tabularize] has been added in the config to replace tabularize = [true|false]
2. tabularize is deprecated but we will still set it as "false" once the user removes it out of their config to avoid throwing an error. This will be removed in the next major version.
3. display = "default" is added to the [ui] section of the config if it is not present.
4. You can now output JSON formatted text by setting the config display = json
5. You can now filter text in JSON output mode. (i.e. list users account=grudzien filter=account,id,email). Filtered output returns a properly formatted JSON document.
Removed
1. Removed the printing of attr keys in read_config().
Deprecated
1. tabularize = [true|false] is now messaged as deprecated.
Signed-off-by: Justin Grudzien <grudzien@gmail.com>
The patch adds feature in cloudmonkey to have multiple profiles by passing
custom cfg file to set custom profile in both interactive shell and cmd line tool
use cases.
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
minor pom refactor to put all the tools under one placeholder pom.
Also adds a profile for marvin to run deployDataCenter via mvn options.
$mvn -Pdeveloper,marvin -pl :cloud-marvin -Dmarvin.config=<path/to/config>
OR
$cd tools/marvin
$mvn -Pmarvin -pl :cloud-marvin -Dmarvin.config=path/to/config
will deploy the datacenter using the marvin.config property's value
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
- Fixes metaprogramming to inject methods during shell class object's runtime
- This enable new apis that are synced to come up with new verbs, docs etc.
- Fixes printing issue
- Fixes null bitfield parsing issue
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
- Pygments based colored output for tabular and normal list outputs
- Fix cfg processing as per new cfg paths and ds
- Get rid of clint and old way of parsing and color printing
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
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>
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>
If asyncblock is set to true, prints dots as polling requests are made.
When result is obtained, dots are wiped and result is printed.
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
- 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 handles shell loop
- Handles any control breaks without breaking the shell
- Handles ctrl+c to start afresh on the shell
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>