Class: Rubyipmi::Freeipmi::Bmc

Inherits:
BaseCommand show all
Defined in:
lib/rubyipmi/freeipmi/commands/bmc.rb

Instance Attribute Summary collapse

Attributes inherited from BaseCommand

#cmd, #lastcall, #max_retry_count, #options, #passfile, #result

Instance Method Summary collapse

Methods inherited from BaseCommand

#find_fix, #makecommand, #max_retry_count, #setpass, #validate_status

Methods inherited from BaseCommand

#dump_command, #find_fix, #locate_command, #makecommand, #removepass, #run, #runcmd, #setpass, #update, #validate_status

Constructor Details

#initialize(opts = ObservableHash.new) ⇒ Bmc

Returns a new instance of Bmc.



8
9
10
11
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 8

def initialize(opts = ObservableHash.new)
  super("bmc-device", opts)
  @bmcinfo = {}
end

Instance Attribute Details

#configObject

attr_accessor :options



6
7
8
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 6

def config
  @config
end

Instance Method Details

#deviceObject



41
42
43
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 41

def device
  @bmcdevice ||= Rubyipmi::Freeipmi::BmcDevice.new(options)
end

#guidObject



25
26
27
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 25

def guid
   information.guid
end

#infoObject



13
14
15
16
17
18
19
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 13

def info
  if @bmcinfo.length > 0
    @bmcinfo
  else
    information.retrieve
  end
end

#informationObject



37
38
39
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 37

def information
  @info ||= Rubyipmi::Freeipmi::BmcInfo.new(options)
end

#lanObject



33
34
35
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 33

def lan
  @lan ||= Rubyipmi::Freeipmi::Lan.new(options)
end

#reset(type = 'cold') ⇒ Object



21
22
23
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 21

def reset(type='cold')
  device.reset(type)
end