You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Justin Grudzien <gr...@gmail.com> on 2013/04/03 22:34:13 UTC

Review Request: Improvement CLOUDSTACK-1875: add JSON output to cloudmonkey

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10275/
-----------------------------------------------------------

Review request for cloudstack.


Description
-------

Added
1. display = [default|json|tabularize] has been added in the config to replace tabularize = [true|false]
2. tabularize is deprecated but we will still set it as "false" once the user removes it out of their config to avoid throwing an error. This will be removed in the next major version.
3. display = "default" is added to the [ui] section of the config if it is not present.
4. You can now output JSON formatted text by setting the config display = json
5. You can now filter text in JSON output mode. (i.e. list users account=grudzien filter=account,id,email). Filtered output returns a properly formatted JSON document.

Removed
1. Removed the printing of attr keys in read_config().

Deprecated
1. tabularize = [true|false] is now messaged as deprecated.


This addresses bug CLOUDSTACK-1875.


Diffs
-----

  tools/cli/cloudmonkey/cloudmonkey.py 94006c9 
  tools/cli/cloudmonkey/config.py 75605df 

Diff: https://reviews.apache.org/r/10275/diff/


Testing
-------

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

$ python cloudmonkey.py list networks filter=name

tabularize config parameter is deprecated: please switch to display = [default,json,tabularize]

{
  "count": 2,
  "network": [
    {
      "name": "admin-network"
    },
    {
      "name": "GuestNetwork82"
    }
  ]
}


$ python cloudmonkey.py list networkofferings filter=name

tabularize config parameter is deprecated: please switch to display = [default,json,tabularize]

{
  "count": 8,
  "networkoffering": [
    {
      "name": "DefaultSharedNetworkOfferingWithSGService"
    },
    {
      "name": "DefaultSharedNetworkOffering"
    },
    {
      "name": "DefaultIsolatedNetworkOfferingWithSourceNatService"
    },
    {
      "name": "DefaultIsolatedNetworkOffering"
    },
    {
      "name": "DefaultSharedNetscalerEIPandELBNetworkOffering"
    },
    {
      "name": "DefaultIsolatedNetworkOfferingForVpcNetworks"
    },
    {
      "name": "DefaultIsolatedNetworkOfferingForVpcNetworksNoLB"
    },
    {
      "name": "Test Network Offering"
    }
  ]
}


Thanks,

Justin Grudzien


Re: Review Request: Improvement CLOUDSTACK-1875: add JSON output to cloudmonkey

Posted by ASF Subversion and Git Services <as...@urd.zones.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10275/#review18710
-----------------------------------------------------------


Commit c75b11d13a49065554d492d5ed2fafc6bff9493e in branch refs/heads/master from Rohit Yadav <bh...@apache.org>
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=c75b11d ]

CLOUDSTACK-1875: add JSON output to cloudmonkey

Added
1. display = [default|json|tabularize] has been added in the config to replace tabularize = [true|false]
2. tabularize is deprecated but we will still set it as "false" once the user removes it out of their config to avoid throwing an error. This will be removed in the next major version.
3. display = "default" is added to the [ui] section of the config if it is not present.
4. You can now output JSON formatted text by setting the config display = json
5. You can now filter text in JSON output mode. (i.e. list users account=grudzien filter=account,id,email). Filtered output returns a properly formatted JSON document.

Removed
1. Removed the printing of attr keys in read_config().

Deprecated
1. tabularize = [true|false] is now messaged as deprecated.

Signed-off-by: Justin Grudzien <gr...@gmail.com>


- ASF Subversion and Git Services


