Created
October 24, 2021 16:30
-
-
Save CribberSix/6e6bf10900e6304fa263c88134e9b22b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def startup(): | |
# Initialize the following variables according to your setup / needs: | |
url_nifi_api = "https://our.cluster.address.com:9443/nifi-api/" | |
processor_id = "" # e.g. hardcoded / pass them via `provide_context` | |
access_payload = { "username": "" | |
,"password": "" | |
} # e.g. retrieve via Airflow's `BaseHook` functionality | |
token = get_token(url_nifi_api, access_payload) | |
response = update_processor_status(processor_id, "RUNNING", token, url_nifi_api) | |
pause(15) # wait for 15 seconds to give NiFi time to create a flow file | |
response = update_processor_status(processor_id, "STOPPED", token, url_nifi_api) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment