def set_firewall_apikey(session_key, apikey):
    try:
        # The password cannot be modified, so it must be deleted before it can be added back.
        delete_firewall_apikey(session_key)
        apikey = {'name': 'firewall_api_key', 'password': apikey}
        apikey_entity = entity.Entity(['admin', 'passwords'], "firewall_api_key", namespace=APPNAME, owner='nobody', contents=apikey)
        entity.setEntity(apikey_entity, sessionKey=session_key, strictCreate=False)
    except Exception as e:
        stack = traceback.format_exc()
        logger.warn(stack)
        logger.warn("entity exception")
        exit_with_error("Could not set %s firewall apikey from splunk. Error: %s" % (APPNAME, str(e)))
If `anchor` is not found then raise `DataNotFound` exception.
dataset/ETHPy150Open PaloAltoNetworks/SplunkforPaloAltoNetworks/bin/lib/common.py/set_firewall_apikey--crossover with--dataset/ETHPy150Open lorien/grab/grab/document.py/TextExtension.text_assert