On April 4, 2013, 2:01 p.m., Justin Grudzien wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10275/
> -----------------------------------------------------------
> 
> (Updated April 4, 2013, 2:01 p.m.)
> 
> 
> Review request for cloudstack and Rohit Yadav.
> 
> 
> Description
> -------
> 
> Added
> 1. display = [default|json|tabularize] has been added in the config to replace tabularize = [true|false]
> 2. tabularize is deprecated but we will still set it as "false" once the user removes it out of their config to avoid throwing an error. This will be removed in the next major version.
> 3. display = "default" is added to the [ui] section of the config if it is not present.
> 4. You can now output JSON formatted text by setting the config display = json
> 5. You can now filter text in JSON output mode. (i.e. list users account=grudzien filter=account,id,email). Filtered output returns a properly formatted JSON document.
> 
> Removed
> 1. Removed the printing of attr keys in read_config().
> 
> Deprecated
> 1. tabularize = [true|false] is now messaged as deprecated.
> 
> 
> This addresses bug CLOUDSTACK-1875.
> 
> 
> Diffs
> -----
> 
>   tools/cli/cloudmonkey/cloudmonkey.py 94006c9 
>   tools/cli/cloudmonkey/config.py 75605df 
> 
> Diff: https://reviews.apache.org/r/10275/diff/
> 
> 
> Testing
> -------
> 
> [ui]
> color = true
> prompt = > 
> tabularize = false
> display = json
> 
> $ python cloudmonkey.py list networks filter=name
> 
> tabularize config parameter is deprecated: please switch to display = [default,json,tabularize]
> 
> {
>   "count": 2,
>   "network": [
>     {
>       "name": "admin-network"
>     },
>     {
>       "name": "GuestNetwork82"
>     }
>   ]
> }
> 
> 
> $ python cloudmonkey.py list networkofferings filter=name
> 
> tabularize config parameter is deprecated: please switch to display = [default,json,tabularize]
> 
> {
>   "count": 8,
>   "networkoffering": [
>     {
>       "name": "DefaultSharedNetworkOfferingWithSGService"
>     },
>     {
>       "name": "DefaultSharedNetworkOffering"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOfferingWithSourceNatService"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOffering"
>     },
>     {
>       "name": "DefaultSharedNetscalerEIPandELBNetworkOffering"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOfferingForVpcNetworks"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOfferingForVpcNetworksNoLB"
>     },
>     {
>       "name": "Test Network Offering"
>     }
>   ]
> }
> 
> 
> Thanks,
> 
> Justin Grudzien
> 
>


Re: Review Request: Improvement CLOUDSTACK-1875: add JSON output to cloudmonkey

Posted by Rohit Yadav <bh...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10275/#review18709
-----------------------------------------------------------


Code is not pep8 compliant. Anyway, I'll apply the patch as the issues are mostly whitespaces and newlines. For ex. two newlines after methods and classes are defined in PEP8 (you can install pep8 using pip install pep8 and run pep8 *.py to check and fix the errors.).

- Rohit Yadav


On April 4, 2013, 2:01 p.m., Justin Grudzien wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10275/
> -----------------------------------------------------------
> 
> (Updated April 4, 2013, 2:01 p.m.)
> 
> 
> Review request for cloudstack and Rohit Yadav.
> 
> 
> Description
> -------
> 
> Added
> 1. display = [default|json|tabularize] has been added in the config to replace tabularize = [true|false]
> 2. tabularize is deprecated but we will still set it as "false" once the user removes it out of their config to avoid throwing an error. This will be removed in the next major version.
> 3. display = "default" is added to the [ui] section of the config if it is not present.
> 4. You can now output JSON formatted text by setting the config display = json
> 5. You can now filter text in JSON output mode. (i.e. list users account=grudzien filter=account,id,email). Filtered output returns a properly formatted JSON document.
> 
> Removed
> 1. Removed the printing of attr keys in read_config().
> 
> Deprecated
> 1. tabularize = [true|false] is now messaged as deprecated.
> 
> 
> This addresses bug CLOUDSTACK-1875.
> 
> 
> Diffs
> -----
> 
>   tools/cli/cloudmonkey/cloudmonkey.py 94006c9 
>   tools/cli/cloudmonkey/config.py 75605df 
> 
> Diff: https://reviews.apache.org/r/10275/diff/
> 
> 
> Testing
> -------
> 
> [ui]
> color = true
> prompt = > 
> tabularize = false
> display = json
> 
> $ python cloudmonkey.py list networks filter=name
> 
> tabularize config parameter is deprecated: please switch to display = [default,json,tabularize]
> 
> {
>   "count": 2,
>   "network": [
>     {
>       "name": "admin-network"
>     },
>     {
>       "name": "GuestNetwork82"
>     }
>   ]
> }
> 
> 
> $ python cloudmonkey.py list networkofferings filter=name
> 
> tabularize config parameter is deprecated: please switch to display = [default,json,tabularize]
> 
> {
>   "count": 8,
>   "networkoffering": [
>     {
>       "name": "DefaultSharedNetworkOfferingWithSGService"
>     },
>     {
>       "name": "DefaultSharedNetworkOffering"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOfferingWithSourceNatService"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOffering"
>     },
>     {
>       "name": "DefaultSharedNetscalerEIPandELBNetworkOffering"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOfferingForVpcNetworks"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOfferingForVpcNetworksNoLB"
>     },
>     {
>       "name": "Test Network Offering"
>     }
>   ]
> }
> 
> 
> Thanks,
> 
> Justin Grudzien
> 
>


