Rubyipmi::Freeipmi::ChassisConfig

Public Class Methods

new(opts = ObservableHash.new) click to toggle source
# File lib/rubyipmi/freeipmi/commands/chassisconfig.rb, line 5
def initialize(opts = ObservableHash.new)
  super("ipmi-chassis-config", opts)

end

Public Instance Methods

bootbios(persistent=true) click to toggle source

shortcut to boot into bios setup

# File lib/rubyipmi/freeipmi/commands/chassisconfig.rb, line 83
def bootbios(persistent=true)
  bootdevice("BIOS-SETUP",persistent)
end
bootcdrom(persistent=true) click to toggle source

shortcut to set boot device to cdrom

# File lib/rubyipmi/freeipmi/commands/chassisconfig.rb, line 78
def bootcdrom(persistent=true)
  bootdevice("CD-DVD",persistent)
end
bootdevice() click to toggle source
# File lib/rubyipmi/freeipmi/commands/chassisconfig.rb, line 33
def bootdevice
  value = checkout("Chassis_Boot_Flags")
  if value
    # TODO parse result to return current boot device
    #@result
  end
end
bootdevices() click to toggle source
# File lib/rubyipmi/freeipmi/commands/chassisconfig.rb, line 45
def bootdevices
  # freeipmi returns a list of supported devices
  # However, for now we will just assume the following
  ["PXE", "HARD-DRIVE", "CD-DVD", "BIOS-SETUP"]
  # TODO return array of possible boot devices
end
bootdisk(persistent=true) click to toggle source

shortcut to set boot device to disk

# File lib/rubyipmi/freeipmi/commands/chassisconfig.rb, line 73
def bootdisk(persistent=true)
  bootdevice("HARD-DRIVE",persistent)
end
bootpersistent(value) click to toggle source
# File lib/rubyipmi/freeipmi/commands/chassisconfig.rb, line 52
def bootpersistent(value)
  # TODO find out if we can specify multiple key-pair values
  if value == true
    flag = "Chassis_Boot_Flags:Boot_Flags_Persistent=Yes"
  else
    flag = "Chassis_Boot_Flags:Boot_Flags_Persistent=No"
  end
  @options["key-pair"] = "\"#{flag}\""
  value = commit
  @options.delete_notify("key-pair")
  return value
end
bootpxe(persistent=true) click to toggle source

shortcut to set boot device to pxe

# File lib/rubyipmi/freeipmi/commands/chassisconfig.rb, line 68
def bootpxe(persistent=true)
  bootdevice("PXE",persistent)
end
checkout(section=nil) click to toggle source

This is the raw command to get the entire ipmi chassis configuration If you pass in a section you will get just the section

# File lib/rubyipmi/freeipmi/commands/chassisconfig.rb, line 20
def checkout(section=nil)
  @options["checkout"] = false
  if section
    @options["section"] = section
  end
  value = runcmd
  @options.delete_notify("checkout")
  if section
    @options.delete_notify("section")
  end
  return value
end
commit() click to toggle source

This is the raw command to send a new configuration to the ipmi device

# File lib/rubyipmi/freeipmi/commands/chassisconfig.rb, line 11
def commit
  @options["commit"] = false
  value = runcmd
  @options.delete_notify("commit")
  return value
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.