Module: ILO_SDK::ComputerSystemHelper

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

Overview

Contains helper methods for Computer System actions

Instance Method Summary collapse

Instance Method Details

#get_asset_tagString

Get the Asset Tag

Returns:

  • (String)

    asset_tag

Raises:

  • (RuntimeError)

    if the request failed



16
17
18
19
# File 'lib/ilo-sdk/helpers/computer_system_helper.rb', line 16

def get_asset_tag
  response = rest_get('/redfish/v1/Systems/1/')
  response_handler(response)['AssetTag']
end

#get_indicator_ledString

Get the UID indicator LED state

Returns:

  • (String)

    indicator_led

Raises:

  • (RuntimeError)

    if the request failed



35
36
37
38
# File 'lib/ilo-sdk/helpers/computer_system_helper.rb', line 35

def get_indicator_led
  response = rest_get('/redfish/v1/Systems/1/')
  response_handler(response)['IndicatorLED']
end

#set_asset_tag(asset_tag) ⇒ Object

Set the Asset Tag

Parameters:

  • asset_tag (String, Symbol)

Returns:

  • true

Raises:

  • (RuntimeError)

    if the request failed



25
26
27
28
29
30
# File 'lib/ilo-sdk/helpers/computer_system_helper.rb', line 25

def set_asset_tag(asset_tag)
  new_action = { 'AssetTag' => asset_tag }
  response = rest_patch('/redfish/v1/Systems/1/', body: new_action)
  response_handler(response)
  true
end

#set_indicator_led(state) ⇒ Object

Set the UID indicator LED

Parameters:

  • state (String, Symbol)

Returns:

  • true

Raises:

  • (RuntimeError)

    if the request failed



44
45
46
47
48
49
# File 'lib/ilo-sdk/helpers/computer_system_helper.rb', line 44

def set_indicator_led(state)
  new_action = { 'IndicatorLED' => state }
  response = rest_patch('/redfish/v1/Systems/1/', body: new_action)
  response_handler(response)
  true
end