View Public Instance Variables

For Airflow version 1.10.0 and older:

GET /airflow-webserver-<cluster-id>/api/experimental/dags/<DAG_ID>/dag_runs/<string:execution_date>/tasks/<TASK_ID>

For Airflow 1.10.2 and later:

GET /airflow-rbacwebserver-<cluster-id>/api/experimental/dags/<DAG_ID>/dag_runs/<string:execution_date>/tasks/<TASK_ID>

You can now use this API to return a JSON with a task instance’s public instance variables. Use this format YYYY-mm-DDTHH:MM:SS (Example: “2016-11-16T11:34:15”) to specify the value of <string:execution_date>.

Note

To run the experimental APIs, you require to have Airflow version 1.10.0 and above.

Required Role

A user with read permission to the cluster can make this API call.

Syntax

curl -X GET \  https://<ENV>.qubole.com/airflow-rbacwebserver-<Cluster-ID>/api/experimental/dags/dag_test/dag_runs/<string:execution_date>/tasks/python_task \

Note

You need to specify the QDS environment in the above syntax. It works with all the environments described in Supported Qubole Endpoints on Different Cloud Providers.

Sample Query

curl -X GET \  https://api.qubole.com/airflow-rbacwebserver-6234/api/experimental/dags/dag_test/dag_runs/2019-11-20T09:16:34+00:00/tasks/python_task \
  -H "Accept: application/json"
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -H 'X-AUTH-TOKEN: <AUTH_TOKEN>'\
  -d '{}'

Sample Response

{
 "dag_id": "dag_test",
 "duration": "3.019084",
 "end_date": "2019-11-20 09:23:25.053320+00:00",
 "execution_date": "2019-11-20 09:16:34+00:00",
 "executor_config": "{}",
 "hostname": "ip-10-37-251-172.ec2.internal",
 "job_id": "2",
 "max_tries": "0",
 "operator": "PythonOperator",
 "pid": "23069",
 "pool": "None",
 "priority_weight": "4",
 "queue": "default",
 "queued_dttm": "2019-11-20 09:23:18.834576+00:00",
 "start_date": "2019-11-20 09:23:22.034236+00:00",
 "state": "success",
 "task_id": "python_task",
 "test_mode": "False",
 "unixname": "airflow"
}