You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@airflow.apache.org by Andrew Phillips <an...@apache.org> on 2016/07/15 02:27:33 UTC

Re: Airflow REST Api support

Hi all

Just wanted to register another vote for REST API support. Our use case 
is primarily to be able to trigger a DAG run from an external CI/CD 
solution where we can't easily install a CLI, and where we would be 
hesitant to do that even if we could as it would mean opening up more of 
our Airflow instance to the outside than we would like.

The fallback for us would be SSH with an appropriately configured and 
restricted sudoers setup, but since we interact with pretty much all of 
our other platform components via HTTP that would be much preferred.

What we're using at the moment, and what I can so far highly recommend, 
is shell2http [1], a very simply HTTP server that maps endpoints 
straight to OS/shell commands.

Here's an example of a simple, one-line Airflow HTTP API:

shell2http -port=8088 -form \
   /airflow/variables/list 'airflow variables' \
   /airflow/variables/get 'airflow variables --get $v_varName' \
   /airflow/dags/list 'airflow list_dags' \
   /airflow/dags/trigger 'airflow trigger_dag $v_dagId --run_id $v_runId' 
\
   ...

Example calls:

http://host:8088/airflow/dags/list
http://host:8088/airflow/variables/get?varName=foo
http://host:8088/airflow/dags/trigger?dagId=foo&runId=bar
...

Regards

ap

[1] https://github.com/msoap/shell2http

-- 
Andrew Phillips
Apache jclouds