Class: Moob::BaseLom

Inherits:
Object
  • Object
show all
Defined in:
lib/moob/baselom.rb

Direct Known Subclasses

IbmEServer, Idrac6, Idrac7, Megatrends, Pec, SunILom, Supermicro

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hostname, options = {}) ⇒ BaseLom

Returns a new instance of BaseLom.


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/moob/baselom.rb', line 10

def initialize hostname, options = {}
  @hostname = hostname
  @transport = options[:transport] or 'https'
  @username = options[:username]
  @password = options[:password]
  @params = options[:params]

  @session  = Patron::Session.new
  @session.headers['User-Agent'] = 'Mozilla/5.0 (Macintosh; '\
    'Intel Mac OS X 10.7; rv:5.0.1) Gecko/20100101 Firefox/5.0.1'
  @session.base_url = "#{@transport}://#{hostname}/"
  @session.connect_timeout = 30
  @session.timeout = 30
  @session.insecure = true
  @session.default_response_charset = 'ISO-8859-1'
end

Instance Attribute Details

#hostnameObject (readonly)

Returns the value of attribute hostname


30
31
32
# File 'lib/moob/baselom.rb', line 30

def hostname
  @hostname
end

#usernameObject (readonly)

Returns the value of attribute username


30
31
32
# File 'lib/moob/baselom.rb', line 30

def username
  @username
end

Class Method Details

.action(sym, descr) ⇒ Object


44
45
46
47
# File 'lib/moob/baselom.rb', line 44

def self.action sym, descr
  @actions ||= []
  @actions << [sym, descr]
end

.actionsObject


40
41
42
# File 'lib/moob/baselom.rb', line 40

def self.actions
  @actions
end

.nameObject


36
37
38
# File 'lib/moob/baselom.rb', line 36

def self.name
  @name
end

Instance Method Details

#detectObject


32
33
34
# File 'lib/moob/baselom.rb', line 32

def detect
  false
end

#logoutObject


27
28
# File 'lib/moob/baselom.rb', line 27

def logout
end