Versions Compared

Key

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

...

Panel

cloudmonkey is a command line interface (CLI) tool for CloudStack written in python that leverages Marvin that provides cloudstackAPIPython. cloudmonkey can be use both as an interactive shell and as a command line tool which simplifies CS configuration and management. It is unofficially distributed by community maintained distribution at the cheese shop http://pypi.python.org/pypi/cloudmonkey/ as well as within the git repository in tools/cli/. It can be used with Apache CloudStack 4.0-incubating and above.

...

  • Usable as a command line tool and interactive shell
  • All commands are lowercase unlike API
  • Precached APIs, doc strings and paramsApi 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 output with filtering of table columns
  • Colored output
  • Api parameter value completion (based on predication, fuzzy results may fail sometimes)

Installation

Requirements

cloudmonkey requires Python 2.5 or above and has following dependencies:

Code Block
readline
Pygments
clintprettytable

Platform independent installation

...

Code Block
$ git clone https://git-wip-us.apache.org/repos/asfgit clone https://git-wip-us.apache.org/repos/asf/incubator-cloudstack.git
$ mvn clean install -P developer
$# cd Run mgmt server and run cloudmonkey sync, this is only for build time cache generation using cachemaker.py
$ cd tools/cli # cloudmonkey-x.x.x.tar.gz will be built in dist
$ python setup.py build #
$ python setup.py install

Configuration

cloudmonkey gets reads configuration from ~/.cloudmonkey_/config which is it's config file in user's home directory/.cloudmonkey.

Further it logs in ~/.cloudmonkey_/log and , stores history in ~/.cloudmonkey_/history . The log and history and caches discovered apis in ~/.cloudmonkey/cache. Only the log and history files can be custom paths and can be configured by setting appropriate file paths in ~/.cloudmonkey_/config or by command:

Code Block
$ cloudmonkey
> set history_file /usr/share/cloudmonkey_history
> set log_file /var/log/cloudmonkey

There are other parameters which can be customized:

Typical ~/.cloudmonkey/config:

Code Block

[core]
log_file = /Users/bhaisaab/.cloudmonkey/log
asyncblock = true
paramcompletion = false
history_file = /Users/bhaisaab/.cloudmonkey/history

[ui]
color = true
prompt = > 
tabularize = false

[user]
secretkey = 
apikey = 

[server]
path = /client/api
host = localhost
protocol = http
port = 8080
timeout = 3600

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

Key

Purpose

Default

host

IP or resolvable domain of management server

Key

Purpose

Default

host

IP or resolvable domain of management server

localhost

port

Api server port, 8080 is encouraged over 8096

8080

protocol

Specifies http or https

http

path

Specifies the absolute path to the api on the specified host host

/client/api

timeout

Timeout interval for polling async commands

3600 /client/api

apikey

User api key

""

secretkey

User secret key

""

prompt

cloudmonkey prompt, default prompt has a UTF-8 char which can be an issue

🐵 cloudmonkey>

asyncblock

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

true

secret key

""

timeout

Timeout interval for polling async commands

3600

color

Enable coloured output, set to false to disable

true

prompt

cloudmonkey prompt

>

tabularize

Enable tabular output, set to true to ensable

false

log_file

Log file

~/.cloudmonkey_/log

history_file

History file

~/.cloudmonkey_history /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

First set your host, port, apikey and secretkey using set. Api and Secret keys can be created via CloudStack management server UI, Accounts->Users->Generate keys.

...