def retrieve_termination_obj(nb,termination_type,dev_name,termination_name):
    """Searches for a NetBox termination object of a given name from a given device

      Args:
        nb: PyNetbox connection to a Netbox instance
        termination_type: NetBox termination object type (ie. dcim.interface)
        dev_name: Name of NetBox device being searched
        termination_name: Name of NetBox termination object being searched

      Returns:
        If found: Returns NetBox termination object
        If not found: Returns None
    """

    termination_obj = None

    if (termination_type == "dcim.interface"):
        termination_obj = nb.dcim.interfaces.get(device=dev_name,name=termination_name)
    elif (termination_type == "dcim.frontport"):
        termination_obj = nb.dcim.front_ports.get(device=dev_name,name=termination_name)
    elif (termination_type == "dcim.rearport"):
        termination_obj = nb.dcim.rear_ports.get(device=dev_name,name=termination_name)

    return termination_obj