Re: Review Request: Improvement CLOUDSTACK-1875: add JSON output to cloudmonkey

Posted by Rohit Yadav <bh...@apache.org>.
On Apr 6, 2013 4:24 AM, "Justin Grudzien" <gr...@gmail.com> wrote:
>
> If anyone is allowed to update the wiki I can do so as I go along.

Yes, edit the wikis boldly, everyone is encouraged.

>
> One thing to note. Because we effectively removed tabularize and you
removed my appending the display attribute to the config if it didn't exist
we have created a user experience which will not be seamless when they
upgrade.

You're right but this way people would know tabularize is gone and I
believe our good users adapt, it's a small tool with not many options. We
can print some message if it is used, else we don't keep it in code and cfg.

>
> I have begun working in the next set of features. I will make sure I run
the pep8 module on it before I submit and keep the code as short as
possible.

Cool!

Cheers.
>
> Justin
>
> Sent from my iPhone
>
> On Apr 5, 2013, at 12:39 PM, "Rohit Yadav" <bh...@apache.org> wrote:
>
> >
> > This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10275/
> >
> > We will deprecate and remove self.tabular and let's call the display
type "table" instead of tabularize as we use json and not jsonize etc.; we
need to update this on wiki when we are done.
> > I've removed comments, the idea should be to write code such that
comments should not be needed, of course that is my argument, nevertheless
the code is tiny 500 lines of code.
> >
> > Applied on master:
> >
> > commit ff74cbbeeac726a2f988f0a2fcda78e74f9af64d
> > Author: Rohit Yadav <bh...@apache.org>
> > Date:   Fri Apr 5 23:06:44 2013 +0530
> >
> >     cli: Remove tabularize, fix display types, make code pep8 compliant
> >
> >     - Remove tabularize field
> >     - Now display types are: default, json and table
> >     - Make requester pep8 compliant
> >     - Remove unnecessary comments, if we want them we should put them
on each method
> >
> >     Signed-off-by: Rohit Yadav <bh...@apache.org>
> >
> > commit 9fbae8579923ad7f2823c084e6112b406714652b
> > Author: Rohit Yadav <bh...@apache.org>
> > Date:   Fri Apr 5 22:56:07 2013 +0530
> >
> >     cli: Make cloudmonkey.py pep8 compliant
> >
> >     Signed-off-by: Rohit Yadav <bh...@apache.org>
> >
> > commit c75b11d13a49065554d492d5ed2fafc6bff9493e
> > Author: Justin Grudzien <gr...@gmail.com>
> > Date:   Wed Apr 3 15:00:00 2013 -0500
> >
> >     CLOUDSTACK-1875: add JSON output to cloudmonkey
> >
> >     Added
> >     1. display = [default|json|tabularize] has been added in the config
to replace tabularize = [true|false]
> >     2. tabularize is deprecated but we will still set it as "false"
once the user removes it out of their config to avoid throwing an error. Th
> >     3. display = "default" is added to the [ui] section of the config
if it is not present.
> >     4. You can now output JSON formatted text by setting the config
display = json
> >     5. You can now filter text in JSON output mode. (i.e. list users
account=grudzien filter=account,id,email). Filtered output returns a prope
> >
> >     Removed
> >     1. Removed the printing of attr keys in read_config().
> >
> >     Deprecated
> >     1. tabularize = [true|false] is now messaged as deprecated.
> >
> >     Signed-off-by: Justin Grudzien <gr...@gmail.com>
> >
> > - Rohit
> >
> >
> > On April 4th, 2013, 2:01 p.m., Justin Grudzien wrote:
> >
> > Review request for cloudstack and Rohit Yadav.
> > By Justin Grudzien.
> > Updated April 4, 2013, 2:01 p.m.
> >
> > Description
> >
> > Added
> > 1. display = [default|json|tabularize] has been added in the config to
replace tabularize = [true|false]
> > 2. tabularize is deprecated but we will still set it as "false" once
the user removes it out of their config to avoid throwing an error. This
will be removed in the next major version.
> > 3. display = "default" is added to the [ui] section of the config if it
is not present.
> > 4. You can now output JSON formatted text by setting the config display
= json
> > 5. You can now filter text in JSON output mode. (i.e. list users
account=grudzien filter=account,id,email). Filtered output returns a
properly formatted JSON document.
> >
> > Removed
> > 1. Removed the printing of attr keys in read_config().
> >
> > Deprecated
> > 1. tabularize = [true|false] is now messaged as deprecated.
> > Testing
> >
> > [ui]
> > color = true
> > prompt = >
> > tabularize = false
> > display = json
> >
> > $ python cloudmonkey.py list networks filter=name
> >
> > tabularize config parameter is deprecated: please switch to display =
[default,json,tabularize]
> >
> > {
> >   "count": 2,
> >   "network": [
> >     {
> >       "name": "admin-network"
> >     },
> >     {
> >       "name": "GuestNetwork82"
> >     }
> >   ]
> > }
> >
> >
> > $ python cloudmonkey.py list networkofferings filter=name
> >
> > tabularize config parameter is deprecated: please switch to display =
[default,json,tabularize]
> >
> > {
> >   "count": 8,
> >   "networkoffering": [
> >     {
> >       "name": "DefaultSharedNetworkOfferingWithSGService"
> >     },
> >     {
> >       "name": "DefaultSharedNetworkOffering"
> >     },
> >     {
> >       "name": "DefaultIsolatedNetworkOfferingWithSourceNatService"
> >     },
> >     {
> >       "name": "DefaultIsolatedNetworkOffering"
> >     },
> >     {
> >       "name": "DefaultSharedNetscalerEIPandELBNetworkOffering"
> >     },
> >     {
> >       "name": "DefaultIsolatedNetworkOfferingForVpcNetworks"
> >     },
> >     {
> >       "name": "DefaultIsolatedNetworkOfferingForVpcNetworksNoLB"
> >     },
> >     {
> >       "name": "Test Network Offering"
> >     }
> >   ]
> > }
> > Bugs: CLOUDSTACK-1875
> > Diffs
> >
> > tools/cli/cloudmonkey/cloudmonkey.py (94006c9)
> > tools/cli/cloudmonkey/config.py (75605df)
> > View Diff

