Module: App42
- Defined in:
- lib/app42/base/help.rb,
lib/app42.rb,
lib/app42/version.rb,
lib/app42/base/util.rb,
lib/app42/base/shell.rb,
lib/app42/command/app.rb,
lib/app42/command/base.rb,
lib/app42/command/info.rb,
lib/app42/command/user.rb,
lib/app42/command/gpaas.rb,
lib/app42/command/setup.rb,
lib/app42/base/constants.rb,
lib/app42/command/client.rb,
lib/app42/client/rest_util.rb,
lib/app42/command/user_key.rb,
lib/app42/command/wordpress.rb,
lib/app42/client/app42_rest_client.rb
Overview
A Ruby class to call the App42 REST API.
Defined Under Namespace
Modules: Base, Client, Command, Version
Constant Summary collapse
- APP42_AGENT =
"app42-gem(#{App42::Version::VERSION::VERSION}) (#{RUBY_PLATFORM}) ruby(#{RUBY_VERSION})"
- VERSION =
app42 server version
1.0.to_s
- HOST =
app42 host url
"https://paashq.shephertz.com/paas/#{VERSION}"
- CONFIG_DIR =
app42 configuration directory
"~/.app42".freeze
- LOGS_DIR =
TODO, need to configure for client log
"#{CONFIG_DIR}/logs".freeze
- KEYS_FILE =
"#{CONFIG_DIR}/app42paas.yml".freeze
- JSON_MIME_TYPE =
"application/json".freeze
- XML_MIME_TYPE =
"application/xml".freeze
- APP42_HTTP_ERROR_CODES =
Error codes
[ 1500 ]
- SCALE_TYPE =
Scale type
['Horizontal', 'Vertical']
- SUBSCRIPTION_TYPE =
Subscription type
['FREE', 'PAID']
- FLAVOUR_TYPE =
flavour type
['light', 'medium', 'heavy']
- APP_STOP =
app operation type
{ "hardStop" => "Hard Stop", "softStop" => "Soft Stop"}
- APP_START =
{ "hardStart" => "Hard Start", "softStart" => "Soft Start"}
- APP_RESTART =
{ "hardRestart" => "Hard Restart", "softRestart" => "Soft Restart"}
- DATABASE_NAME_NOT_ALLOWED =
%w(mysql couchdb mongodb postgresql database sql)
- SPECIAL =
regex for special character
"?<>',?[]}{=-)(*&^%$#`~{}@ .+!_/"
- REGEX =
/[#{SPECIAL.gsub(/./){|char| "\\#{char}"}}]/
- URL_REGEX =
/(((^https?)|(^ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/
- DBNAME_SPECIAL =
regex for special character (Database Name)
"?<>',?[]}{=-)(*&^%$#`~{}@ .+!/"
- DBNAME_REGEX =
/[#{DBNAME_SPECIAL.gsub(/./){|char| "\\#{char}"}}]/
- IP_REGEX =
regex for IP Address
/^([0]?\d\d?|1[0-1,3-9]\d|12[0-6,8-9]|2[0-4]d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.((?!0)|(?!1)|010|(01[0-9]{1,1}&0[1-9]{1,2})|0[0-9]{1,1}[1-9]{1,1}|[2-9]{0,2}|1[0-9]{1,2}|2[0-4]\d|25[0-4])$/
Class Method Summary collapse
Class Method Details
.user_agent ⇒ Object
14 15 16 |
# File 'lib/app42.rb', line 14 def self.user_agent @@user_agent ||= APP42_AGENT end |
.user_agent=(agent) ⇒ Object
18 19 20 |
# File 'lib/app42.rb', line 18 def self.user_agent=(agent) @@user_agent = agent end |