Brian Hochgurtel
Brian Hochgurtel

Reputation: 61

Run a dag with Airflow via curl and Airflow's experimental rest api

I'm trying to execute a dag within airflow by using a curl command. I am trying to do this via the Experimental Rest API documented here:

https://airflow.apache.org/api.html

Here is my curl command that I am trying to execute:

curl -X POST -v -u [email protected]:somepassword -d ''  'https://airflow.somedomain.com/api/experimental/dags/my_dag_id/dag_runs'

When I run this command, I get a 400 Bad Request -- The browser (or proxy) sent a request that this server could not understand

The call I am attempting appears to conform with the api documentation, so I am confused on what I'm doing wrong.

Upvotes: 3

Views: 5253

Answers (2)

Kyle Hayes
Kyle Hayes

Reputation: 5302

I also discovered that in the latest version, simply making a POST against the dag_runs endpoint will not work. I had to send a empty JSON string in the body of the request to get it to work.

Upvotes: 3

Brian Hochgurtel
Brian Hochgurtel

Reputation: 61

Ok after doing a little bit of digging this week, it turns out that auth_backend is commented out in our airflow config file. Once that is uncommented, any request to the rest api should work.

Upvotes: 3

Related Questions