Re: Review Request: Improvement CLOUDSTACK-1875: add JSON output to cloudmonkey

Posted by Justin Grudzien <gr...@gmail.com>.
If anyone is allowed to update the wiki I can do so as I go along. 

One thing to note. Because we effectively removed tabularize and you removed my appending the display attribute to the config if it didn't exist we have created a user experience which will not be seamless when they upgrade.

I have begun working in the next set of features. I will make sure I run the pep8 module on it before I submit and keep the code as short as possible. 

Justin

Sent from my iPhone

On Apr 5, 2013, at 12:39 PM, "Rohit Yadav" <bh...@apache.org> wrote:

> 
> This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/10275/
> 
> We will deprecate and remove self.tabular and let's call the display type "table" instead of tabularize as we use json and not jsonize etc.; we need to update this on wiki when we are done.
> I've removed comments, the idea should be to write code such that comments should not be needed, of course that is my argument, nevertheless the code is tiny 500 lines of code.
> 
> Applied on master:
> 
> commit ff74cbbeeac726a2f988f0a2fcda78e74f9af64d
> Author: Rohit Yadav <bh...@apache.org>
> Date:   Fri Apr 5 23:06:44 2013 +0530
> 
>     cli: Remove tabularize, fix display types, make code pep8 compliant
>     
>     - Remove tabularize field
>     - Now display types are: default, json and table
>     - Make requester pep8 compliant
>     - Remove unnecessary comments, if we want them we should put them on each method
>     
>     Signed-off-by: Rohit Yadav <bh...@apache.org>
> 
> commit 9fbae8579923ad7f2823c084e6112b406714652b
> Author: Rohit Yadav <bh...@apache.org>
> Date:   Fri Apr 5 22:56:07 2013 +0530
> 
>     cli: Make cloudmonkey.py pep8 compliant
>     
>     Signed-off-by: Rohit Yadav <bh...@apache.org>
> 
> commit c75b11d13a49065554d492d5ed2fafc6bff9493e
> Author: Justin Grudzien <gr...@gmail.com>
> Date:   Wed Apr 3 15:00:00 2013 -0500
> 
>     CLOUDSTACK-1875: add JSON output to cloudmonkey
>     
>     Added
>     1. display = [default|json|tabularize] has been added in the config to replace tabularize = [true|false]
>     2. tabularize is deprecated but we will still set it as "false" once the user removes it out of their config to avoid throwing an error. Th
>     3. display = "default" is added to the [ui] section of the config if it is not present.
>     4. You can now output JSON formatted text by setting the config display = json
>     5. You can now filter text in JSON output mode. (i.e. list users account=grudzien filter=account,id,email). Filtered output returns a prope
>     
>     Removed
>     1. Removed the printing of attr keys in read_config().
>     
>     Deprecated
>     1. tabularize = [true|false] is now messaged as deprecated.
>     
>     Signed-off-by: Justin Grudzien <gr...@gmail.com>
> 
> - Rohit
> 
> 
> On April 4th, 2013, 2:01 p.m., Justin Grudzien wrote:
> 
> Review request for cloudstack and Rohit Yadav.
> By Justin Grudzien.
> Updated April 4, 2013, 2:01 p.m.
> 
> Description
> 
> Added
> 1. display = [default|json|tabularize] has been added in the config to replace tabularize = [true|false]
> 2. tabularize is deprecated but we will still set it as "false" once the user removes it out of their config to avoid throwing an error. This will be removed in the next major version.
> 3. display = "default" is added to the [ui] section of the config if it is not present.
> 4. You can now output JSON formatted text by setting the config display = json
> 5. You can now filter text in JSON output mode. (i.e. list users account=grudzien filter=account,id,email). Filtered output returns a properly formatted JSON document.
> 
> Removed
> 1. Removed the printing of attr keys in read_config().
> 
> Deprecated
> 1. tabularize = [true|false] is now messaged as deprecated.
> Testing
> 
> [ui]
> color = true
> prompt = > 
> tabularize = false
> display = json
> 
> $ python cloudmonkey.py list networks filter=name
> 
> tabularize config parameter is deprecated: please switch to display = [default,json,tabularize]
> 
> {
>   "count": 2,
>   "network": [
>     {
>       "name": "admin-network"
>     },
>     {
>       "name": "GuestNetwork82"
>     }
>   ]
> }
> 
> 
> $ python cloudmonkey.py list networkofferings filter=name
> 
> tabularize config parameter is deprecated: please switch to display = [default,json,tabularize]
> 
> {
>   "count": 8,
>   "networkoffering": [
>     {
>       "name": "DefaultSharedNetworkOfferingWithSGService"
>     },
>     {
>       "name": "DefaultSharedNetworkOffering"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOfferingWithSourceNatService"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOffering"
>     },
>     {
>       "name": "DefaultSharedNetscalerEIPandELBNetworkOffering"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOfferingForVpcNetworks"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOfferingForVpcNetworksNoLB"
>     },
>     {
>       "name": "Test Network Offering"
>     }
>   ]
> }
> Bugs: CLOUDSTACK-1875
> Diffs
> 
> tools/cli/cloudmonkey/cloudmonkey.py (94006c9)
> tools/cli/cloudmonkey/config.py (75605df)
> View Diff

