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, #logger, #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



48
49
50
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 48

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

#guidObject



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

def guid
   information.guid
end

#infoObject



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

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

#informationObject



44
45
46
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 44

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

#lanObject



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

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

#reset(type = 'cold') ⇒ Object



28
29
30
# File 'lib/rubyipmi/freeipmi/commands/bmc.rb', line 28

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

#versionObject



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

def version
  @options['version'] = false
  value = runcmd
  @options.delete_notify('version')
  @result.slice(/\d\.\d.\d/)
end