Esempio n. 1
0
def get_device_usage(request, device_id):
    if device_id is None:
        raise nova_exceptions.ResourceNotFound

    usage = wrs_pci.PciDevicesManager(
        novaclient(request)).list(device=device_id)
    return DeviceUsage(usage[0])
Esempio n. 2
0
def get_detail_usage(request, device_id):
    usages = wrs_pci.PciDevicesManager(novaclient(request)).get(device_id)
    return [DetailUsage(n) for n in usages]
Esempio n. 3
0
def get_device_usage_list(request):
    usages = wrs_pci.PciDevicesManager(novaclient(request)).list()
    return [DeviceUsage(n) for n in usages]