Module: ILO_SDK::SNMPServiceHelper

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

Overview

Contains helper methods for SNMP Service actions

Instance Method Summary collapse

Instance Method Details

#get_snmp_alerts_enabledString

Get the SNMP Alerts Enabled value

Returns:

  • (String)

    snmp_alerts_enabled

Raises:

  • (RuntimeError)

    if the request failed


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

def get_snmp_alerts_enabled
  response = rest_get('/redfish/v1/Managers/1/SnmpService/')
  response_handler(response)['AlertsEnabled']
end

#get_snmp_modeString

Get the SNMP Mode

Returns:

  • (String)

    snmp_mode

Raises:

  • (RuntimeError)

    if the request failed


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

def get_snmp_mode
  response = rest_get('/redfish/v1/Managers/1/SnmpService/')
  response_handler(response)['Mode']
end

#set_snmp(snmp_mode, snmp_alerts) ⇒ Object

Set the SNMP Mode and Alerts Enabled value

Parameters:

  • snmp_mode (String, Symbol)
  • snmp_alerts (Boolean)

Returns:

  • true

Raises:

  • (RuntimeError)

    if the request failed


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

def set_snmp(snmp_mode, snmp_alerts)
  new_action = { 'Mode' => snmp_mode, 'AlertsEnabled' => snmp_alerts }
  response = rest_patch('/redfish/v1/Managers/1/SnmpService/', body: new_action)
  response_handler(response)
  true
end