Airflow Rest API Python SDK
Project description
AIRFLOW_RESTAPI-SDK
from airflow_restapi_sdk import Client, State
client = Client('http://localhost:8080')
# 触发DAG
client.dag.trigger('test_dag', conf={'k': 'v'})
# {
# "execution_date": "2020-08-20T07:51:36+00:00",
# "message": "Created <DagRun test_dag @ 2020-08-20 07:51:36+00:00: manual__2020-08-20T07:51:36+00:00, externally triggered: True>",
# "run_id": "manual__2020-08-20T07:51:36+00:00"
# }
# 查看DAG运行状态
client.dag.state('test_dag', '2020-08-20T07:51:36+00:00')
# {'state': 'failed'}
# 触发DAG并阻塞,直到成功或失败
status = client.dag.trigger_join('test_dag', conf={'k': 'v'}, timeout=300)
print(status)
# {'state': 'failed'}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for airflow-restapi-sdk-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d98ea08c340998c575a2327dab7d3e72c12955b89e2373cdb2492788c366b4de |
|
MD5 | 7d47f832f220874dffa9a7fa4e1f00ba |
|
BLAKE2b-256 | e5df01e3c93608ca3cbf28401cc0e0d8156e722b2fc1fd53789e26184441e7af |