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

NOTE: Version 6.x+ wiki has moved here https://github.com/apache/cloudstack-cloudmonkey/wiki, for usage see https://github.com/apache/cloudstack-cloudmonkey/wiki/Usage

Installation

Requirements

cloudmonkey 5.x requires Python 2.6 or above and has following dependencies:

...

Code Block
$ apt-get install python-setuptools
$ easy_install cloudmonkey

Building from source code

...

cloudmonkey is moved to a separate git repo

...

The following configuration parameters can be configured by using the 'set' command in cloudmonkey:

Key

Purpose

Default

profileManagement server profile namelocal

url

Management server API url (it should contain full url with protocol, port etc and paths)

http://localhost:8080/client/api

timeout

Timeout interval for polling async commands

3600

apikey

User api key

""

secretkey

User secret key

""

color

Enable coloured output, set to false to disable

true

verifysslcertEnables/Disables SSL certification verification when making HTTP calls (per server profile)true
usernameCloudStack user nameadmin
passwordCloudStack user passwordpassword

color

Enable coloured output, set to false to disable

true

prompt

cloudmonkey prompt

>

display

Line based, JSON, or tabular output, set to default or json or table

default

log_file

Log file

~/.cloudmonkey/log

history_file

History file

~/.cloudmonkey/history

asyncblock

Poll for async commands, making it false will cause cloudmonkey to return jobid

true

paramcompletion

Tries to predict api for listing a parameter value for an api, experimental may fail

false

Usage

Getting started

By default cloudmonkey will create 'local' server profile when it will start.

true

Note: If both username/password and apikey/secretkey are set (i.e. have non-empty values), apikey and secretkey are used while making HTTP API calls.

Usage

Getting started

By default cloudmonkey will create 'local' server profile when it will start.

First First set the management server API url, apikey and secretkey etc.

...

Code Block
> list users account=admin username=admin filter=account,accountid,accounttype,created,domain
{
  "count": 1,
  "user": [
    {
      "account": "admin",
      "accountid": "dc8ece35-9f03-401f-95f1-2db99c467e1c",
      "accounttype": 1,
      "created": "2013-04-03T02:13:25-0500",
      "domain": "ROOT"
    }
  ]
}
 "accounttype": 1,
      "created": "2013-04-03T02:13:25-0500",
      "domain": "ROOT"
    }
  ]
}

Filtering output

CloudMonkey can filter output based on keys. Starting 5.3.0, filter is supported for all display outputs (json, default and table) and autocompletion works as well.

Code Block
> list users filter=<tab><tab>
account,             accounttype,         created,             domainid,            firstname,           iscallerchilddomain, lastname,            state,               username,           
accountid,           apikey,              domain,              email,               id,                  isdefault,           secretkey,           timezone,           
> list users filter=id,username,firstname,lastname,

id = ef33f4a0-e7cf-11e3-a8a4-005056867a67
firstname = admin
lastname = cloud
username = admin
================================================================================
id = d052dfb3-828c-4fa3-9e72-75f4795bb554
firstname = रोहित
lastname = यादव
username = रोहित

Emacs style key handling

Ctrl+a (start of the line)
Ctrl+e (end of the line)
Ctlr+w (remove one word from back)
Ctrl+u (remove whole line) etc.

...

Code Block
> list accounts listall=true | grep '^id\ ='
> list users | wc -l
> list routers | more

...