[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Additions to RHC to handle commands and multiple gears

The next version of the RHC client will expose a few new commands to simplify administering scaled apps.

First, agoldste provided a pull that allows a command to be run against the head gear with 'rhc ssh':

    rhc ssh myapp 'echo $OPENSHIFT_GEAR_DNS'

will execute the command on the head gear and display the output:


Building on that, we thought - hey, why not do it for all gears?

    $ rhc ssh myapp --gears 'echo $OPENSHIFT_GEAR_DNS'
    [51c0916287150b0b13000001 jenkins-1.4] jenkins-abc.dev.rhcloud.com

If you have multiple gears you'll see multiple lines.  You can pass --raw to get only the output.  If you have multiple arguments, or want to pass an option that RHC shouldn't interpret, use the "--" separator

    rhc ssh myapp --gears -- 'echo $OPENSHIFT_GEAR_DNS' '--trace'

will run the command line "echo $OPENSHIFT_GEAR_DNS --trace" on the server.  

We got further inspired to add some helpers for app show for common cases - to start with, we added the ability to get your quota:

    $ rhc show-app jenkins --gears quota
    Gear                     Cartridges   Used Limit
    ------------------------ ----------- ----- -----
    51c0916287150b0b13000001 jenkins-1.4 98 KB  1 GB

and if you want, to get a list of all SSH urls directly (for use with things like pssh)

    $ rhc show-app jenkins --gears ssh
    51c0916287150b0b13000001 jenkins-abc dev rhcloud com

Let us know if there are other useful oneliners you use all the time - we'd love to add them.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]