def get_interface_type(interface):
 if interface.upper().startswith('ET'):
  return 'ethernet'
 elif interface.upper().startswith('VL'):
  return 'svi'
 elif interface.upper().startswith('LO'):
  return 'loopback'
 elif interface.upper().startswith('MG'):
  return 'management'
 elif interface.upper().startswith('MA'):
  return 'management'
 elif interface.upper().startswith('PO'):
  return 'portchannel'
 else:
  return 'unknown'

def get_interface_type ( interface ) : if interface . upper ( ) . startswith ( 'ET' ) : return 'ethernet' elif interface . upper ( ) . startswith ( 'VL' ) : return 'svi' elif interface . upper ( ) . startswith ( 'LO' ) : return 'loopback' elif interface . upper ( ) . startswith ( 'MG' ) : return 'management' elif interface . upper ( ) . startswith ( 'MA' ) : return 'management' elif interface . upper ( ) . startswith ( 'PO' ) : return 'portchannel' else : return 'unknown'
gets the type of interface args: interface : full name of interface .