Introduction
============

The RHC tools allow rhcloud.com users to create and control applications in
the Red Hat cloud.  The directions below describe what each application does
and gives a brief description on use.  For additional information see the man
pages.


rhc-create-domain
=================

rhc-create-domain associates your rhcloud.com/rhn account with a registered
domain under rhcloud.com.  In the example below, user "newuser@example.com"
will be registering for the rhc domain "foodie".  This also generates a client
side ssh key which is used to authenticate when pushing new code to running
applications.

    rhc-create-domain -l newuser@example.com -n foodie

This command must be run before running any other commands and it's typical to
only run it once.  This command also creates and populates your
~/.openshift/express.conf file.  This file is used to track user uuid's and which
default user to use (so other rhc-* commands don't have to explicitly specify
username)


rhc-domain-info
=============

rhc-domain-info has two modes, -i (for user info) and -a (for application info).
when run with -a, rhc-domain-info will display a list of running applications
associated with that user.  When run with -i, just basic user info will be
reported.


rhc-create-app
==============

rhc-create-app creates an application.  rhc-create-app --help to see a list of
available frameworks.  The example below creates a new application called "eat"
and assumes the domain example "foodie" from above is being used.  This example
is specifying to use php-5.3 as the target framework.

    rhc-create-app -a eat -t php-5.3

Once successful, this command will have created a local git repo in ./eat as
well as a remote applciation at eat-foodie.rhcloud.com.  To make changes to
the application, just cd eat/, make your changes, then run:

    git commit -a -m "What you did"
    git push

Once the git push completes successfully, the application at
http://eat-foodie.rhcloud.com/ will automatically see those changes.


rhc-ctl-app
===========

rhc-ctl-app is used to control a running application.  Users can start, stop,
restart, reload and destroy a running application.  The destroy command will
delete all files associated with the application from the remote website but
will leave any local files alone (like your local git repo).  The example below
destroys the eat-foodie application.

    rhc-ctl-app -a eat -c destroy

Upon successful completion, the http://eat-foodie.rhcloud.com/ application
should no longer exist.


rhc-snapshot
===========

rhc-snapshot is used to download/restore an application as a gzipped tarfile.  This includes
the entire application including data, the git repo, and logs.  It can be used to view 
logs and/or archive the entire application.  The example below uses the default save 
location of './$APPNAME.tar.gz'.

    rhc-snapshot -a eat
    
Upon successful completion, the http://eat-foodie.rhcloud.com/ application
will be downloaded to ./eat.tar.gz
You can also use rhc-snapshot to restore an application from an existing snapshot with: 

    rhc-snapshot -a eat -r ./eat.tar.gz


rhc tail
===========

rhc tail is used to tail the logs or any files within an application.  The example below uses the 
default log location of '<application_name>/logs/*'.

    rhc tail -a eat
    
Upon successful execution, the application logs will be tailed in your terminal.  Use ctrl+c to cancel.
