Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 59832FE42 for ; Wed, 20 Mar 2013 01:41:27 +0000 (UTC) Received: (qmail 30307 invoked by uid 500); 20 Mar 2013 01:41:19 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 30246 invoked by uid 500); 20 Mar 2013 01:41:19 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 29308 invoked by uid 99); 20 Mar 2013 01:41:18 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Mar 2013 01:41:18 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 2F02F3D43F; Wed, 20 Mar 2013 01:41:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: muralireddy@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [9/50] [abbrv] git commit: refs/heads/gslb-wip - CLOUDSTACK-825: Fix CloudMonkey docs Message-Id: <20130320014118.2F02F3D43F@tyr.zones.apache.org> Date: Wed, 20 Mar 2013 01:41:18 +0000 (UTC) CLOUDSTACK-825: Fix CloudMonkey docs Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/e74dd13f Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/e74dd13f Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/e74dd13f Branch: refs/heads/gslb-wip Commit: e74dd13f7fdcf55d51eb32179ce2072ed83aa3e6 Parents: edaa72d Author: Sebastien Goasguen Authored: Fri Mar 15 05:51:29 2013 -0400 Committer: Sebastien Goasguen Committed: Fri Mar 15 05:52:46 2013 -0400 ---------------------------------------------------------------------- docs/en-US/cloudmonkey.xml | 84 ++++++++++++++++++++++++++++---------- 1 files changed, 62 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e74dd13f/docs/en-US/cloudmonkey.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/cloudmonkey.xml b/docs/en-US/cloudmonkey.xml index 0057562..5665ed4 100644 --- a/docs/en-US/cloudmonkey.xml +++ b/docs/en-US/cloudmonkey.xml @@ -24,7 +24,7 @@
CloudMonkey - CloudMonkey is the &PRODUCT; Command Line Interface (CLI). It is written in Python and leverages Marvin. CloudMonkey can be used both as an interactive shell and as a command line tool which simplifies &PRODUCT; configuration and management. + CloudMonkey is the &PRODUCT; Command Line Interface (CLI). It is written in Python. CloudMonkey can be used both as an interactive shell and as a command line tool which simplifies &PRODUCT; configuration and management. It can be used with &PRODUCT; CloudStack 4.0-incubating and above CloudMonkey is still under development and should be considered a Work In Progress (WIP), the wiki is the most up to date documentation: https://cwiki.apache.org/CLOUDSTACK/cloudstack-cloudmonkey-cli.html @@ -32,13 +32,15 @@
Installing CloudMonkey - There are two ways to get CloudMonkey: - + CloudMonkey is dependent on readline, pygments, prettytable, when installing from source you will need to resolve those dependencies. Using the cheese shop, the dependencies will be automatically installed. + There are three ways to get CloudMonkey. Via the official &PRODUCT; source releases or via a community maintained distribution at the cheese shop. Developers can also get it directly from the git repository in tools/cli/. + + - Via the official Apache &PRODUCT; releases (starting with 4.1). + Via the official Apache &PRODUCT; releases as well as the git repository. Configuration - To configure CloudMonkey you can edit the .cloudmonkey_config file in the user's home directory as shown below. The values can also be set interactively at the cloudmonkey prompt + To configure CloudMonkey you can edit the ~/.cloudmonkey/config file in the user's home directory as shown below. The values can also be set interactively at the cloudmonkey prompt. Logs are kept in ~/.cloudmonkey/log, and history is stored in ~/.cloudmonkey/history. Discovered apis are listed 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 -$ cat .cloudmonkey_config -[CLI] -protocol = http +$ cat ~/.cloudmonkey/config +[core] +log_file = /Users/sebastiengoasguen/.cloudmonkey/log asyncblock = true +paramcompletion = false +history_file = /Users/sebastiengoasguen/.cloudmonkey/history + +[ui] color = true -prompt = cloudmonkey> -history_file = /Users/sebastiengoasguen/.cloudmonkey_history -host = localhost +prompt = > +tabularize = false + +[user] +secretkey =VDaACYb0LV9eNjTetIOElcVQkvJck_J_QljX_FcHRj87ZKiy0z0ty0ZsYBkoXkY9b7eq1EhwJaw7FF3akA3KBQ +apikey = plgWJfZK4gyS3mOMTVmjUVg-X-jlWlnfaUJ9GAbBbf9EdMkAYMmAiLqzzq1ElZLYq_u38zCm0bewzGUdP66mg + +[server] path = /client/api +host = localhost +protocol = http port = 8080 -apikey = plgWJfZK4gyS3mOMTVmjUVg-X-jlWlnfaUJ9GAbBbf9EdM-kAYMmAiLqzzq1ElZLYq_u38zCm0bewzGUdP66mg -secretkey = VDaACYb0LV9eNjTetIOElcVQkvJck_J_QljX_FcHRj87ZKiy0z0ty0ZsYBkoXkY9b7eq1EhwJaw7FF3akA3KBQ -timeout = 600 -log_file = /Users/sebastiengoasguen/.cloudmonkey_log +timeout = 3600 - The values can also be set at the cloudmonkey prompt. The API and secret keys are obtained via the &PRODUCT; UI or via a raw api call. + The values can also be set at the CloudMonkey prompt. The API and secret keys are obtained via the &PRODUCT; UI or via a raw api call. set prompt myprompt> +☁ Apache CloudStack cloudmonkey 4.1.0-snapshot. Type help or ? to list commands. + +> set prompt myprompt> myprompt> set host localhost myprompt> set port 8080 myprompt> set apikey myprompt> set secretkey ]]> - You can use cloudmonkey to interact with a local cloud, and even with a remote public cloud. You just need to set the host value properly and obtain the keys from the cloud administrator. + You can use CloudMonkey to interact with a local cloud, and even with a remote public cloud. You just need to set the host value properly and obtain the keys from the cloud administrator. +
+ +
+ API Discovery + + In &PRODUCT; 4.0.* releases, the list of api calls available will be pre-cached, while starting with &PRODUCT; 4.1 releases and above an API discovery service is enabled. CloudMonkey will discover automatically the api calls available on the management server. The sync command in CloudMonkey pulls a list of apis which are accessible to your user role, along with help docs etc. and stores them 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. + + To discover the APIs available do: + + > sync +324 APIs discovered and cached + +
+ +
+ Tabular Output + The number of key/value pairs returned by the api calls can be large resulting in a very long output. To enable easier viewing of the output, a tabular formatting can be setup. 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 + To enable it, use the set function and create filters like so: + +> set tabularize true +> list users filter=id,domain,account +count = 1 +user: ++--------------------------------------+--------+---------+ +| id | domain | account | ++--------------------------------------+--------+---------+ +| 7ed6d5da-93b2-4545-a502-23d20b48ef2a | ROOT | admin | ++--------------------------------------+--------+---------+ +
Interactive Shell Usage - To start learning cloudmonkey, the best is to use the interactive shell. Simply type cloudmonkey at the prompt and you should get the interactive shell. - At the cloudmonkey prompt press the tab key twice, you will see all potential verbs available. Pick on, enter a space and then press tab twice. You will see all actions available for that verb + To start learning CloudMonkey, the best is to use the interactive shell. Simply type CloudMonkey at the prompt and you should get the interactive shell. + At the CloudMonkey prompt press the tab key twice, you will see all potential verbs available. Pick on, enter a space and then press tab twice. You will see all actions available for that verb