Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Usable as a command line tool and interactive shell
  • Management server profiles: select, customize and use different server profiles using 
  • All commands are lowercase unlike API
  • Api Discovery using sync feature, with build time api precaching for failsafe sync
  • Raw api execution support
  • Auto-completion via double <tab>
  • Reverse search using Ctrl+R
  • Emacs compatible keybindings
  • Pipeable output
  • Unix shell execution
  • Support to handle async jobs using user defined blocking or non-blocking way
  • Tabular or JSON output with filtering of table columns
  • Colored output
  • Unicode support
  • Api parameter value completion (based on predication, fuzzy results may fail sometimes)

Installation

Requirements

cloudmonkey requires Python 2.5 6 or above and has following dependencies:

Code Block
readline
requests
Pygments
prettytable

argcomplete

Platform independent installation

...

Code Block
$ git clone https://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey.git
# Run mgmt server and run "cloudmonkey sync", this is only for build time cache generation using cachemaker.py
$ python setup.py build 
$ python setup.py install

...

Code Block
[core]
profile = local
asyncblock = true
paramcompletion = falsetrue
history_file = /Users/bhaisaab/.cloudmonkey/history
log_file = /Users/bhaisaab/.cloudmonkey/log
cache_file = /Users/bhaisaab/.cloudmonkey/cache

[ui]
color = true
prompt = >
display = default

[local]
url = http://localhost:8080/client/api
username = admin
password = password
apikey =
secretkey =
timeout = 3600
expires = 600

...

Make sure your management server is running, discover and sync/pull latest apis:

Code Block
> sync
324500 APIs discovered and cached

...

Code Block
> query asyncjobresult jobid=<job-id>

Parameter completion

A fuzzy implementation of parameter completion for an api is an experimental feature (a full proof feature would require annotations on each api cmd), this lets user complete a param on tabbing. It can be enabled by setting paramcompletion to true. At present it only works for only those params which accept a uuidStarting 5.3.0 version, parameter implementation works well for api arguments which are of uuid and boolean types. It can be enabled by setting paramcompletion to true. To automatically find out how to get values for a api arg it uses two heuristics (list apis and most likely related list api) so it is quite possible there are corner cases where this may fail. Whenever a list api is called or when parameter completion calls a list api in background, those results (pair of uuid and name strings) are cached by CloudMonkey to speed up rendering. The cache is kept for next 10-15 mins, after which a list api is called again in the background.
Example:

Code Block
> list users id=
cd58ff50-8642-11e2-9a8b-37057334a9b2

TODOs

...

 user1

About

cloudmonkey was named after the beloved mascot of Apache CloudStack.
Author Dev ML: The Apache CloudStack Team <cloudstack-dev@incubator<dev@cloudstack.apache.org>
Maintainer: Rohit Yadav <bhaisaab@apache.org>