Re: Review Request: Improvement CLOUDSTACK-1875: add JSON output to cloudmonkey

Posted by Rohit Yadav <bh...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10275/#review18712
-----------------------------------------------------------


We will deprecate and remove self.tabular and let's call the display type "table" instead of tabularize as we use json and not jsonize etc.; we need to update this on wiki when we are done.
I've removed comments, the idea should be to write code such that comments should not be needed, of course that is my argument, nevertheless the code is tiny 500 lines of code.

Applied on master:

commit ff74cbbeeac726a2f988f0a2fcda78e74f9af64d
Author: Rohit Yadav <bh...@apache.org>
Date:   Fri Apr 5 23:06:44 2013 +0530

    cli: Remove tabularize, fix display types, make code pep8 compliant
    
    - Remove tabularize field
    - Now display types are: default, json and table
    - Make requester pep8 compliant
    - Remove unnecessary comments, if we want them we should put them on each method
    
    Signed-off-by: Rohit Yadav <bh...@apache.org>

commit 9fbae8579923ad7f2823c084e6112b406714652b
Author: Rohit Yadav <bh...@apache.org>
Date:   Fri Apr 5 22:56:07 2013 +0530

    cli: Make cloudmonkey.py pep8 compliant
    
    Signed-off-by: Rohit Yadav <bh...@apache.org>

