Module: ILO_SDK::BootSettingsHelper
- Included in:
- Client
- Defined in:
- lib/ilo-sdk/helpers/boot_settings_helper.rb
Overview
Contains helper methods for Boot Settings actions
Instance Method Summary collapse
-
#get_boot_baseconfig ⇒ Fixnum
Get the boot base config.
-
#get_boot_order ⇒ Fixnum
Get the boot order.
-
#get_temporary_boot_order ⇒ Fixnum
Get the temporary boot order.
-
#revert_boot ⇒ Object
Revert the boot.
-
#set_boot_order(boot_order) ⇒ Object
Set the boot order.
-
#set_temporary_boot_order(boot_target) ⇒ Object
Set the temporary boot order.
Instance Method Details
#get_boot_baseconfig ⇒ Fixnum
Get the boot base config
18 19 20 21 |
# File 'lib/ilo-sdk/helpers/boot_settings_helper.rb', line 18 def get_boot_baseconfig response = rest_get('/redfish/v1/Systems/1/bios/Boot/Settings/') response_handler(response)['BaseConfig'] end |
#get_boot_order ⇒ Fixnum
Get the boot order
36 37 38 39 |
# File 'lib/ilo-sdk/helpers/boot_settings_helper.rb', line 36 def get_boot_order response = rest_get('/redfish/v1/systems/1/bios/Boot/Settings/') response_handler(response)['PersistentBootConfigOrder'] end |
#get_temporary_boot_order ⇒ Fixnum
Get the temporary boot order
55 56 57 58 |
# File 'lib/ilo-sdk/helpers/boot_settings_helper.rb', line 55 def get_temporary_boot_order response = rest_get('/redfish/v1/Systems/1/') response_handler(response)['Boot']['BootSourceOverrideTarget'] end |
#revert_boot ⇒ Object
Revert the boot
26 27 28 29 30 31 |
# File 'lib/ilo-sdk/helpers/boot_settings_helper.rb', line 26 def revert_boot new_action = { 'BaseConfig' => 'default' } response = rest_patch('/redfish/v1/systems/1/bios/Boot/Settings/', body: new_action) response_handler(response) true end |
#set_boot_order(boot_order) ⇒ Object
Set the boot order
45 46 47 48 49 50 |
# File 'lib/ilo-sdk/helpers/boot_settings_helper.rb', line 45 def set_boot_order(boot_order) new_action = { 'PersistentBootConfigOrder' => boot_order } response = rest_patch('/redfish/v1/systems/1/bios/Boot/Settings/', body: new_action) response_handler(response) true end |
#set_temporary_boot_order(boot_target) ⇒ Object
Set the temporary boot order
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/ilo-sdk/helpers/boot_settings_helper.rb', line 64 def set_temporary_boot_order(boot_target) response = rest_get('/redfish/v1/Systems/1/') boottargets = response_handler(response)['Boot']['BootSourceOverrideSupported'] unless boottargets.include? boot_target raise "BootSourceOverrideTarget value - #{boot_target} is not supported. Valid values are: #{boottargets}" end new_action = { 'Boot' => { 'BootSourceOverrideTarget' => boot_target } } response = rest_patch('/redfish/v1/Systems/1/', body: new_action) response_handler(response) true end |