def _endpoints_by_hosts(endpoints):
    """Return a dict consisting of the host-endpoint pairs as key-values."""
    rv = {}
    for ep in endpoints:
        host, _ = ep['hostport'].split(':')
        rv[host] = ep

    return rv