def get_interfaces(self):
<EOL>last_flapped = -<NUM_LIT:1.0><EOL>command = "<STR_LIT>"<EOL>output = self._send_command(command)<EOL>interface = description = mac_address = speed = speedformat = "<STR_LIT>"<EOL>is_enabled = is_up = None<EOL>interface_dict = {}<EOL>for line in output.splitlines():<EOL><INDENT>interface_regex_1 = r"<STR_LIT>"<EOL>interface_regex_2 = r"<STR_LIT>"<EOL>for pattern in (interface_regex_1, interface_regex_2):<EOL><INDENT>interface_match = re.search(pattern, line)<EOL>if interface_match:<EOL><INDENT>interface = interface_match.group(<NUM_LIT:1>)<EOL>status = interface_match.group(<NUM_LIT:2>)<EOL>try:<EOL><INDENT>protocol = interface_match.group(<NUM_LIT:3>)<EOL><DEDENT>except IndexError:<EOL><INDENT>protocol = "<STR_LIT>"<EOL><DEDENT>if "<STR_LIT>" in status.lower():<EOL><INDENT>is_enabled = False<EOL><DEDENT>else:<EOL><INDENT>is_enabled = True<EOL><DEDENT>if protocol:<EOL><INDENT>is_up = bool("<STR_LIT>" in protocol)<EOL><DEDENT>else:<EOL><INDENT>is_up = bool("<STR_LIT>" in status)<EOL><DEDENT>break<EOL><DEDENT><DEDENT>mac_addr_regex = r"<STR_LIT>".format(MAC_REGEX)<EOL>if re.search(mac_addr_regex, line):<EOL><INDENT>mac_addr_match = re.search(mac_addr_regex, line)<EOL>mac_address = napalm.base.helpers.mac(mac_addr_match.groups()[<NUM_LIT:0>])<EOL><DEDENT>descr_regex = r"<STR_LIT>"<EOL>if re.search(descr_regex, line):<EOL><INDENT>descr_match = re.search(descr_regex, line)<EOL>description = descr_match.groups()[<NUM_LIT:0>]<EOL><DEDENT>speed_regex = r"<STR_LIT>"<EOL>if re.search(speed_regex, line):<EOL><INDENT>speed_match = re.search(speed_regex, line)<EOL>mtu = int(speed_match.groups()[<NUM_LIT:0>])<EOL>speed = speed_match.groups()[<NUM_LIT:1>]<EOL>speedformat = speed_match.groups()[<NUM_LIT:2>]<EOL>speed = float(speed)<EOL>if speedformat.startswith("<STR_LIT>"):<EOL><INDENT>speed = speed / <NUM_LIT><EOL><DEDENT>elif speedformat.startswith("<STR_LIT>"):<EOL><INDENT>speed = speed * <NUM_LIT:1000><EOL><DEDENT>speed = int(round(speed))<EOL>if interface == "<STR_LIT>":<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>if not isinstance(is_up, bool) or not isinstance(is_enabled, bool):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>interface_dict[interface] = {<EOL>"<STR_LIT>": is_enabled,<EOL>"<STR_LIT>": is_up,<EOL>"<STR_LIT:description>": description,<EOL>"<STR_LIT>": mac_address,<EOL>"<STR_LIT>": last_flapped,<EOL>"<STR_LIT>": mtu,<EOL>"<STR_LIT>": speed,<EOL>}<EOL>interface = description = mac_address = speed = speedformat = "<STR_LIT>"<EOL>is_enabled = is_up = None<EOL><DEDENT><DEDENT>return interface_dict<EOL>
Get interface details.

last_flapped is not implemented

Example Output:

{   u'Vlan1': {   'description': u'N/A',
              'is_enabled': True,
              'is_up': True,
              'last_flapped': -1.0,
              'mac_address': u'a493.4cc1.67a7',
              'speed': 100},
u'Vlan100': {   'description': u'Data Network',
                'is_enabled': True,
                'is_up': True,
                'last_flapped': -1.0,
                'mac_address': u'a493.4cc1.67a7',
                'speed': 100},
u'Vlan200': {   'description': u'Voice Network',
                'is_enabled': True,
                'is_up': True,
                'last_flapped': -1.0,
                'mac_address': u'a493.4cc1.67a7',
                'speed': 100}}