Class: Mu::Homepage

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/mu/api/homepage.rb

Constant Summary

Constants included from Helper

Mu::Helper::ESCAPES

Instance Attribute Summary collapse

Instance Method Summary collapse

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']) ⇒ Homepage

Returns a new instance of Homepage.



7
8
9
10
11
12
13
14
15
16
# File 'lib/mu/api/homepage.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/homepage/"
  @cookie = ""
  @response = nil
  @http = HttpHelper.new(@host, @username, @password, @docroot)
  msg "Created Homepage object to :#{@host}", Logger::DEBUG
end

Instance Attribute Details

Returns the value of attribute cookie.



5
6
7
# File 'lib/mu/api/homepage.rb', line 5

def cookie
  @cookie
end

#docrootObject

Returns the value of attribute docroot.



5
6
7
# File 'lib/mu/api/homepage.rb', line 5

def docroot
  @docroot
end

#errorsObject

Returns the value of attribute errors.



5
6
7
# File 'lib/mu/api/homepage.rb', line 5

def errors
  @errors
end

#failedObject

Returns the value of attribute failed.



5
6
7
# File 'lib/mu/api/homepage.rb', line 5

def failed
  @failed
end

#hostObject

Returns the value of attribute host.



5
6
7
# File 'lib/mu/api/homepage.rb', line 5

def host
  @host
end

#passwordObject

Returns the value of attribute password.



5
6
7
# File 'lib/mu/api/homepage.rb', line 5

def password
  @password
end

#posted_uuidObject

Returns the value of attribute posted_uuid.



5
6
7
# File 'lib/mu/api/homepage.rb', line 5

def posted_uuid
  @posted_uuid
end

#resultsObject

Returns the value of attribute results.



5
6
7
# File 'lib/mu/api/homepage.rb', line 5

def results
  @results
end

#session_idObject

Returns the value of attribute session_id.



5
6
7
# File 'lib/mu/api/homepage.rb', line 5

def session_id
  @session_id
end

#testsuiteObject

Returns the value of attribute testsuite.



5
6
7
# File 'lib/mu/api/homepage.rb', line 5

def testsuite
  @testsuite
end

#usernameObject

Returns the value of attribute username.



5
6
7
# File 'lib/mu/api/homepage.rb', line 5

def username
  @username
end

Instance Method Details

#allObject

returns all homepage elements



19
20
21
22
23
# File 'lib/mu/api/homepage.rb', line 19

def all
  response = @http.get("all/")
  msg response, Logger::DEBUG
  return response
end

#latest_testObject

returns the latest test



40
41
42
43
44
# File 'lib/mu/api/homepage.rb', line 40

def latest_test
  response = @http.get("test/latest/")
  msg response, Logger::DEBUG
  return response
end

#queue_testObject

returns queued tests



47
48
49
50
51
# File 'lib/mu/api/homepage.rb', line 47

def queue_test
  response = @http.get("test/queue/")
  msg response, Logger::DEBUG
  return response
end

#recentObject

returns recent homepage activity



26
27
28
29
30
# File 'lib/mu/api/homepage.rb', line 26

def recent
  response = @http.get("recent/")
  msg response, Logger::DEBUG
  return response
end

#statusObject

returns homepage status



33
34
35
36
37
# File 'lib/mu/api/homepage.rb', line 33

def status
  response = @http.get("status/")
  msg response, Logger::DEBUG
  return response
end