Return-Path: X-Original-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B4593DCC3 for ; Wed, 12 Dec 2012 23:59:21 +0000 (UTC) Received: (qmail 98649 invoked by uid 500); 12 Dec 2012 23:59:21 -0000 Delivered-To: apmail-incubator-cloudstack-dev-archive@incubator.apache.org Received: (qmail 98607 invoked by uid 500); 12 Dec 2012 23:59:21 -0000 Mailing-List: contact cloudstack-dev-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-dev@incubator.apache.org Received: (qmail 98597 invoked by uid 99); 12 Dec 2012 23:59:21 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Dec 2012 23:59:21 +0000 Date: Wed, 12 Dec 2012 23:59:21 +0000 (UTC) From: "Rohit Yadav (JIRA)" To: cloudstack-dev@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CLOUDSTACK-545) Tabularize the cloudmonkey response MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CLOUDSTACK-545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13530507#comment-13530507 ] Rohit Yadav commented on CLOUDSTACK-545: ---------------------------------------- There are a lot of fields, printing them all in a table won't make sense, what I can implement is something like a selector for every api (like we have in mysql), so you can select and create the output view... example code that prints result as a table: diff --git a/tools/cli/cloudmonkey/cloudmonkey.py b/tools/cli/cloudmonkey/cloudmonkey.py index 8ceba4a..083f7f1 100644 --- a/tools/cli/cloudmonkey/cloudmonkey.py +++ b/tools/cli/cloudmonkey/cloudmonkey.py @@ -34,6 +34,7 @@ try: from clint.textui import colored from ConfigParser import ConfigParser, SafeConfigParser + from prettytable import PrettyTable from urllib2 import HTTPError, URLError from httplib import BadStatusLine @@ -169,6 +170,9 @@ class CloudStackShell(cmd.Cmd): return def print_result_as_dict(result): + printer = PrettyTable(result.keys()) + printer.add_row(result.values()) + print printer for key in result.keys(): if not (isinstance(result[key], list) or isinstance(result[key], dict)): > Tabularize the cloudmonkey response > ----------------------------------- > > Key: CLOUDSTACK-545 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-545 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the default.) > Components: Cloudmonkey, Test Tools > Reporter: Prasanna Santhanam > > cloudmonkey responses would be more sensible and easier on the eye if they can look tabular similar to the ec2 tools. enhance cloudmonkey to support tabular formatting instead of sequential lists of the response -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira