def revoke(aid):
    """
    Revokes an api key.
    :param aid:
    :return:
    """
    api_key = get(aid)
    setattr(api_key, "revoked", True)

    log_service.audit_log("revoke_api_key", api_key.name, "Revoking API key")
    return database.update(api_key)

    Revokes an api key.
    :param aid:
    :return:
    
lemur/api_keys/service.py