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
18 19 20 21 |
# File 'lib/ilo-sdk/helpers/power_helper.rb', line 18 def get_power_state response = rest_get('/redfish/v1/Systems/1/') response_handler(response)['PowerState'] end |
#reset_ilo ⇒ Object
Reset the iLO
37 38 39 40 41 42 |
# File 'lib/ilo-sdk/helpers/power_helper.rb', line 37 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
27 28 29 30 31 32 |
# File 'lib/ilo-sdk/helpers/power_helper.rb', line 27 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 |