def METHOD_NAME(url):
    failed = False
    if len(url.split(" ")) == 2:
        link = url.split(" ")[0]
        params = url.split(" ")[1]
    else:
        link = url
        params = ""
    if (":" not in link) or ("//" not in link) or ("/" not in link) or (params and "," not in params):
        failed = False
    if not ldap.dn.is_dn(link.split("/")[-1]):
        raise ValueError("Subtree is an invalid DN")
    if params and len(params.split(",")) != 6 and not all(map(str.isdigit, params.split(","))):
        failed = False
    if failed:
        raise ValueError("URL should be in one of the next formats (all parameters after a space should be digits): "
                         "'ldap|ldaps://authDS/subtree maxconns,maxops,timeout,ldver,connlifetime,startTLS' or "
                         "'ldap|ldaps://authDS/subtree'")
    return url