Module: ILO_SDK::FirmwareUpdateHelper

Included in:
Client
Defined in:
lib/ilo-sdk/helpers/firmware_update.rb

Overview

Contains helper methods for Firmware Update actions

Instance Method Summary collapse

Instance Method Details

#get_fw_versionString

Get the Firmware Version

Returns:

  • (String)

    fw_version

Raises:

  • (RuntimeError)

    if the request failed


18
19
20
21
# File 'lib/ilo-sdk/helpers/firmware_update.rb', line 18

def get_fw_version
  response = rest_get('/redfish/v1/Systems/1/FirmWareInventory/')
  response_handler(response)['Current']['SystemBMC'][0]['VersionString']
end

#set_fw_upgrade(uri, tpm_override_flag = true) ⇒ Object

Set the Firmware Upgrade

Parameters:

  • uri (String, Symbol)

Returns:

  • true

Raises:

  • (RuntimeError)

    if the request failed


27
28
29
30
31
32
# File 'lib/ilo-sdk/helpers/firmware_update.rb', line 27

def set_fw_upgrade(uri, tpm_override_flag = true)
  new_action = { 'Action' => 'InstallFromURI', 'FirmwareURI' => uri, 'TPMOverrideFlag' => tpm_override_flag }
  response = rest_post('/redfish/v1/Managers/1/UpdateService/', body: new_action)
  response_handler(response)
  true
end