You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by geomacy <gi...@git.apache.org> on 2016/11/01 18:01:04 UTC

[GitHub] brooklyn-client pull request #31: Experimental addition of 'catalog show'.

GitHub user geomacy opened a pull request:

    https://github.com/apache/brooklyn-client/pull/31

    Experimental addition of 'catalog show'.

    Examples:
    
    	br catalog show
    	br catalog show ( application | entity | location | policy ) ITEM[:VERSION]
    
    apps:
    	br catalog show app TomcatServer
    	Id:               | TomcatServer:4.1.0-SNAPSHOT
    	Version:          | 4.1.0-SNAPSHOT
    	Name:             | Tomcat Server
    	...etc.
    
    specific version:
    	br catalog show app TomcatServer:4.1.0-SNAPSHOT
    	Id:               | TomcatServer:4.1.0-SNAPSHOT
    	Version:          | 4.1.0-SNAPSHOT
    	Name:             | Tomcat Server
    	...
    
    entities:
    	br catalog show ent docker-engine | head -3
    	Id:                | docker-engine:2.1.0-SNAPSHOT
    	Version:           | 2.1.0-SNAPSHOT
    	Name:              | Docker Engine
    	...
    
    policies:
    	br catalog show pol org.apache.brooklyn.policy.ha.ServiceReplacer
    	Id:              | org.apache.brooklyn.policy.ha.ServiceReplacer:4.1.0-SNAPSHOT
    	Version:         | 4.1.0-SNAPSHOT
    	Name:            | Service Replacer
    	Symbolic Name:   | org.apache.brooklyn.policy.ha.ServiceReplacer
    	Description:     | HA policy for replacing a failed member of a group
    	Java Type:       |
    
    Experimental: render as JSON. Some work required...
    
    Special case: render the whole JSON with jsonpath value `$`:
    
    	br -j '$' catalog show ent docker-engine
    	{"id":"docker-engine:2.1.0-SNAPSHOT","name":"Docker Engine",...
    
    General case: give a JSON path expression following the syntax of https://github.com/NodePrime/jsonpath:
    
    	 br -j '$.config[*].label+' catalog show ent docker-engine
    	"Docker Package"
    	"Docker Version"
    	"Docker Repository URL"
    	"Docker GPG Key URL"
    	"Docker Additional Options"
    	"Image Pre-install"
    	"archive.nameFormat"

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/geomacy/brooklyn-client catshow

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-client/pull/31.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #31
    
----
commit 3163afa80bf0d5cf4139b4feda1ec2efec61a05f
Author: Geoff Macartney <ge...@cloudsoftcorp.com>
Date:   2016-11-01T12:14:05Z

    Experimental addition of 'catalog show'.
    
    Examples:
    
    	br catalog show
    	br catalog show ( application | entity | location | policy ) ITEM[:VERSION]
    
    apps:
    	br catalog show app TomcatServer
    	Id:               | TomcatServer:4.1.0-SNAPSHOT
    	Version:          | 4.1.0-SNAPSHOT
    	Name:             | Tomcat Server
    	...etc.
    
    specific version:
    	br catalog show app TomcatServer:4.1.0-SNAPSHOT
    	Id:               | TomcatServer:4.1.0-SNAPSHOT
    	Version:          | 4.1.0-SNAPSHOT
    	Name:             | Tomcat Server
    	...
    
    entities:
    	br catalog show ent docker-engine | head -3
    	Id:                | docker-engine:2.1.0-SNAPSHOT
    	Version:           | 2.1.0-SNAPSHOT
    	Name:              | Docker Engine
    	...
    
    policies:
    	br catalog show pol org.apache.brooklyn.policy.ha.ServiceReplacer
    	Id:              | org.apache.brooklyn.policy.ha.ServiceReplacer:4.1.0-SNAPSHOT
    	Version:         | 4.1.0-SNAPSHOT
    	Name:            | Service Replacer
    	Symbolic Name:   | org.apache.brooklyn.policy.ha.ServiceReplacer
    	Description:     | HA policy for replacing a failed member of a group
    	Java Type:       |
    
    Experimental: render as JSON. Some work required...
    
    Special case: render the whole JSON with jsonpath value `$`:
    
    	br -j '$' catalog show ent docker-engine
    	{"id":"docker-engine:2.1.0-SNAPSHOT","name":"Docker Engine",...
    
    General case: give a JSON path expression following the syntax of https://github.com/NodePrime/jsonpath:
    
    	 br -j '$.config[*].label+' catalog show ent docker-engine
    	"Docker Package"
    	"Docker Version"
    	"Docker Repository URL"
    	"Docker GPG Key URL"
    	"Docker Additional Options"
    	"Image Pre-install"
    	"archive.nameFormat"

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-client issue #31: Experimental addition of 'catalog show'.

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the issue:

    https://github.com/apache/brooklyn-client/pull/31
  
    works well, and `-j` is noted as experimental.  merging, and let's continue in subsequent PRs.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-client pull request #31: Experimental addition of 'catalog show'.

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/brooklyn-client/pull/31


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-client issue #31: Experimental addition of 'catalog show'.

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the issue:

    https://github.com/apache/brooklyn-client/pull/31
  
    awesome!  does this now show the config keys info for items?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-client issue #31: Experimental addition of 'catalog show'.

Posted by geomacy <gi...@git.apache.org>.
Github user geomacy commented on the issue:

    https://github.com/apache/brooklyn-client/pull/31
  
    Yes, they are displayed on subsequent lines.
    
    On Tue, 1 Nov 2016, 18:28 Alex Heneveld, <no...@github.com> wrote:
    
    > awesome! does this now show the config keys info for items?
    >
    > \u2014
    > You are receiving this because you authored the thread.
    > Reply to this email directly, view it on GitHub
    > <https://github.com/apache/brooklyn-client/pull/31#issuecomment-257652035>,
    > or mute the thread
    > <https://github.com/notifications/unsubscribe-auth/ANfNJwhmX7zVyAvDt2ddNJYNy1pqsnPYks5q54TjgaJpZM4KmY0e>
    > .
    >



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-client issue #31: Experimental addition of 'catalog show'.

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the issue:

    https://github.com/apache/brooklyn-client/pull/31
  
    It would be easier to remember if the first two are combined (not sure if technically possible):
    ```
    -j                 output as JSON
    -j <pathspec>      apply jsonpath expression  
    ```
    
    Also see `jq`'s approach for [stripping quotes](https://stedolan.github.io/jq/manual/#Invokingjq) (look for `--raw-output / -r`).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-client issue #31: Experimental addition of 'catalog show'.

Posted by geomacy <gi...@git.apache.org>.
Github user geomacy commented on the issue:

    https://github.com/apache/brooklyn-client/pull/31
  
    @ahgittin suggests
    ```
    -j                  output as JSON
    -jq <pathspec>      apply jsonpath expression  
    -jh  <pathspec>     apply jsonpath expression and remove spaces from output strings (particularly handy for scripts)
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-client issue #31: Experimental addition of 'catalog show'.

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the issue:

    https://github.com/apache/brooklyn-client/pull/31
  
    @neykov wouldn't that be ambiguous if i say `-j catalog show` is `catalog` a json selected or a `br` command?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-client issue #31: Experimental addition of 'catalog show'.

Posted by geomacy <gi...@git.apache.org>.
Github user geomacy commented on the issue:

    https://github.com/apache/brooklyn-client/pull/31
  
    Yes it does, also tags.  All are listed sequentially like
    
    ```
    Config:            |    
    Name:              | docker.package   
    Type:              | java.lang.String   
    Description:       | The Docker Engine package to install   
    Default Value:     | <nil>   
    Reconfigurable:    | false   
    Label:             | Docker Package   
    Priority:          | 1   
    Pinned:            | true   
                       |    
    Name:              | docker.version   
    Type:              | java.lang.String   
    Description:       | The Docker Engine version to install   
    Default Value:     | <nil>   
    Reconfigurable:    | false   
    Label:             | Docker Version   
    Priority:          | 2   
    Pinned:            | true   
    
    ...
    
    Tags:              |    
    tag:               | {"traits":["org.apache.brooklyn.entity.software.base.AbstractVanillaProcess","org.apache.brooklyn.entity.software.base.SoftwareProcess","org.apache.brooklyn.api.entity.Entity","org.apache.brooklyn.api.objs.BrooklynObject","org.apache.brooklyn.api.objs.Identifiable","org.apache.brooklyn.api.objs.Configurable","org.apache.brooklyn.core.entity.trait.Startable"]}   
    ```
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---