import requests


def get_device_list(ip_address, headers):
    """ Get list of devices from OME """
    device_list = None
    device_url = 'https://%s/api/DeviceService/Devices' % (ip_address)
    response = requests.get(device_url, headers=headers, verify=False)
    if response.status_code == 200:
        dev_response = response.json()
        if dev_response['@odata.count'] > 0:
            device_list = [x['Id'] for x in dev_response['value']]
        else:
            print ("No devices found at ", ip_address)
    else:
        print ("No devices found at ", ip_address)
    return device_list