commit c75b11d13a49065554d492d5ed2fafc6bff9493e
Author: Justin Grudzien <gr...@gmail.com>
Date:   Wed Apr 3 15:00:00 2013 -0500

    CLOUDSTACK-1875: add JSON output to cloudmonkey
    
    Added
    1. display = [default|json|tabularize] has been added in the config to replace tabularize = [true|false]
    2. tabularize is deprecated but we will still set it as "false" once the user removes it out of their config to avoid throwing an error. Th
    3. display = "default" is added to the [ui] section of the config if it is not present.
    4. You can now output JSON formatted text by setting the config display = json
    5. You can now filter text in JSON output mode. (i.e. list users account=grudzien filter=account,id,email). Filtered output returns a prope
    
    Removed
    1. Removed the printing of attr keys in read_config().
    
    Deprecated
    1. tabularize = [true|false] is now messaged as deprecated.
    
    Signed-off-by: Justin Grudzien <gr...@gmail.com>

- Rohit Yadav


On April 4, 2013, 2:01 p.m., Justin Grudzien wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10275/
> -----------------------------------------------------------
> 
> (Updated April 4, 2013, 2:01 p.m.)
> 
> 
> Review request for cloudstack and Rohit Yadav.
> 
> 
> Description
> -------
> 
> Added
> 1. display = [default|json|tabularize] has been added in the config to replace tabularize = [true|false]
> 2. tabularize is deprecated but we will still set it as "false" once the user removes it out of their config to avoid throwing an error. This will be removed in the next major version.
> 3. display = "default" is added to the [ui] section of the config if it is not present.
> 4. You can now output JSON formatted text by setting the config display = json
> 5. You can now filter text in JSON output mode. (i.e. list users account=grudzien filter=account,id,email). Filtered output returns a properly formatted JSON document.
> 
> Removed
> 1. Removed the printing of attr keys in read_config().
> 
> Deprecated
> 1. tabularize = [true|false] is now messaged as deprecated.
> 
> 
> This addresses bug CLOUDSTACK-1875.
> 
> 
> Diffs
> -----
> 
>   tools/cli/cloudmonkey/cloudmonkey.py 94006c9 
>   tools/cli/cloudmonkey/config.py 75605df 
> 
> Diff: https://reviews.apache.org/r/10275/diff/
> 
> 
> Testing
> -------
> 
> [ui]
> color = true
> prompt = > 
> tabularize = false
> display = json
> 
> $ python cloudmonkey.py list networks filter=name
> 
> tabularize config parameter is deprecated: please switch to display = [default,json,tabularize]
> 
> {
>   "count": 2,
>   "network": [
>     {
>       "name": "admin-network"
>     },
>     {
>       "name": "GuestNetwork82"
>     }
>   ]
> }
> 
> 
> $ python cloudmonkey.py list networkofferings filter=name
> 
> tabularize config parameter is deprecated: please switch to display = [default,json,tabularize]
> 
> {
>   "count": 8,
>   "networkoffering": [
>     {
>       "name": "DefaultSharedNetworkOfferingWithSGService"
>     },
>     {
>       "name": "DefaultSharedNetworkOffering"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOfferingWithSourceNatService"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOffering"
>     },
>     {
>       "name": "DefaultSharedNetscalerEIPandELBNetworkOffering"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOfferingForVpcNetworks"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOfferingForVpcNetworksNoLB"
>     },
>     {
>       "name": "Test Network Offering"
>     }
>   ]
> }
> 
> 
> Thanks,
> 
> Justin Grudzien
> 
>


