Reputation: 117
I would like to know if there is a simple API call I can make to list all currently running airflow jobs.
In the airflow flower dashboard, there is a column that lists all currently active jobs. I'd like to know if I can obtain this information via an API call.
Upvotes: 3
Views: 2024
Reputation: 1385
If your REST API is enabled you can do the following,
your URL should look like this:
https://<your-airflow-uri>/home
you can use the following in order to get the list of running tasks
https://<your-airflow-uri>/api/v1/dags/~/dagRuns/~/taskInstances?state=running
it should look like this
Upvotes: 1
Reputation: 2364
In short: no. Airflow does have an experimental REST API, but there is no endpoint for the call you're after. See https://github.com/apache/airflow/blob/98e852219fc73c7ec049feeab7305bc7c0e89698/airflow/api/client/json_client.py#L26 for a list of the endpoints supported (Some of them are mentioned in the official documentation as well: https://airflow.apache.org/api.html#endpoints)
As far as I understand a proper non-experimental REST API is on the roadmap of Airflow 2.
Upvotes: 1