Class: Mu::System
Constant Summary
Constants included from Helper
Instance Attribute Summary collapse
-
#docroot ⇒ Object
Returns the value of attribute docroot.
-
#host ⇒ Object
Returns the value of attribute host.
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(host = ENV['MU_IP'], username = ENV['MU_ADMIN_USER'], password = ENV['MU_ADMIN_PASS']) ⇒ System
constructor
A new instance of System.
-
#restart ⇒ Object
restarts the Mu system.
-
#status ⇒ Object
returns Mu System status.
-
#status2 ⇒ Object
returns more Mu System status.
Methods included from Helper
#ask, #bin2hex, #error, #escape, #format_float, #get_file_as_string_array, #make_xml, #msg, #shift, #to_boolean
Constructor Details
#initialize(host = ENV['MU_IP'], username = ENV['MU_ADMIN_USER'], password = ENV['MU_ADMIN_PASS']) ⇒ System
Returns a new instance of System.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/mu/api/system.rb', line 7 def initialize(host=ENV['MU_IP'], username=ENV['MU_ADMIN_USER'], password=ENV['MU_ADMIN_PASS']) @host = host @username = username @password = password @docroot = "/api/v5/system/" @cookie = "" @response = nil @http = HttpHelper.new(@host, @username, @password, @docroot) msg "Created System Api object to :#{@host}", Logger::DEBUG end |
Instance Attribute Details
#docroot ⇒ Object
Returns the value of attribute docroot.
5 6 7 |
# File 'lib/mu/api/system.rb', line 5 def docroot @docroot end |
#host ⇒ Object
Returns the value of attribute host.
5 6 7 |
# File 'lib/mu/api/system.rb', line 5 def host @host end |
#password ⇒ Object
Returns the value of attribute password.
5 6 7 |
# File 'lib/mu/api/system.rb', line 5 def password @password end |
#username ⇒ Object
Returns the value of attribute username.
5 6 7 |
# File 'lib/mu/api/system.rb', line 5 def username @username end |
Instance Method Details
#restart ⇒ Object
restarts the Mu system
19 20 21 22 23 |
# File 'lib/mu/api/system.rb', line 19 def restart response = @http.get("restart/") msg response, Logger::DEBUG return response end |
#status ⇒ Object
returns Mu System status
26 27 28 29 30 |
# File 'lib/mu/api/system.rb', line 26 def status response = @http.get("status/") msg response, Logger::DEBUG return response end |
#status2 ⇒ Object
returns more Mu System status
33 34 35 36 37 |
# File 'lib/mu/api/system.rb', line 33 def status2 response = @http.get("status2/") msg response, Logger::DEBUG return response end |