def METHOD_NAME(conn, prefix):
    logging.info("disconnect routers")
    routers = list(conn.network.routers())
    for router in routers:
        router_dict = router.to_dict()
        router_name = router_dict["name"]
        router_id = router_dict["id"]
        if not router_name.startswith(prefix):
            continue
        logging.info(router_name)
        ports = list(conn.network.ports(device_id=router_id))
        for port in ports:
            conn.network.remove_interface_from_router(router_id,
                                                      port_id=port["id"])