...
Code Block |
---|
[core] log_file = /Users/bhaisaab/.cloudmonkey/log asyncblock = true paramcompletion = false history_file = /Users/bhaisaab/.cloudmonkey/history [ui] color = true prompt = > tabularizedisplay = falsedefault [user] secretkey = apikey = [server] path = /client/api host = localhost protocol = http port = 8080 timeout = 3600 |
...
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 | /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 | ||
prompt | cloudmonkey prompt | > | ||
display | Line based, JSON, or | tabularize | Enable tabular output, set to true to ensable default or json or table | default false |
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 |
...
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. |
...
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 |
---|
> set tabularizedisplay truetable |
Examples:
Code Block |
---|
> list domainsusers listallaccount=true > list domains listall=trueadmin username=admin filter=id,name,path |
...
account,accountid,accounttype,created,domain
count = 1
user:
+---------+--------------------------------------+-------------+--------------------------+--------+
| account | accountid | accounttype | created | domain |
+---------+--------------------------------------+-------------+--------------------------+--------+
| admin | dc8ece35-9f03-401f-95f1-2db99c467e1c | 1 | 2013-04-03T02:13:25-0500 | ROOT |
+---------+--------------------------------------+-------------+--------------------------+--------+
|
Tabular output comes with filtering, using filter parameter you can ask cloudmonkey to filter particular columns (like select field of mysql).
JSON output formats cloudmonkey's output into pretty generated JSON documents. Filtering may also be used to limit the result set. Even with filtering, a valid JSON document is generated and may be saved into an external file and processed with your favorite programming language. If your present cli does not have this, pl. upgrade cloudmonkey: pip install --upgrade cloudmonkey
To enable json output:
Code Block |
---|
> set display json
|
Examples:
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"
}
]
}
|
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.
...