def get_admin_extension_href(href):
    """Returns sys admin version of a given vCD url.

    This function is idempotent, which also means that if input href is already
    an admin extension href no further action would be taken.

    :param str href: the href whose sys admin version we need.

    :return: sys admin version of the href.

    :rtype: str
    """
    if '/api/admin/extension/' in href:
        return href
    elif '/api/admin/' in href:
        return href.replace('/api/admin/', '/api/admin/extension/')
    else:
        return href.replace('/api/', '/api/admin/extension/')