# App42 Client library and command-line tool to deploy and manage apps on App42PaaS. ## Installation You need to install and run the app42 client gem in your local environment on your development machine. Even if you already have the app42 client gem installed, it is good practice to run “gem install app42″ to make sure that you have the latest version of the gem. #### To install the client gem, you must have ruby installed on your system. ### Linux Before you do anything else, You should install the below libraries to make sure that your system is ready to install ruby. INSTALL THE NEEDED LIBRARIES $ sudo apt-get install zlib1g zlib1g-dev build-essential openssl libssl-dev libmysqlclient18 libmysqlclient-dev libyaml-dev ##### Install Ruby on Linux using apt-get tool Download and install ruby 1.9.3 (you may install latest ruby too) $ sudo apt-get update $ sudo apt-get install ruby1.9.3 ##### Install Ruby on Linux from source code. Download ruby source code from Ruby Site $ apt-get -y update $ apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev $ cd /tmp $ wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz $ tar -xvzf ruby-2.0.0-p0.tar.gz $ cd ruby-2.0.0-p0/ $ ./configure --prefix=/usr/local $ make $ make install ### Mac OS X To install the client gem, you must have ruby installed on your system. You can use MacPort to download and compile everything. Install MacPort http://www.macports.org/ From a terminal window, install Ruby $ sudo port install ruby19 _nosuffix $ sudo port select --set ruby ruby19 $ alias ruby='/opt/local/bin/ruby1.9' ### Windows To install the client gem, you must have ruby installed on your system. Download and install Ruby Installer(http://rubyinstaller.org/) for Windows and set ruby to your path to access App42 from command prompt. ### Install App42 Client Gem You can install app42 client like any other ruby gem. #### Note: app42 require Ruby 1.9.2 or newer. $ gem install app42 ## Commands Usage: app42 COMMAND [command-specific-options] Key keys # List API key and Secret key addKeys # Add API key and Secret key clearKeys # Clear API key and Secret key Applications setupInfra # Setup your deployment and runtime environment i.e. Instance(Memory, CPU) and Technology Stack deploy # Deploy the application over your runtime environment update # Update the application over your runtime environment scale # Scale application by number of instance(s) descale # Descale application by number of instance(s) start # Start the application stop # Stop the application restart # Restart the application deleteInfra # Delete the Infrastructure environment apps # List all the deployed applications with their meta details appInfo # Show meta information of the application appState # Show current state of the application logs # Returns the log file URL(s) for the application Services createService # Creates a new service e.g. MySQL, MongoDB, CouchDB, PostgreSQL etc. deleteService # Delete provisioned service startService # Start the service restartService # Restart the service stopService # Stop the service services # List all the provisioned services with their meta details serviceInfo # Show meta information of the provisioned service resetServicePassword # Reset password of provisioned service bindIP # Bind IP to provisioned service unbindIP # Unbind IP from provisioned service bindInfo # Show IP bind information related to provisioned service Misc supportedServices # List supported services by App42 iaasProviders # List supported IaaS providers by App42 runtimes # List supported runtimes by App42 activities # List all activities with their status Setup setupCloudAPI # Setup App42 cloud API by choosing required configuration deleteCloudAPI # Delete App42 cloud API setup setupInfo # Show setup information setups # List all the setups Help version # Show Ruby client gem version help # List available commands and their description COMMAND --help # Display detailed help of a specific command ## Usage ### $ app42 keys === API/Secret Key === API Key = df1dcdb0-958c-0130-9368-3c970e529c4b Secret Key = be9faaf56ff75bacae2ac9712b02c8feb8ffc6bb3381b60e1e9efccccd81086d ### $ app42 apps +------------------------+------------+------------------+------+------------+----------------+--------+ | === My Apps === | +------------------------+------------+------------------+------+------------+----------------+--------+ | App Url | App Status | Iaas Provider | Name | Runtime | Instance Count | Memory | +------------------------+------------+------------------+------+------------+----------------+--------+ | demo.aws.app42paas.com | RUNNING | Amazon us-west-2 | demo | Ruby 2.0.0 | 1 | 256 MB | | demo1.aws.app42paas.com| STOPPED | Amazon us-west-2 | demo1| Ruby 2.0.0 | 2 | 520 MB | +------------------------+------------+------------------+------+------------+----------------+--------+ ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request