module IDRAC::Lifecycle

def set_lifecycle_status(status)

Set the Lifecycle Controller status (enable/disable)
def set_lifecycle_status(status)                                                                                   
  payload = { "Attributes": { "LCAttributes.1.LifecycleControllerState": status ? 'Enabled' : 'Disabled' } }
  response = authenticated_request(
    :patch,
    "/redfish/v1/Managers/iDRAC.Embedded.1/Oem/Dell/DellAttributes/LifecycleController.Embedded.1",
    body: payload.to_json,
    headers: { 'Content-Type': 'application/json' }
  )
  
  code = response.status
  case code
  when 200..299
    debug "Lifecycle Controller is now #{status ? 'Enabled' : 'Disabled'}".green, 1                                          
  when 400..499
    debug "[#{code}] This iDRAC does not support Lifecycle Controller", 0, :red                                                
  when 500..599
    debug "[#{code}] iDRAC does not support Lifecycle Controller", 0, :red                                                     
  else
  end
end