Re: Review Request: Improvement CLOUDSTACK-1875: add JSON output to cloudmonkey

Posted by ASF Subversion and Git Services <as...@urd.zones.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10275/#review18901
-----------------------------------------------------------


Commit c75b11d13a49065554d492d5ed2fafc6bff9493e in branch refs/heads/affinity_groups from Rohit Yadav <bh...@apache.org>
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=c75b11d ]

CLOUDSTACK-1875: add JSON output to cloudmonkey

Added
1. display = [default|json|tabularize] has been added in the config to replace tabularize = [true|false]
2. tabularize is deprecated but we will still set it as "false" once the user removes it out of their config to avoid throwing an error. This will be removed in the next major version.
3. display = "default" is added to the [ui] section of the config if it is not present.
4. You can now output JSON formatted text by setting the config display = json
5. You can now filter text in JSON output mode. (i.e. list users account=grudzien filter=account,id,email). Filtered output returns a properly formatted JSON document.

Removed
1. Removed the printing of attr keys in read_config().

Deprecated
1. tabularize = [true|false] is now messaged as deprecated.

Signed-off-by: Justin Grudzien <gr...@gmail.com>


- ASF Subversion and Git Services


On April 4, 2013, 2:01 p.m., Justin Grudzien wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10275/
> -----------------------------------------------------------
> 
> (Updated April 4, 2013, 2:01 p.m.)
> 
> 
> Review request for cloudstack and Rohit Yadav.
> 
> 
> Description
> -------
> 
> Added
> 1. display = [default|json|tabularize] has been added in the config to replace tabularize = [true|false]
> 2. tabularize is deprecated but we will still set it as "false" once the user removes it out of their config to avoid throwing an error. This will be removed in the next major version.
> 3. display = "default" is added to the [ui] section of the config if it is not present.
> 4. You can now output JSON formatted text by setting the config display = json
> 5. You can now filter text in JSON output mode. (i.e. list users account=grudzien filter=account,id,email). Filtered output returns a properly formatted JSON document.
> 
> Removed
> 1. Removed the printing of attr keys in read_config().
> 
> Deprecated
> 1. tabularize = [true|false] is now messaged as deprecated.
> 
> 
> This addresses bug CLOUDSTACK-1875.
> 
> 
> Diffs
> -----
> 
>   tools/cli/cloudmonkey/cloudmonkey.py 94006c9 
>   tools/cli/cloudmonkey/config.py 75605df 
> 
> Diff: https://reviews.apache.org/r/10275/diff/
> 
> 
> Testing
> -------
> 
> [ui]
> color = true
> prompt = > 
> tabularize = false
> display = json
> 
> $ python cloudmonkey.py list networks filter=name
> 
> tabularize config parameter is deprecated: please switch to display = [default,json,tabularize]
> 
> {
>   "count": 2,
>   "network": [
>     {
>       "name": "admin-network"
>     },
>     {
>       "name": "GuestNetwork82"
>     }
>   ]
> }
> 
> 
> $ python cloudmonkey.py list networkofferings filter=name
> 
> tabularize config parameter is deprecated: please switch to display = [default,json,tabularize]
> 
> {
>   "count": 8,
>   "networkoffering": [
>     {
>       "name": "DefaultSharedNetworkOfferingWithSGService"
>     },
>     {
>       "name": "DefaultSharedNetworkOffering"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOfferingWithSourceNatService"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOffering"
>     },
>     {
>       "name": "DefaultSharedNetscalerEIPandELBNetworkOffering"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOfferingForVpcNetworks"
>     },
>     {
>       "name": "DefaultIsolatedNetworkOfferingForVpcNetworksNoLB"
>     },
>     {
>       "name": "Test Network Offering"
>     }
>   ]
> }
> 
> 
> Thanks,
> 
> Justin Grudzien
> 
>


