Versions Compared

Key

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

...

Make sure your management server is running, try out some commandsdiscover and sync/pull latest apis:

Code Block
> <tab><tab>sync
>324 listAPIs <tab><tab>
>discovered listand users <tab><tab>cached

Getting help

Help for any command can be obtained using help <cmd> or ?<cmd> or <cmd> --help or <cmd> -h, examples:

Code Block

> help list
> help list users
> ?list
> ?list users
> list users --help
> list users -h

...

The sync command in cloudmonkey pull a list of apis which are accessible to your user role, along with help docs etc. and stores the cache in ~/.cloudmonkey/cache. This allows cloudmonkey to be adaptable to changes in mgmt server, so in case the sysadmin enables a plugin such as Nicira NVP for that user role, the users can get those changes. New verbs and grammar (DSL) rules are created on the fly. A failsafe precache is bundled with the distribution but users are

Note: This features requires ApiDiscovery plugin to be enabled at the management server and it is enabled by default starting ACS 4.1 version.

Try autocompletion using tabbing:

Code Block

> <tab><tab>
> list <tab><tab>
> list users <tab><tab>

Getting help

Help for any command can be obtained using help <cmd> or ?<cmd> or <cmd> --help or <cmd> -h, examples:

Code Block

> help list
> help list users
> ?list
> ?list users
> list users --help
> list users -h

A typical help doc for an api will list all available acceptable arguments and required arguments.

Example help for listUsers api:

Code Block

> help list users
(listUsers) Lists user accounts
Parameters
==========
id = (uuid) List user by ID.
keyword = (string) List by keyword
accounttype = (long) List users by account type. Valid types include admin, domain-admin, read-only-admin, or user.
username = (string) List user by the username
domainid = (uuid) list only resources belonging to the domain specified
page = (integer) 
pagesize = (integer) 
listall = (boolean) If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false
state = (string) List users by state of the user account.
isrecursive = (boolean) defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.
account = (string) list resources by account. Must be used with the domainId parameter.

Tabular output

You may enable tabular listing and even choose set of column fields, this allows you to create your own field using the filter param which takes in comma separated argument. If argument has a space, put them under double quotes. The create table will have the same sequence of field filters provided. If your present cli does not have this, pl. upgrade cloudmonkey: pip install --upgrade cloudmonkey
To enable tabular output:

...

Code Block
> list domains listall=true
> list domains listall=true filter=id,name,path

Tabular output comes with filtering, using filter parameter you can ask cloudmonkey to filter particular columns (like select field of mysql).

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.

...

Ctrl+R etc. If it does not work and also any issue with tab completion it's probably a readline issue on your env. If autocompletion using tabs does not work for you, pl. open an issue on jira, issues.a.o

Comments within shell

Anything after # is treated as comment and is not processed on the shell.an issue on jira, issues.a.o

Debug log

By default cloudmonkey logs in ~/.cloudmonkey_log which can be changed using the set command:

...

Code Block
> tail -f ~/.cloudmonkey_/log

Using as a command line tool

...

Use the special command api to send a raw api. It does not do autocompletion and assumes the user knows what he's trying to do.
For
For example:

Code Block

> api uploadVolume url=xxx format=yyy name=zzz zoneid=aaa

In latest version, we can directly call a raw api on the shell with parameters, example:

Code Block
> api uploadVolume url=xxx format=yyy name=zzz zoneid=aaa

...

This causes an async command in cloudmonkey to return a jobid which can be used to poll the completion of that command. This is particularly useful if one wants to starts a lot of VMs without having to wait for the commands to complete. The job can be polled using query async job command, liketo return a jobid which can be used to poll the completion of that command. This is particularly useful if one wants to starts a lot of VMs without having to wait for the commands to complete. The job can be polled using query async job command, like:

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 uuid.
Example:

Code Block
> querylist asyncjobresultusers jobid=<job-id>id=
cd58ff50-8642-11e2-9a8b-37057334a9b2

TODOs

0. Unicode support
1. Bash/zsh completion (example: https://github.com/bobthecow/git-flow-completion/)

...