Module: ILO_SDK::PowerHelper
- Included in:
- Client
- Defined in:
- lib/ilo-sdk/helpers/power_helper.rb
Overview
Contains helper methods for Power actions
Instance Method Summary collapse
-
#get_power_state ⇒ String
Get the Power State.
-
#reset_ilo ⇒ Object
Reset the iLO.
-
#set_power_state(state) ⇒ Object
Set the Power State.
Instance Method Details
#get_power_state ⇒ String
Get the Power State
16 17 18 19 |
# File 'lib/ilo-sdk/helpers/power_helper.rb', line 16 def get_power_state response = rest_get('/redfish/v1/Systems/1/') response_handler(response)['PowerState'] end |
#reset_ilo ⇒ Object
Reset the iLO
35 36 37 38 39 40 |
# File 'lib/ilo-sdk/helpers/power_helper.rb', line 35 def reset_ilo new_action = { 'Action' => 'Reset' } response = rest_post('/redfish/v1/Managers/1/', body: new_action) response_handler(response) true end |
#set_power_state(state) ⇒ Object
Set the Power State
25 26 27 28 29 30 |
# File 'lib/ilo-sdk/helpers/power_helper.rb', line 25 def set_power_state(state) new_action = { 'Action' => 'Reset', 'ResetType' => state } response = rest_post('/redfish/v1/Systems/1/', body: new_action) response_handler(response) true end |