Function takes input of devID to issue RESTUL call to HP IMC
    :param devId: requires devId as the only input parameter
    :return: list dictionaries of existing vlans on the devices. Device must be supported in HP IMC platform VLAN manager module
516401
def get_dev_vlans(devId):
    

    # checks to see if the imc credentials are already available
    if auth is None or url is None:
        set_imc_creds()
    global r
    get_dev_vlans_url = "/imcrs/vlan?devId=" + str(devId) + "&start=0&size=5000&total=false"
    f_url = url + get_dev_vlans_url
    payload = None
    # creates the URL using the payload variable as the contents
    r = requests.get(f_url, auth=auth, headers=headers)
    # r.status_code
    if r.status_code == 200:
        dev_details = (json.loads(r.text))['vlan']
        return dev_details
    elif r.status_code == 409:
        return [{'vlan': 'None'}]
    else:
        print("get_dev_vlans: An Error has occured")
1183513
def output_vlan(gandi, vlan, datacenters, output_keys, justify=10):
    
    output_generic(gandi, vlan, output_keys, justify)

    if 'dc' in output_keys:
        for dc in datacenters:
            if dc['id'] == vlan.get('datacenter_id',
                                    vlan.get('datacenter', {}).get('id')):
                dc_name = dc.get('dc_code', dc.get('iso', ''))
                break

        output_line(gandi, 'datacenter', dc_name, justify)
340284
def get_devices_from_response_dict(response_dict, device_type):
    
    items = response_dict.get('data')

    devices = []

    api_interface = WinkApiInterface()
    check_list = isinstance(device_type, (list,))

    for item in items:
        if (check_list and get_object_type(item) in device_type) or \
                (not check_list and get_object_type(item) == device_type):
            _devices = build_device(item, api_interface)
            for device in _devices:
                devices.append(device)

    return devices
33334
def recover_devices(cls):
        

        if "_devices" in globals():
            return

        global _devices
        confs_dir = os.path.abspath(os.path.normpath(cfg.CONF.dhcp_confs))
        for netid in os.listdir(confs_dir):
            conf_dir = os.path.join(confs_dir, netid)
            intf_filename = os.path.join(conf_dir, 'interface')
            try:
                with open(intf_filename, 'r') as f:
                    ifname = f.read()
                _devices[netid] = ifname
            except IOError:
                LOG.error('Unable to read interface file: %s',
                          intf_filename)
            LOG.debug("Recovered device %s for network %s'",
                      ifname, netid)
171632
def getDevice(self, id):
        
        return next(iter([d for d in self.devices.values() if d.deviceId == id]), None)
230203
def getDevices(self, status=None):
        
        return [d for d in self.devices.values() if status is None or d.payload.get('status') == status]
116072
def get_dev_vlans(devid, auth, url):
    

    # checks to see if the imc credentials are already available
    get_dev_vlans_url = "/imcrs/vlan?devId=" + str(devid) + "&start=0&size=5000&total=false"
    f_url = url + get_dev_vlans_url

    # creates the URL using the payload variable as the contents
    r = requests.get(f_url, auth=auth, headers=HEADERS)
    # r.status_code
    try:
        if r.status_code == 200:
            dev_vlans = (json.loads(r.text))
            return dev_vlans['vlan']
        elif r.status_code == 409:
            return {'vlan': 'no vlans'}
    except requests.exceptions.RequestException as e:
            return "Error:\n" + str(e) + ' get_dev_vlans: An Error has occured'
635348
def get_device(self, device_id):
        
        def process_result(result):
            return Device(result)

        return Command('get', [ROOT_DEVICES, device_id],
                       process_result=process_result)
839941
def list_dvs(kwargs=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_dvs function must be called with '
            '-f or --function.'
        )

    return {'Distributed Virtual Switches': salt.utils.vmware.list_dvs(_get_si())}
639621
def get_dev_alarms(devId, auth=auth.creds, url=auth.url):
    
    # checks to see if the imc credentials are already available
    get_dev_alarm_url = "/imcrs/fault/alarm?operatorName=admin&deviceId=" + \
                        str(devId) + "&desc=false"
    f_url = url + get_dev_alarm_url
    # creates the URL using the payload variable as the contents
    r = requests.get(f_url, auth=auth, headers=headers)
    try:
        if r.status_code == 200:
            dev_alarm = (json.loads(r.text))
            if 'alarm' in dev_alarm:
                return dev_alarm['alarm']
            else:
                return "Device has no alarms"
    except requests.exceptions.RequestException as e:
            return "Error:\n" + str(e) + ' get_dev_alarms: An Error has occured'
1004147
def get_input_data_port_m(self, data_port_id):
        
        for data_port_m in self.input_data_ports:
            if data_port_m.data_port.data_port_id == data_port_id:
                return data_port_m
        return None
129896
def DbGetExportdDeviceListForClass(self, argin):
        
        self._log.debug("In DbGetExportdDeviceListForClass()")
        argin = replace_wildcard(argin)
        return self.db.get_exported_device_list_for_class(argin)
210436
def DbGetDeviceAliasList(self, argin):
        
        self._log.debug("In DbGetDeviceAliasList()")
        if not argin:
            argin = "%"
        else:
            argin = replace_wildcard(argin)

        return self.db.get_device_alias_list(argin)
475766
def device(self, idx):
        

        class GpuDevice(Structure):
            pass

        c_nvmlDevice_t = POINTER(GpuDevice)

        c_index = c_uint(idx)
        device = c_nvmlDevice_t()
        _check_return(_NVML.get_function(
            "nvmlDeviceGetHandleByIndex_v2")(c_index, byref(device)))
        return NvidiaDevice(device)
560486
def get_dfu_devices(*args, **kwargs):
    
    # convert to list for compatibility with newer pyusb
    return list(usb.core.find(*args, find_all=True,
                              custom_match=FilterDFU(), **kwargs))
216874
def getAllConnectedInterface():
        

        devices = hid.enumerate()

        if not devices:
            logging.debug("No Mbed device connected")
            return []

        boards = []

        for deviceInfo in devices:
            product_name = deviceInfo['product_string']
            if (product_name.find("MicArray") < 0):
                # Skip non cmsis-dap devices
                continue

            try:
                dev = hid.device(vendor_id=deviceInfo['vendor_id'], product_id=deviceInfo['product_id'],
                    path=deviceInfo['path'])
            except IOError:
                logging.debug("Failed to open Mbed device")
                continue

            # Create the USB interface object for this device.
            new_board = HidApiUSB()
            new_board.vendor_name = deviceInfo['manufacturer_string']
            new_board.product_name = deviceInfo['product_string']
            new_board.serial_number = deviceInfo['serial_number']
            new_board.vid = deviceInfo['vendor_id']
            new_board.pid = deviceInfo['product_id']
            new_board.device_info = deviceInfo
            new_board.device = dev
            try:
                dev.open_path(deviceInfo['path'])
            except AttributeError:
                pass
            except IOError:
                # Ignore failure to open a device by skipping the device.
                continue

            boards.append(new_board)

        return boards
865209
def get_interfaces(self):
        
        interfaces = self.xml.find('devices').iter('interface')
        iobjs = []
        for interface in interfaces:
            _type = interface.attrib['type']
            mac = interface.find('mac').attrib['address']
            source = interface.find('source').attrib[_type]
            model = interface.find('model').attrib['type']
            iobjs.append(NetworkInterface(_type, mac, source, model))
        return iobjs