Skip to main content

Airflow API (Stable)

Project description

airflow-python-sdk

Apache Airflow management API.

This Python package is automatically generated by the OpenAPI Generator project based on the specs:

  • API version: 1.0.0
  • Package version: 0.0.5
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://github.com/zachliu

Requirements.

Python >= 3.6

Installation & Usage

pip install

The python package is hosted on PyPI, you can install directly using:

pip install airflow-python-sdk

Then import the package:

import airflow_python_sdk

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import airflow_python_sdk

Getting Started

Please follow the installation procedure and then run the following:

import time
import airflow_python_sdk
from pprint import pprint
from airflow_python_sdk.api import config_api
from airflow_python_sdk.model.config import Config
from airflow_python_sdk.model.error import Error
# Defining the host is optional and defaults to http://localhost/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = airflow_python_sdk.Configuration(
    host = "http://localhost/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: basicAuth
configuration = airflow_python_sdk.Configuration(
    host = "https://<your-airflow-2.0.0>/api/v1",
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)


# Enter a context with an instance of the API client
with airflow_python_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = config_api.ConfigApi(api_client)
    limit = 100 # int | The numbers of items to return. (optional) (default to 100)
offset = 0 # int | The number of items to skip before starting to collect the result set. (optional)

    try:
        # Get current configuration
        api_response = api_instance.get_config(limit=limit, offset=offset)
        pprint(api_response)
    except airflow_python_sdk.ApiException as e:
        print("Exception when calling ConfigApi->get_config: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://localhost/api/v1

Class Method HTTP request Description
ConfigApi get_config GET /config Get current configuration
ConnectionApi create_connection POST /connections Create connection entry
ConnectionApi delete_connection DELETE /connections/{connection_id} Delete a connection entry
ConnectionApi get_connection GET /connections/{connection_id} Get a connection entry
ConnectionApi get_connections GET /connections Get all connection entries
ConnectionApi patch_connection PATCH /connections/{connection_id} Update a connection entry
DAGApi get_dag GET /dags/{dag_id} Get basic information about a DAG
DAGApi get_dag_source GET /dagSources/{file_token} Get source code using file token
DAGApi get_dag_structure GET /dags/{dag_id}/structure Get simplified representation of DAG.
DAGApi get_dags GET /dags Get all DAGs
DAGApi get_task GET /dags/{dag_id}/tasks/{task_id} Get simplified representation of a task.
DAGApi get_tasks GET /dags/{dag_id}/tasks Get tasks for DAG
DAGApi update_dag PATCH /dags/{dag_id} Update the specific DAG
DAGRunApi delete_dag_run DELETE /dags/{dag_id}/dagRuns/{dag_run_id} Delete a DAG Run
DAGRunApi get_dag_run GET /dags/{dag_id}/dagRuns/{dag_run_id} Get a DAG Run
DAGRunApi get_dag_runs GET /dags/{dag_id}/dagRuns Get all DAG Runs
DAGRunApi update_dag_run PATCH /dags/{dag_id}/dagRuns/{dag_run_id} Update a DAG Run
EventLogApi create_event_log POST /eventLogs Create event log
EventLogApi delete_event_log_entry DELETE /eventLogs/{event_log_id} Delete a log entry
EventLogApi get_event_log GET /eventLogs Get all log entries from event log
EventLogApi get_event_log_entry GET /eventLogs/{event_log_id} Get a log entry
EventLogApi update_event_log_entry PATCH /eventLogs/{event_log_id} Update a log entry
ImportErrorApi delete_import_error DELETE /importErrors/{import_error_id} Delete an import error
ImportErrorApi get_import_error GET /importErrors/{import_error_id} Get an import errors
ImportErrorApi get_import_errors GET /importErrors Get all import errors
PoolApi create_pool POST /pools Create aa pool
PoolApi delete_pool DELETE /pools/{pool_id} Delete a pool
PoolApi get_pool GET /pools/{pool_id} Get a pool
PoolApi get_pools GET /pools Get all pools
PoolApi get_task_instances GET /dags/{dag_id}/taskInstances Get list of task instance of DAG.
PoolApi upadte_pool PATCH /pools/{pool_id} Update a pool
TaskInstanceApi delete_task_instance DELETE /dags/{dag_id}/taskInstances/{task_id}/{execution_date} Delete DAG Run
TaskInstanceApi get_extra_links GET /dags/{dag_id}/taskInstances/{task_id}/{execution_date}/links Get extra links for task instance
TaskInstanceApi get_logs GET /dags/{dag_id}/taskInstances/{task_id}/{execution_date}/logs/{task_try_number} Get logs for specific task instance
TaskInstanceApi get_task_instance GET /dags/{dag_id}/taskInstances/{task_id}/{execution_date} Get a task instance
TaskInstanceApi update_task_instance PATCH /dags/{dag_id}/taskInstances/{task_id}/{execution_date} Update a task instance
VariableApi create_variable POST /variables Create a variables
VariableApi delete_variable DELETE /variables/{variable_id} Delete variable
VariableApi get_variable GET /variables/{variable_id} Get a variables by id
VariableApi get_variables GET /variables Get all variables
VariableApi lookup_variable GET /variables/lookup Get variable using its key.
VariableApi update_variable PATCH /variables/{variable_id} Update a variable by id
XComApi delete_x_com_value DELETE /dags/{dag_id}/taskInstances/{task_id}/{execution_date}/xcomValues/{key} Delete an XCom entry
XComApi get_x_com_value GET /dags/{dag_id}/taskInstances/{task_id}/{execution_date}/xcomValues/{key} Get an XCom entry
XComApi get_x_com_values GET /dags/{dag_id}/taskInstances/{task_id}/{execution_date}/xcomValues Get all XCom values
XComApi update_x_com_value PATCH /dags/{dag_id}/taskInstances/{task_id}/{execution_date}/xcomValues/{key} Update an XCom entry
XComApi update_x_com_values POST /dags/{dag_id}/taskInstances/{task_id}/{execution_date}/xcomValues Create an XCom entry

Documentation For Models

Documentation For Authorization

basicAuth

  • Type: HTTP basic authentication

Author

zach.z.liu@gmail.com

Notes for Large OpenAPI documents

If the OpenAPI document is large, imports in airflow_python_sdk.apis and airflow_python_sdk.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1: Use specific imports for apis and models like:

  • from airflow_python_sdk.api.default_api import DefaultApi
  • from airflow_python_sdk.model.pet import Pet

Solution 1: Before importing the package, adjust the maximum recursion limit as shown below:

import sys
sys.setrecursionlimit(1500)
import airflow_python_sdk
from airflow_python_sdk.apis import *
from airflow_python_sdk.models import *

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-python-sdk-0.0.5.tar.gz (70.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

airflow_python_sdk-0.0.5-py3-none-any.whl (184.6 kB view details)

Uploaded Python 3

File details

Details for the file airflow-python-sdk-0.0.5.tar.gz.

File metadata

  • Download URL: airflow-python-sdk-0.0.5.tar.gz
  • Upload date:
  • Size: 70.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.2

File hashes

Hashes for airflow-python-sdk-0.0.5.tar.gz
Algorithm Hash digest
SHA256 5dc31d2b5f344837c84f830873e7e5fa427476b0f21847e4ead5b002ba0536ad
MD5 db937606e163a1b9843fc6ca86f62792
BLAKE2b-256 130fea2c454f66ba6f4cf24734c48fa7feabf602199b54374d194081cfdeff47

See more details on using hashes here.

File details

Details for the file airflow_python_sdk-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: airflow_python_sdk-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 184.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.2

File hashes

Hashes for airflow_python_sdk-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 30ebe6bdd5859926a9e15fd1fbc8dd9f8b037b0cfde94b30d6dc6bad21f6d726
MD5 3664d52497c3a34b938de1bbaa1bd4e4
BLAKE2b-256 5e90615a57805b33d1debf8f7a01baaa5dd58e7b8841690348acef40252221bd

See more details on using hashes here.

Supported by

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