According to https://airflow.apache.org/api.html I can trigger an Airflow DAG like so:
curl -X POST \
http://localhost:8080/api/experimental/dags/<DAG_ID>/dag_runs \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{"conf":"{\"key\":\"value\"}"}'
This seems to work ok for me, but I cannot figure out how to access the key
/value
stuff in the conf
object being passed in.
I tried this:
something = dag.params.get("key", "unknown")
But it doesn't seem to work.
Does anyone know how to do this?