Re: Review Request: Improvement CLOUDSTACK-1875: add JSON output to cloudmonkey

Posted by Rohit Yadav <bh...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10275/
-----------------------------------------------------------

(Updated April 4, 2013, 2:01 p.m.)


Review request for cloudstack and Rohit Yadav.


Description
-------

Added
1. display = [default|json|tabularize] has been added in the config to replace tabularize = [true|false]
2. tabularize is deprecated but we will still set it as "false" once the user removes it out of their config to avoid throwing an error. This will be removed in the next major version.
3. display = "default" is added to the [ui] section of the config if it is not present.
4. You can now output JSON formatted text by setting the config display = json
5. You can now filter text in JSON output mode. (i.e. list users account=grudzien filter=account,id,email). Filtered output returns a properly formatted JSON document.

Removed
1. Removed the printing of attr keys in read_config().

Deprecated
1. tabularize = [true|false] is now messaged as deprecated.


This addresses bug CLOUDSTACK-1875.


Diffs
-----

  tools/cli/cloudmonkey/cloudmonkey.py 94006c9 
  tools/cli/cloudmonkey/config.py 75605df 

Diff: https://reviews.apache.org/r/10275/diff/


Testing
-------

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

$ python cloudmonkey.py list networks filter=name

tabularize config parameter is deprecated: please switch to display = [default,json,tabularize]

{
  "count": 2,
  "network": [
    {
      "name": "admin-network"
    },
    {
      "name": "GuestNetwork82"
    }
  ]
}


$ python cloudmonkey.py list networkofferings filter=name

tabularize config parameter is deprecated: please switch to display = [default,json,tabularize]

{
  "count": 8,
  "networkoffering": [
    {
      "name": "DefaultSharedNetworkOfferingWithSGService"
    },
    {
      "name": "DefaultSharedNetworkOffering"
    },
    {
      "name": "DefaultIsolatedNetworkOfferingWithSourceNatService"
    },
    {
      "name": "DefaultIsolatedNetworkOffering"
    },
    {
      "name": "DefaultSharedNetscalerEIPandELBNetworkOffering"
    },
    {
      "name": "DefaultIsolatedNetworkOfferingForVpcNetworks"
    },
    {
      "name": "DefaultIsolatedNetworkOfferingForVpcNetworksNoLB"
    },
    {
      "name": "Test Network Offering"
    }
  ]
}


Thanks,

Justin Grudzien