Module: Rubyipmi::PowerMixin

Included in:
Freeipmi::Power, Ipmitool::Power
Defined in:
lib/rubyipmi/commands/mixins/power_mixin.rb

Instance Method Summary collapse

Instance Method Details

#cycleObject

Power cycle the system



19
20
21
# File 'lib/rubyipmi/commands/mixins/power_mixin.rb', line 19

def cycle
  off? ? on : command("cycle")
end

#offObject

Turn the system off



9
10
11
# File 'lib/rubyipmi/commands/mixins/power_mixin.rb', line 9

def off
  command("off")
end

#off?Boolean

Test to see if the power is off

Returns:

  • (Boolean)


34
35
36
# File 'lib/rubyipmi/commands/mixins/power_mixin.rb', line 34

def off?
  status == "off"
end

#onObject

Turn the system on



4
5
6
# File 'lib/rubyipmi/commands/mixins/power_mixin.rb', line 4

def on
  command("on")
end

#on?Boolean

Test to see if the power is on

Returns:

  • (Boolean)


29
30
31
# File 'lib/rubyipmi/commands/mixins/power_mixin.rb', line 29

def on?
  status == "on"
end

#powerInterruptObject

DEPRECATED: Please use power_interrupt instead.



45
46
47
48
# File 'lib/rubyipmi/commands/mixins/power_mixin.rb', line 45

def powerInterrupt
  warn "[DEPRECATION] `powerInterrupt` is deprecated, please use `power_interrupt` instead."
  power_interrupt
end

#resetObject

Perform a power reset on the system



14
15
16
# File 'lib/rubyipmi/commands/mixins/power_mixin.rb', line 14

def reset
  command("reset")
end

#soft_shutdownObject

Perform a soft shutdown, like briefly pushing the power button



24
25
26
# File 'lib/rubyipmi/commands/mixins/power_mixin.rb', line 24

def soft_shutdown
  command("soft")
end

#softShutdownObject

DEPRECATED: Please use soft_shutdown instead.



39
40
41
42
# File 'lib/rubyipmi/commands/mixins/power_mixin.rb', line 39

def softShutdown
  warn "[DEPRECATION] `softShutdown` is deprecated, please use `soft_shutdown` instead."
  soft_shutdown
end