require 'paint' # list commands and display help # module App42 module Base class Help # details, how to use app42 commands def self.how_to Paint["Usage: app42 COMMAND [command-specific-options]", :blue] end # list available commands or display help for a specific command def self.commands print <<-USAGE #{how_to} Thank You for installing App42 PaaS Ruby Client! This is a powerful tool to make your Applications live with-in minutes. App42 PaaS is world's most advanced PaaS solution which supports multiple languages(Java, PHP, Ruby, Nodejs) and services (RDBMS like MySQL and PostgreSQL to NoSQL storage like MongoDB, Redis and CouchDB). To Get Started Signup at app42paas.shephertz.com, get your API Key and Secret key after you login and finally use App42 command to push your code to cloud. Enjoy Coding!! 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 either by number of instance(s) OR kontena(s) descale # Descale application either by number of instance(s) OR kontena(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 addCustomURL # Add a custom URL to an app removeCustomURL # Remove a custom URL from an app customURLInfo # List all custom URL(s) of an app Services createService # Creates a new service e.g. MySQL, MongoDB, CouchDB, PostgreSQL, Redis etc. deleteService # Delete provisioned service startService # Start the service restartService # Restart the service stopService # Stop the service resetServicePassword # Reset password of provisioned service scaleService # Vertically scale service by number of Kontena(s) descaleService # Vertically descale services by number of Kontena(s) uploadBackup # Upload existing backup into a service bindIP # Bind IP to provisioned service unbindIP # Unbind IP from provisioned service bindInfo # Show IP bind information related to provisioned service services # List all the provisioned services with their meta details serviceInfo # Show meta information of the provisioned service BPaaS setupBPaaS # Setup App42 BPaaS by choosing required configuration deleteBPaaS # Delete the BPaaS setup startBPaaS # Start the BPaaS setup stopBPaaS # Stop the BPaaS setup restartBPaaS # Restart the BPaaS setup upgradeBPaas # Upgrade BPaaS by choosing required configuration downgradeBPaas # Downgrade BPaaS by choosing required configuration bPaaSInfo # Show BPaaS setup information bPaaSSetups # List all the BPaaS setups WordPress setupWordPress # Setup App42 WordPress by choosing required configuration deleteWordPress # Delete the WordPress setup startWordPress # Start the WordPress setup stopWordPress # Stop the WordPress setup restartWordPress # Restart the WordPress setup upgradeWordPress # Upgrade WordPress by choosing required configuration downgradeWordPress # Downgrade WordPress by choosing required configuration wordPressInfo # Show WordPress setup information wordPressSetups # List all the WordPress setups GPaaS setupGPaaS # Setup App42 GPaaS by choosing required configuration deleteGPaaS # Delete the GPaaS setup startGPaaS # Start the GPaaS setup stopGPaaS # Stop the GPaaS setup restartGPaaS # Restart the GPaaS setup upgradeGPaas # Upgrade GPaaS by choosing required configuration downgradeGPaas # Downgrade GPaaS by choosing required configuration gPaaSInfo # Show GPaaS setup information gPaaSSetups # List all the GPaaS setups Help version # Show Ruby client gem version help # List available commands and their description COMMAND --help # Display detailed help of a specific command 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 USAGE end def self.keys_help print <<-USAGE #{how_to} app42 api_key:add [KEY] # add a api key for the current user app42 secret_key:add [KEY] # add a Secret Key for the current user app42 keys:clear # remove all authentication keys from the current user USAGE end # call help methods def Help.usage command if self.respond_to?(command) send command elsif self.respond_to?(command.split(':').last) send command.split(':').last elsif self.respond_to?(command.split('-').join('_')) send command.split('-').join('_') else Paint["Sorry..!!, Help is not available.\n", :red] end end class << self def keys print <<-DESC Usage: app42 keys List API key and Secret key Example: === API/Secret Key === API Key = Secret Key = DESC end def addkeys print <<-DESC Usage: app42 addKeys Add API key and Secret key Options: [--apiKey=API_KEY] # API Key to add. [--secretKey=SECRET_KEY] # Secret Key to add. Example: $app42 addKeys == Enter your App42PaaS keys == Enter API Key:: Enter Secret Key:: Adding keys...done DESC end def clearkeys print <<-DESC Usage: app42 clearKeys Clear API key and Secret key Example: app42 clearKeys Do you want to delete existing keys? [Yn]: y === API key and Secret key have been deleted. === DESC end def setupinfra print <<-DESC Usage: app42 setupInfra Setup your deployment and runtime environment i.e. Instance(Memory, CPU) and Technology Stack Example: $app42 setupInfra Enter App Name: demo Checking App Name Availability... OK 1: Shared Select Instance Type [Shared]: 1: Amazon (Oregon) Select IaaS Provider [Amazon (Oregon)]: 1: Ruby 2.0.0 2: Java 6 3: Java 7 4: PHP 5.3 5: PHP 5.5 6: Node 0.10.22 Select Runtime [Ruby 2.0.0]: 1: Ruby on Rack 2: Rails 4.0 3: Sinatra 1.4 Select Framework [Ruby on Rack ]: 1: Passenger 4.0 2: Thin 1.6 3: Unicorn 4.7 Select Web Server [Passenger 4.0]: Specify Kontena Power: 1 Setting up the infrastructure... OK Operation is in progress, Please wait...| Setup Infra has been completed successfully. Default application has been deployed. You can visit 'https://demo.iab.app42paas.com' to see the default application. DESC end def deploy print <<-DESC Usage: app42 deploy Deploy the application over your runtime environment Options: [--app APP] # Name of app, you want to update Example: $app42 deploy Enter App Name: demo 1: Binary 2: Source Choose Upload Type [Binary]: 2 Enter Git URL?: https://github.com/shepHertz/demo.git Deploying Application... OK Operation is in progress, Please wait...| App has been deployed successfully. DESC end def update print <<-DESC Usage: app42 update Update the application over your runtime environment Options: [--app APP] # Name of app, you want to update Example: $app42 update Enter App Name: demo 1: Binary 2: Source Choose Upload Type [Binary]: 2 Updating Application... OK Operation is in progress, Please wait...- App has been deployed successfully. DESC end def scale print <<-DESC Usage: app42 scale Scale application either by number of instance(s) OR kontena(s) Options: [--app APP] # Name of app, you want to scale Example: $app42 scale Enter App Name: demo 1: Horizontal 2: Vertical Choose Scale Type [Horizontal]: Horizontal scale by instance(s) [1]: Scaling Application demo by instance 1... OK Operation is in progress, Please wait...- Scale has been completed successfully. DESC end def descale print <<-DESC Usage: app42 descale Descale application either by number of instance(s) OR kontena(s) Options: [--app APP] # Name of app, you want to descale Example: $app42 descale Enter App Name: demo 1: Horizontal 2: Vertical Choose Scale Type [Horizontal]: Horizontal descale by instance(s) [1]: 1 Descaling Application demo by instance 1... OK Operation is in progress, Please wait...| Descale has been completed successfully. DESC end def start print <<-DESC Usage: app42 start Start the application Options: [--app APP] # Name of app, you want to start Example: $app42 start --app demo Starting Application demo... OK Operation is in progress, Please wait... 1 out of 3 started - 2 out of 3 started | App has been started successfully. DESC end def stop print <<-DESC Usage: app42 stop Stop the application Options: [--app APP] # Name of app, you want to stop Example: $app42 stop --app demo Stopping Application demo... OK Operation is in progress, Please wait...- 1 out of 3 stopped - 2 out of 3 stopped - App has been stopped successfully. DESC end def restart print <<-DESC Usage: app42 restart Restart the application Options: [--app APP] # Name of app, you want to restart Example: $app42 start --app demo Restarting Application demo... OK Operation is in progress, Please wait... 1 out of 3 restarted - 2 out of 3 restarted | App has been restarted successfully. DESC end def deleteinfra print <<-DESC Usage: app42 deleteInfra Delete the Infrastructure environment Options: [--app APP] # Name of app, you want to delete Example: $app42 deleteInfra --app demo Deleting Application demo... OK Operation is in progress, Please wait... 1 out of 3 deleted - 2 out of 3 deleted | App has been deleted successfully. DESC end def apps print <<-DESC Usage: app42 apps List all the deployed applications with their meta details Example: $app42 apps +--------------------------------+------------+-----------------+--------------------------+------+------------+----------------+---------------+--------+ | === My Apps === | +--------------------------------+------------+-----------------+--------------------------+------+------------+----------------+---------------+--------+ | App Url | App Status | Iaas Provider | Email | Name | Runtime | Instance Count | Framework | Memory | +--------------------------------+------------+-----------------+--------------------------+------+------------+----------------+---------------+--------+ | https://demo.iab.app42paas.com | RUNNING | Amazon (Oregon) | pravinmishra88@gmail.com | demo | Ruby 2.0.0 | 1 | Ruby on Rack | 256 MB | +--------------------------------+------------+-----------------+--------------------------+------+------------+----------------+---------------+--------+ DESC end def appinfo print <<-DESC Usage: app42 appInfo Show the meta information of the application Options: [--app APP] # Name of app, you want to info Example: $app42 appInfo Enter App Name: demo +--------------------------------+------------+-----------------+------+------------+----------------+---------------+--------+ | === demo Info === | +--------------------------------+------------+-----------------+------+------------+----------------+---------------+--------+ | App Url | App Status | Iaas Provider | Name | Runtime | Instance Count | Framework | Memory | +--------------------------------+------------+-----------------+------+------------+----------------+---------------+--------+ | https://demo.iab.app42paas.com | RUNNING | Amazon (Oregon) | demo | Ruby 2.0.0 | 1 | Ruby on Rack | 256 MB | +--------------------------------+------------+-----------------+------+------------+----------------+---------------+--------+ DESC end def appstate print <<-DESC Usage: app42 appState Show current state of the application Options: [--app APP] # Name of app Example: $app42 appState --app demo +--------------------+ | === demo State === | +--------------------+ | RUNNING | +--------------------+ DESC end def logs print <<-DESC Usage: app42 logs Returns the log URL(s) for the application Example: $app42 logs Enter App Name: demo Please visit below URL(s) to access app logs +-----------------------------------------------------------------------------------+ | Log URL(s) | +-----------------------------------------------------------------------------------+ | https://apphq.app42paas.com/app/getInstanceLog?id=eyk3t10hz9nwc12e08f92jxcmz83uo2u | | https://apphq.app42paas.com/app/getInstanceLog?id=zijqty8n5ufna677wgbxwywca5laqkw5 | | https://apphq.app42paas.com/app/getInstanceLog?id=wynv58rt509yj7fqwbkh80zlw6isf6g2 | +-----------------------------------------------------------------------------------+ DESC end def addcustomurl print <<-DESC Usage: app42 addCustomURL Add a custom URL to an app Example: $app42 addCustomURL Enter App Name: demo Enter Custom URL: http://test.naveengoswami.com Adding Custom URL To Application demo... OK Custom URL added successfully. DESC end def removecustomurl print <<-DESC Usage: app42 removeCustomURL Remove a custom URL from an app Example: $ app42 removeCustomURL Enter App Name: demo Enter Custom URL: http://test.naveengoswami.com Removing Custom URL... OK Custom URL deleted successfully. DESC end def customurlinfo print <<-DESC Usage: app42 customURLInfo List all custom URLs of an app Example: $app42 customURLInfo Enter App Name: demo +----------+-----------------------+-------------------------------+ | === testPhp Custome URLs Details === | +----------+-----------------------+-------------------------------+ | App Name | Created On | Url | +-------------+-----------------------+----------------------------+ | demo | 2014-01-27 06:35:55.0 | http://test.naveengoswami.com | +----------+-----------------------+-------------------------------+ DESC end def createservice print <<-DESC Usage: app42 createService Creates a new service e.g. MySQL, MongoDB, CouchDB, PostgreSQL etc. Example: $app42 createService Enter Service Name: mysqldemo Deleting Service... OK Operation is in progress, Please wait... Service has been deleted successfully. ubuntu@ubuntu-Lenovo-G580:~/workspace/App42PasS/PaaS/app42$ app42 createService Enter Service Name: mysqldb Checking Service Name Availability... OK 1: MySQL 5.5.31 2: Mongodb 2.4.4 3: Couchdb 1.0.1 4: PostgreSQL 9.1.9 5: Redis 2.8.3 Select Service [MySQL 5.5.31]: Enter Database Name: demo_db 1: Shared Select Instance Type [Shared]: 1: Amazon (Oregon) Select IaaS Provider [Amazon (Oregon)]: Specify Kontena Power: 1 Creating Service... OK Operation is in progress, Please wait...- Service has been created successfully. +---------------+-----------------+----------------------------------+--------------+---------+------------------+-----------+---------+--------------+----------------+----------------------------------+--------+--------------+ | === mysqldb Details === | +---------------+-----------------+----------------------------------+--------------+---------+------------------+-----------+---------+--------------+----------------+----------------------------------+--------+--------------+ | Database Name | Iaas Provider | Token | Vm Ip | State | User Name | Source Ip | Vm Port | Service Type | Destination Ip | Password | Memory | Service Name | +---------------+-----------------+----------------------------------+--------------+---------+------------------+-----------+---------+--------------+----------------+----------------------------------+--------+--------------+ | demo_db | Amazon (Oregon) | 0pcmpc64srphrwijmy616uipdjv7t0oi | 172.16.2.167 | RUNNING | admk0ltirejxgh3o | | 27875 | MySQL 5.5.31 | | a66tyn077yhlx2gue0t2nsjplls56g7m | 256 MB | mysqldb | +---------------+-----------------+----------------------------------+--------------+---------+------------------+-----------+---------+--------------+----------------+----------------------------------+--------+--------------+ DESC end def deleteservice print <<-DESC Usage: app42 deleteService Delete the provisioned service Options: [--service SERVICE] # Name of service Example: $app42 deleteService Enter Service Name: mysqldb Deleting Service... OK Operation is in progress, Please wait...| Service has been deleted successfully. DESC end def startservice print <<-DESC Usage: app42 startService Start the service Options: [--app Service] # Name of service, you want to start Example: $app42 startService Enter Service Name: mysqldb Starting Service mysqldb... OK Operation is in progress, Please wait...- Service has been started successfully. DESC end def restartservice print <<-DESC Usage: app42 restartService Restart the service Options: [--app Service] # Name of service, you want to start Example: $app42 restartService Enter Service Name: mysqldb Restarting Service mysqldb... OK Operation is in progress, Please wait... Service has been restarted successfully. DESC end def stopservice print <<-DESC Usage: app42 stopService Stop the service Options: [--app Service] # Name of service, you want to start Example: $app42 stopService Enter Service Name: mysqldb Stopping Service mysqldb... OK Operation is in progress, Please wait... Service has been stopped successfully. DESC end def resetservicepassword print <<-DESC Usage: resetServicePassword Reset the password of provisioned service Example: $resetServicePassword Enter Service Name: mysqldemo Enter Old Password: teh77o4b6kpb22ab6oogfu9lwru9vrlj Resetting Password... OK Operation is in progress, Please wait.../ Service Password has been reset successfully. Your new password is: z2qo1vxeadak6jsmt9upobytwptc5eo0 DESC end def scaleservice print <<-DESC Usage: app42 scaleService Vertically scale service by number of kontena(s) Options: [--service SERVICE] # Name of service, you want to scale Example: $app42 scaleService Enter Service Name: mysqldb Vertical scale by kontena power(s) [1]: 1 Scaling Service 'mysqldb' by kontena 1... OK Operation is in progress, Please wait...| Vertical Scale has been completed successfully. DESC end def descaleservice print <<-DESC Usage: app42 descaleService Vertically descale service by number of kontena(s) Options: [--service SERVICE] # Name of service, you want to scale Example: $app42 descaleService Enter Service Name: mysqldb Vertical descale by kontena power(s) [1]: 1 Descaling Service 'mysqldb' by kontena 1... OK Operation is in progress, Please wait...- Vertical Descale has been completed successfully. DESC end def uploadbackup print <<-DESC Usage: app42 uploadBackup Upload file data into a service Options: [--service SERVICE] # Name of service, you want to scale Example: $app42 uploadBackup Enter Service Name: mysqldb Enter Backup File Path: /home/ubuntu/Downloads/demo_production-27Nov2013.sql Do you also want to restore uploaded backup? [Yn]: n Please be patient... This process may take a while to complete. Uploading Service Backup... OK Operation is in progress, Please wait... Backup has been successfully restored. DESC end def bindip print <<-DESC Usage: app42 bindIP Bind IP to provisioned service Example: $app42 bindIP Enter Service Name: mysqldb Please Provide Source IP (For public access, use '0.0.0.0'): 0.0.0.0 Binding IP to service... OK Operation is in progress, Please wait... Service binding has been completed successfully. +---------------+-----------------+----------------------------------+---------------+-----------+---------+------------------+---------+--------------+----------------------------------+--------+--------------+ | === mysqldb Details === | +---------------+-----------------+----------------------------------+---------------+-----------+---------+------------------+---------+--------------+----------------------------------+--------+--------------+ | Database Name | Iaas Provider | Token | Vm Ip | Source Ip | State | User Name | Vm Port | Service Type | Password | Memory | Service Name | +---------------+-----------------+----------------------------------+---------------+-----------+---------+------------------+---------+--------------+----------------------------------+--------+--------------+ | demo_db | Amazon (Oregon) | 0pcmpc64srphrwijmy616uipdjv7t0oi | 54.213.93.154 | 0.0.0.0 | RUNNING | admk0ltirejxgh3o | 15847 | MySQL 5.5.31 | vagyqxta6e0a8q5jxunlr43v6cwohmdj | 256 MB | mysqldb | +---------------+-----------------+----------------------------------+---------------+-----------+---------+------------------+---------+--------------+----------------------------------+--------+--------------+ DESC end def unbindip print <<-DESC Usage: app42 unbindIP Unbind IP from provisioned service Example: $app42 unbindIP Enter Service Name: mysqldb Please Provide Source IP: 0.0.0.0 Unbinding IP to service... OK Operation is in progress, Please wait... Service unbinding has been completed successfully. DESC end def bindinfo print <<-DESC Usage: app42 bindInfo Show IP bind information related to provisioned service Example: $app42 bindInfo 1: mysqldb 2: redisdb Select Service [mysqldb]: +---------------+-----------------+----------------------------------+---------------+-----------+---------+------------------+---------+--------------+----------------------------------+--------+--------------+ | === mysqldb Details === | +---------------+-----------------+----------------------------------+---------------+-----------+---------+------------------+---------+--------------+----------------------------------+--------+--------------+ | Database Name | Iaas Provider | Token | Vm Ip | Source Ip | State | User Name | Vm Port | Service Type | Password | Memory | Service Name | +---------------+-----------------+----------------------------------+---------------+-----------+---------+------------------+---------+--------------+----------------------------------+--------+--------------+ | demo_db | Amazon (Oregon) | 0pcmpc64srphrwijmy616uipdjv7t0oi | 54.213.93.154 | 0.0.0.0 | RUNNING | admk0ltirejxgh3o | 15847 | MySQL 5.5.31 | vagyqxta6e0a8q5jxunlr43v6cwohmdj | 256 MB | mysqldb | +---------------+-----------------+----------------------------------+---------------+-----------+---------+------------------+---------+--------------+----------------------------------+--------+--------------+ DESC end def services print <<-DESC Usage: app42 services List the all provisioned services with their meta details Example: $app42 services +---------------+---------------+-----------+-----------+---------+------------------+---------+--------------+----------------------------------+--------+ | === Service List === | +---------------+---------------+-----------+-----------+---------+------------------+---------+--------------+----------------------------------+--------+ | Database Name | Iaas Provider | Name | Vm Ip | State | User Name | Vm Port | Service Type | Password | Memory | +---------------+---------------+-----------+-----------+---------+------------------+---------+--------------+----------------------------------+--------+ | demodb | Amazon | mysqldemo | 10.0.0.52 | RUNNING | j7zz1jsx1bb4eiz1 | 49695 | MySQL 5.5.1 | teh77o4b6kpb22ab6oogfu9lwru9vrlj | 512 MB | +---------------+---------------+-----------+-----------+---------+------------------+---------+--------------+----------------------------------+--------+ DESC end def serviceinfo print <<-DESC Usage: app42 serviceInfo Show meta information of the provisioned service Options: [--service SERVICE] # Name of service Example: $ app42 serviceInfo 1: mysqldb Select Service [mysqldb]: 1 +---------------+-----------------+----------------------------------+--------------+---------+------------------+-----------+---------+--------------+----------------+----------------------------------+--------+--------------+ | === mysqldb Details === | +---------------+-----------------+----------------------------------+--------------+---------+------------------+-----------+---------+--------------+----------------+----------------------------------+--------+--------------+ | Database Name | Iaas Provider | Token | Vm Ip | State | User Name | Source Ip | Vm Port | Service Type | Destination Ip | Password | Memory | Service Name | +---------------+-----------------+----------------------------------+--------------+---------+------------------+-----------+---------+--------------+----------------+----------------------------------+--------+--------------+ | demo_db | Amazon (Oregon) | 0pcmpc64srphrwijmy616uipdjv7t0oi | 172.16.2.167 | RUNNING | admk0ltirejxgh3o | 0.0.0.0 | 15847 | MySQL 5.5.31 | 54.213.93.154 | vagyqxta6e0a8q5jxunlr43v6cwohmdj | 256 MB | mysqldb | +---------------+-----------------+----------------------------------+--------------+---------+------------------+-----------+---------+--------------+----------------+----------------------------------+--------+--------------+ DESC end def setupbpaas print <<-DESC Usage: app42 setupBPaaS Setup App42 BPaaS by choosing required configuration Example: $app42 setupBPaaS Enter Setup Name: demo Checking Setup Name Availability... OK 1: Shared Select Instance Type [Shared]: 1: Amazon (Oregon) Select IaaS Provider [Amazon (Oregon)]: 1: Light 2: Medium 3: Heavy Select Flavour [Light]: Setting up the BPaaS infrastructure... OK Operation is in progress, Please wait...- BPaaS Setup has been completed successfully. Your BPaaS setup has been completed successfully, For details, Login to PaaSHQ console. DESC end def deletebpaas print <<-DESC Usage: app42 deleteBPaaS Delete the setup Example: $app42 deleteBPaaS Enter Setup Name: demo Deleting Setup... OK Operation is in progress, Please wait...- Setup deleted successfully. DESC end def startbpaas print <<-DESC Usage: app42 startBPaaS Start the BPaaS setup Example: $app42 startBPaaS Enter Setup Name: demo Starting BPaaS Setup demo... OK Operation is in progress, Please wait...| BPaaS setup demo started successfully. DESC end def stopbpaas print <<-DESC Usage: app42 stopBPaaS Stop the BPaaS setup Example: $app42 stopBPaaS Enter Setup Name: demo Stopping BPaaS Setup demo... OK Operation is in progress, Please wait...| BPaaS setup demo stopped successfully. DESC end def restartbpaas print <<-DESC Usage: app42 restartBPaaS Restart the BPaaS setup Example: $app42 restartBPaaS Enter Setup Name: demo Restarting BPaaS Setup demo... OK Operation is in progress, Please wait...| BPaaS setup demo restarted successfully. DESC end def upgradebpaas print <<-DESC Usage: app42 upgradeBPaaS Upgrade BPaaS by choosing required configuration Example: $app42 upgradeBPaaS Enter Setup Name: demo 1: Medium 2: Heavy Select Flavour [Medium]: 2 Upgrading Setup... OK Operation is in progress, Please wait...- BPaaS setup demo upgraded successfully. DESC end def downgradebpaas print <<-DESC Usage: app42 downgradeBPaaS Downgrade BPaaS by choosing required configuration Example: $app42 downgradeBPaaS Enter Setup Name: demo 1: Light 2: Medium Select Flavour [Light]: 2 Downgrading Setup... OK Operation is in progress, Please wait...- BPaaS setup demo downgraded successfully. DESC end def bpaasinfo print <<-DESC Usage: app42 bPaaSInfo Show setup information Example: $app42 bPaaSInfo Enter Setup Name: demo +-----------------------+----------------------------------------+------------+-----------------+------------+---------+---------------+--------------+-------------------------------------+ | === demo Details === | +-----------------------+----------------------------------------+------------+-----------------+------------+---------+---------------+--------------+-------------------------------------+ | Created On | Api Server Url | Setup Name | Iaas Provider | Setup Type | Vm Type | Setup Flavour | Setup Status | App Hq Url | +-----------------------+----------------------------------------+------------+-----------------+------------+---------+---------------+--------------+-------------------------------------+ | 2014-02-24 08:00:21.0 | https://democloudapi.iab.app42paas.com | demo | Amazon (Oregon) | BPaaS | Shared | light | RUNNING | https://demoapphq.iab.app42paas.com | +-----------------------+----------------------------------------+------------+-----------------+------------+---------+---------------+--------------+-------------------------------------+ DESC end def bpaassetups print <<-DESC Usage: app42 bPaaSSetups List all the BPaaS setups Example: $app42 bPaaSSetups +-----------------------+----------------------------------------+------------+-----------------+------------+--------------------------+---------+---------------+--------------+-------------------------------------+ | === Setups List === | +-----------------------+----------------------------------------+------------+-----------------+------------+--------------------------+---------+---------------+--------------+-------------------------------------+ | Created On | Api Server Url | Setup Name | Iaas Provider | Setup Type | Email | Vm Type | Setup Flavour | Setup Status | App Hq Url | +-----------------------+----------------------------------------+------------+-----------------+------------+--------------------------+---------+---------------+--------------+-------------------------------------+ | 2014-02-24 08:00:21.0 | https://democloudapi.iab.app42paas.com | demo | Amazon (Oregon) | BPaaS | pravinmishra88@gmail.com | Shared | light | RUNNING | https://demoapphq.iab.app42paas.com | +-----------------------+----------------------------------------+------------+-----------------+------------+--------------------------+---------+---------------+--------------+-------------------------------------+ DESC end def setupwordpress print <<-DESC Usage: app42 setupWordPress Setup App42 WordPress by choosing required configuration Example: $app42 setupWordPress Enter Wordpress Name: demo Checking WordPress Name Availability... OK 1: Shared Select Instance Type [Shared]: 1: Amazon (Oregon) Select IaaS Provider [Amazon (Oregon)]: 1: Light 2: Medium 3: Heavy Select Flavour [Light]: Setting up the wordpress infrastructure... OK Operation is in progress, Please wait...- WordPress Setup has been completed successfully. Your WordPress setup has been completed successfully, For details, Login to PaaSHQ console. DESC end def deletewordpress print <<-DESC Usage: app42 deleteWordPress Delete the WordPress setup Example: $app42 deleteWordPress Enter Setup Name: demo Deleting Setup... OK Operation is in progress, Please wait...- WordPress Setup has been deleted successfully. DESC end def startwordpress print <<-DESC Usage: app42 startWordPress Start the WordPress setup Example: $app42 startWordPress Enter Wordpress Name: demo Starting Wordpress Setup demo... OK Operation is in progress, Please wait...| WordPress Setup has been started successfully. DESC end def stopwordpress print <<-DESC Usage: app42 stopWordPress Stop the WordPress setup Example: $app42 stopWordPress Enter Wordpress Name: demo Stopping Wordpress Setup demo... OK Operation is in progress, Please wait...| WordPress Setup has been stopped successfully. DESC end def restartwordpress print <<-DESC Usage: app42 restartWordPress Restart the WordPress setup Example: $app42 restartWordPress Enter Wordpress Name: demo Restarting Wordpress Setup demo... OK Operation is in progress, Please wait...- WordPress Setup has been restarted successfully. DESC end def upgradewordpress print <<-DESC Usage: app42 upgradeWordpress Upgrade WordPress by choosing required configuration Example: $app42 upgradeWordPress Enter Setup Name: demo 1: Medium 2: Heavy Select Flavour [Medium]: 2 Upgrading Setup... OK Operation is in progress, Please wait...- WordPress setup demo upgraded successfully. DESC end def downgradewordpress print <<-DESC Usage: app42 downgradeWordpress Downgrade WordPress by choosing required configuration Example: $app42 downgradeWordPress Enter Setup Name: demo 1: Light 2: Medium Select Flavour [Light]: 2 Downgrading Setup... OK Operation is in progress, Please wait...- WordPress setup demo downgraded successfully. DESC end def wordpressinfo print <<-DESC Usage: app42 wordPressInfo Show WordPress setup information Options: [--setup SETUP] # Name of setup, you want to info Example: $app42 wordPressInfo Enter Setup Name: demo +-----------------------+----------------------------------------+------------+----------------------------+------------+---------+---------------+--------------+ | === demo Details === | +-----------------------+----------------------------------------+------------+----------------------------+------------+---------+---------------+--------------+ | Created On | Api Server Url | Setup Name | Iaas Provider | Setup Type | Vm Type | Setup Flavour | Setup Status | +-----------------------+----------------------------------------+------------+----------------------------+------------+---------+---------------+--------------+ | 2014-01-02 10:10:38.0 | http://demowordpress.iaa.app42paas.com | demo | Amazon (Northern Virginia) | WP | Shared | medium | RUNNING | +-----------------------+----------------------------------------+------------+----------------------------+------------+---------+---------------+--------------+ DESC end def wordpresssetups print <<-DESC Usage: app42 wordPressSetups List all the WordPress setups Example: $app42 wordPressSetups +-----------------------+----------------------------------------+------------+----------------------------+------------+---------+---------------+--------------+ | === Setups List === | +-----------------------+----------------------------------------+------------+----------------------------+------------+---------+---------------+--------------+ | Created On | App Url | Setup Name | Iaas Provider | Setup Type | Vm Type | Setup Flavour | Setup Status | +-----------------------+----------------------------------------+------------+----------------------------+------------+---------+---------------+--------------+ | 2014-01-02 10:10:38.0 | http://demowordpress.iaa.app42paas.com | demo | Amazon (Northern Virginia) | WP | Shared | medium | RUNNING | +-----------------------+----------------------------------------+------------+----------------------------+------------+---------+---------------+--------------+ DESC end def setupgpaas print <<-DESC Usage: app42 setupGPaaS Setup App42 GPaaS by choosing required configuration Example: $ app42 setupGPaaS Enter Setup Name: demo Checking Setup Name Availability... OK 1: Amazon (Northern Virginia) Select IaaS Provider [Amazon (Northern Virginia)]: 1: t1.micro 2: m1.small 3: m1.medium 4: m1.large 5: m1.xlarge Select Instance Configuration [t1.micro]: Setting up the GPaaS infrastructure... OK Operation is in progress, Please wait...| GPaaS Setup has been completed successfully. Your GPaaS setup has been completed successfully, For details, Login to PaaSHQ console. DESC end def deletegpaas print <<-DESC Usage: app42 deleteGPaaS Delete the GPaaS setup Example: $app42 deleteGPaaS Enter Setup Name: demo Deleting Setup... OK Operation is in progress, Please wait...| GPaaS Setup has been deleted successfully. DESC end def startgpaas print <<-DESC Usage: app42 startGPaaS Start the GPaaS setup Example: $app42 startGPaaS Enter Setup Name: demo Starting GPaaS Setup fsdfds... OK Operation is in progress, Please wait...- GPaaS Setup has been started successfully. DESC end def stopgpaas print <<-DESC Usage: app42 stopGPaaS Stop the GPaaS setup Example: $app42 stopGPaaS Enter Setup Name: demo Stopping GPaaS Setup demo... OK Operation is in progress, Please wait...| GPaaS Setup has been stopped successfully. DESC end def restartgpaas print <<-DESC Usage: app42 restartGPaaS Restart the GPaaS setup Example: $app42 restartGPaaS Enter Setup Name: demo Restarting GPaaS Setup demo... OK Operation is in progress, Please wait...| GPaaS Setup has been restarted successfully. DESC end def upgradegpaas print <<-DESC Usage: app42 upgradeGPaaS Upgrade GPaaS by choosing required configuration Example: $app42 upgradeGPaaS Enter Setup Name: demo 1: m1.small 2: m1.medium 3: m1.large 4: m1.xlarge Select Instance Configuration [m1.small]: Upgrading Setup... OK Operation is in progress, Please wait...| GPaaS Setup has been updated successfully. DESC end def downgradegpaas print <<-DESC Usage: app42 downgradeGPaaS Downgrade GPaaS by choosing required configuration Example: $app42 downgradeGPaaS Enter Setup Name: demo 1: t1.micro Select Instance Configuration [t1.micro]: Downgrading Setup... OK Operation is in progress, Please wait...- GPaaS Setup has been updated successfully. DESC end def gpaasinfo print <<-DESC Usage: app42 gPaaSInfo Show GPaaS setup information Options: [--setup SETUP] # Name of setup, you want to info Example: $ app42 gPaaSInfo Enter Setup Name: demo +-----------------------+-------------------------------------------+------------+----------------------------+------------+-----------+---------------+--------------+ | === gpaas Details === | +-----------------------+-------------------------------------------+------------+----------------------------+------------+-----------+---------------+--------------+ | Created On | Api Server Url | Setup Name | Iaas Provider | Setup Type | Vm Type | Setup Flavour | Setup Status | +-----------------------+-------------------------------------------+------------+----------------------------+------------+-----------+---------------+--------------+ | 2014-02-21 09:36:43.0 | ec2-54-237-87-107.compute-1.amazonaws.com | demo | Amazon (Northern Virginia) | GPaaS | Dedicated | t1.micro | RUNNING | +-----------------------+-------------------------------------------+------------+----------------------------+------------+-----------+---------------+--------------+ DESC end def gpaassetups print <<-DESC Usage: app42 gPaaSSetups List all the GPaaS setups Example: $app42 app42 gPaaSSetups +-----------------------+-------------------------------------------+------------+----------------------------+------------+--------------------------+-----------+---------------+--------------+ | === Setups List === | +-----------------------+-------------------------------------------+------------+----------------------------+------------+--------------------------+-----------+---------------+--------------+ | Created On | App Url | Setup Name | Iaas Provider | Setup Type | Email | Vm Type | Setup Flavour | Setup Status | +-----------------------+-------------------------------------------+------------+----------------------------+------------+--------------------------+-----------+---------------+--------------+ | 2014-02-06 13:49:07.0 | ec2-54-221-96-246.compute-1.amazonaws.com | demo | Amazon (Northern Virginia) | GPaaS | pravinmishra88@gmail.com | Dedicated | t1.micro | RUNNING | +-----------------------+-------------------------------------------+------------+----------------------------+------------+--------------------------+-----------+---------------+--------------+ DESC end def supportedservices print <<-DESC Usage: app42 supportedServices List the supported services by App42 Example: $app42 supportedServices +--------------+--------------+ | === App42 PaaS Services === | +--------------+--------------+ | Name | Version | +--------------+--------------+ | MySQL | 5.5.1 | | Mongodb | 2.4 | | Couchdb | 10.1 | | PostgreSQL | 9.1 | +--------------+--------------+ DESC end def activities print <<-DESC Usage: app42 activities List all activities with their status Example: $app42 activities +------------+-----------+------+------+-----------------------+ | === User Activities === | +------------+-----------+------+------+-----------------------+ | Operation | Status | Name | Type | Date | +------------+-----------+------+------+-----------------------+ | setupInfra | COMPLETED | demo | APP | 2013-10-25 06:18:42.0 | | scale | COMPLETED | demo | APP | 2013-10-25 06:40:39.0 | | scale | COMPLETED | demo | APP | 2013-10-25 06:41:25.0 | | descale | COMPLETED | demo | APP | 2013-10-25 06:42:12.0 | | descale | COMPLETED | demo | APP | 2013-10-25 06:42:13.0 | | restart | COMPLETED | demo | APP | 2013-10-25 06:44:31.0 | | stop | COMPLETED | demo | APP | 2013-10-25 06:45:23.0 | | start | COMPLETED | demo | APP | 2013-10-25 06:45:49.0 | | scale | COMPLETED | demo | APP | 2013-10-25 06:52:56.0 | | scale | COMPLETED | demo | APP | 2013-10-25 06:53:24.0 | | descale | COMPLETED | demo | APP | 2013-10-25 06:58:10.0 | | descale | COMPLETED | demo | APP | 2013-10-25 06:58:10.0 | +------------+-----------+------+------+-----------------------+ DESC end def runtimes print <<-DESC Usage: app42 runtimes List the supported runtimes Example: $app42 runtimes +--------------+--------------+ | === Available Runtimes === | +--------------+--------------+ | Name | Version | +--------------+--------------+ | Ruby | 2.0 | | Java | 6.0 | | Java | 7.0 | | Php | 5.3 | | Php | 5.5 | +--------------+--------------+ DESC end def iaasproviders print <<-DESC Usage: app42 iaasProviders List the supported IaaS providers by App42 Example: $app42 iaasProviders +-----------------+-----------------+ | === Available IaaS Providers === | +-----------------+-----------------+ | Name | Zone | +-----------------+-----------------+ | Amazon | (Oregon) | +-----------------+-----------------+ DESC end def version print <<-DESC Usage: app42 version Show Ruby client gem version Example: $app42 version App42 current version: 0.5.3 DESC end end end end end