from typing import Union
from typing import Dict


def _get_if(interfaces, index) -> Union[Dict, None]:
    """
    Get interface configuration based on interface index

    :param index:
    :return:
    """

    for interface in interfaces:
        if int(interface['ifindex']) == index:
            return interface

    return None