Module: ILO_SDK::BiosHelper
- Included in:
- Client
- Defined in:
- lib/ilo-sdk/helpers/bios_helper.rb
Overview
Contains helper methods for Bios actions
Instance Method Summary collapse
-
#get_bios_baseconfig ⇒ Fixnum
Get the bios base config.
-
#get_bios_dhcp ⇒ String
Get the BIOS DHCP.
-
#get_bios_service ⇒ String
Get the BIOS service.
-
#get_uefi_shell_startup ⇒ String
Get the UEFI shell start up.
-
#get_url_boot_file ⇒ String
Get the URL boot file.
-
#revert_bios ⇒ Object
Revert the BIOS.
-
#set_bios_dhcp(dhcpv4, ipv4_address = '', ipv4_gateway = '', ipv4_primary_dns = '', ipv4_secondary_dns = '', ipv4_subnet_mask = '') ⇒ Object
Set the BIOS DHCP.
-
#set_bios_service(name, email) ⇒ Object
Set the BIOS service.
-
#set_uefi_shell_startup(uefi_shell_startup, uefi_shell_startup_location, uefi_shell_startup_url) ⇒ Object
Set the UEFI shell start up.
-
#set_url_boot_file(url_boot_file) ⇒ Object
Set the URL boot file.
Instance Method Details
#get_bios_baseconfig ⇒ Fixnum
Get the bios base config
16 17 18 19 |
# File 'lib/ilo-sdk/helpers/bios_helper.rb', line 16 def get_bios_baseconfig response = rest_get('/redfish/v1/Systems/1/bios/Settings/') response_handler(response)['BaseConfig'] end |
#get_bios_dhcp ⇒ String
Get the BIOS DHCP
64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/ilo-sdk/helpers/bios_helper.rb', line 64 def get_bios_dhcp response = rest_get('/redfish/v1/Systems/1/bios/Settings/') bios = response_handler(response) { 'Dhcpv4' => bios['Dhcpv4'], 'Ipv4Address' => bios['Ipv4Address'], 'Ipv4Gateway' => bios['Ipv4Gateway'], 'Ipv4PrimaryDNS' => bios['Ipv4PrimaryDNS'], 'Ipv4SecondaryDNS' => bios['Ipv4SecondaryDNS'], 'Ipv4SubnetMask' => bios['Ipv4SubnetMask'] } end |
#get_bios_service ⇒ String
Get the BIOS service
122 123 124 125 126 127 128 129 |
# File 'lib/ilo-sdk/helpers/bios_helper.rb', line 122 def get_bios_service response = rest_get('/redfish/v1/Systems/1/bios/Settings/') bios = response_handler(response) { 'ServiceName' => bios['ServiceName'], 'ServiceEmail' => bios['ServiceEmail'] } end |
#get_uefi_shell_startup ⇒ String
Get the UEFI shell start up
34 35 36 37 38 39 40 41 42 |
# File 'lib/ilo-sdk/helpers/bios_helper.rb', line 34 def get_uefi_shell_startup response = rest_get('/redfish/v1/Systems/1/bios/Settings/') bios = response_handler(response) { 'UefiShellStartup' => bios['UefiShellStartup'], 'UefiShellStartupLocation' => bios['UefiShellStartupLocation'], 'UefiShellStartupUrl' => bios['UefiShellStartupUrl'] } end |
#get_url_boot_file ⇒ String
Get the URL boot file
103 104 105 106 |
# File 'lib/ilo-sdk/helpers/bios_helper.rb', line 103 def get_url_boot_file response = rest_get('/redfish/v1/Systems/1/bios/Settings/') response_handler(response)['UrlBootFile'] end |
#revert_bios ⇒ Object
Revert the BIOS
24 25 26 27 28 29 |
# File 'lib/ilo-sdk/helpers/bios_helper.rb', line 24 def revert_bios new_action = { 'BaseConfig' => 'default' } response = rest_patch('/redfish/v1/systems/1/bios/Settings/', body: new_action) response_handler(response) true end |
#set_bios_dhcp(dhcpv4, ipv4_address = '', ipv4_gateway = '', ipv4_primary_dns = '', ipv4_secondary_dns = '', ipv4_subnet_mask = '') ⇒ Object
Set the BIOS DHCP
86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/ilo-sdk/helpers/bios_helper.rb', line 86 def set_bios_dhcp(dhcpv4, ipv4_address = '', ipv4_gateway = '', ipv4_primary_dns = '', ipv4_secondary_dns = '', ipv4_subnet_mask = '') new_action = { 'Dhcpv4' => dhcpv4, 'Ipv4Address' => ipv4_address, 'Ipv4Gateway' => ipv4_gateway, 'Ipv4PrimaryDNS' => ipv4_primary_dns, 'Ipv4SecondaryDNS' => ipv4_secondary_dns, 'Ipv4SubnetMask' => ipv4_subnet_mask } response = rest_patch('/redfish/v1/Systems/1/bios/Settings/', body: new_action) response_handler(response) true end |
#set_bios_service(name, email) ⇒ Object
Set the BIOS service
136 137 138 139 140 141 142 143 144 |
# File 'lib/ilo-sdk/helpers/bios_helper.rb', line 136 def set_bios_service(name, email) new_action = { 'ServiceName' => name, 'ServiceEmail' => email } response = rest_patch('/redfish/v1/Systems/1/bios/Settings/', body: new_action) response_handler(response) true end |
#set_uefi_shell_startup(uefi_shell_startup, uefi_shell_startup_location, uefi_shell_startup_url) ⇒ Object
Set the UEFI shell start up
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/ilo-sdk/helpers/bios_helper.rb', line 50 def set_uefi_shell_startup(uefi_shell_startup, uefi_shell_startup_location, uefi_shell_startup_url) new_action = { 'UefiShellStartup' => uefi_shell_startup, 'UefiShellStartupLocation' => uefi_shell_startup_location, 'UefiShellStartupUrl' => uefi_shell_startup_url } response = rest_patch('/redfish/v1/Systems/1/bios/Settings/', body: new_action) response_handler(response) true end |
#set_url_boot_file(url_boot_file) ⇒ Object
Set the URL boot file
112 113 114 115 116 117 |
# File 'lib/ilo-sdk/helpers/bios_helper.rb', line 112 def set_url_boot_file(url_boot_file) new_action = { 'UrlBootFile' => url_boot_file } response = rest_patch('/redfish/v1/Systems/1/bios/Settings/', body: new_action) response_handler(response) true end |