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



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

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



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

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



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

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



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

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