Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airflow-restapi-sdk-1.0.0.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file airflow-restapi-sdk-1.0.0.tar.gz.

File metadata

  • Download URL: airflow-restapi-sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.6

File hashes

Hashes for airflow-restapi-sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d98ea08c340998c575a2327dab7d3e72c12955b89e2373cdb2492788c366b4de
MD5 7d47f832f220874dffa9a7fa4e1f00ba
BLAKE2b-256 e5df01e3c93608ca3cbf28401cc0e0d8156e722b2fc1fd53789e26184441e7af

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page