Skip to main content

🧩 Bulk Pause / Unpause API Plugin

The Bulk Pause / Unpause API provides REST endpoints to manage DAGs programmatically — enabling bulk control over DAGs using prefix or tag-based filters.


⚙️ Overview

  • Built using FastAPI
  • Communicates with Airflow’s core REST API
  • Provides endpoints to pause, unpause, or list DAGs
  • Integrated authentication via Airflow’s /auth/token

🔧 Features

  • Centralized API client (AirflowClient) for REST API interaction
  • Built-in authentication support using /auth/token
  • Simplified connection management via Airflow’s conn_id
  • Consistent response formatting and error handling

Connection Setup (Required)

Before using the client, create a connection in the Airflow UI → Admin → Connections.

Field Description Example
Conn Id Used in code airflow_api_conn
Conn Type http or https http
Host Airflow Webserver http://localhost:8080
Login Username / Service Account admin
Password Password or API token mysecret

🧱 High-Level Architecture

flowchart TD
    U[User or Script] --> X[Airflow Xtra API]
    subgraph Airflow Webserver
      X --> A[Auth Token Endpoint]
      X --> R[Airflow REST API v2]
    end
    R --> S[Scheduler or Executor]
    S --> D[DAGs and Tasks]

    subgraph Airflow Connection
      C1[Conn Type http or https]
      C2[Host webserver]
      C3[Port optional]
      C4[Login Password]
      C5[Conn id airflow_api_conn]
    end
    X -. uses .-> C1
    X -. uses .-> C2
    X -. uses .-> C3
    X -. uses .-> C4
    X -. uses .-> C5

🧩 Component View

flowchart LR
    subgraph Plugin
      H[Helpers AirflowClient<br/>resolve conn id<br/>token auth<br/>REST calls]
      F[FastAPI Routes<br/>pause unpause list]
    end

    UI[React UI optional] --> F
    S[Scripts or CLI] --> F

    F --> H
    H --> AR[Airflow REST API v2]
    H --> AT[Auth Token Endpoint]

    AR --> SCH[Scheduler or Executor]
    SCH --> DAG[DAGs and Tasks]

🧩 Example Endpoints

Endpoint Method Description
/api/airflow_bulk_pause_api/pause POST Pause matching DAGs
/api/airflow_bulk_pause_api/unpause POST Unpause matching DAGs
/api/airflow_bulk_pause_api/list GET List all active DAGs

🧪 Example Usage

curl -X POST http://localhost:8080/api/airflow_bulk_pause_api/pause -d '{"name_prefix": "etl_"}'

Response:

{
  "paused": ["etl_orders", "etl_customers"],
  "skipped": ["daily_cleanup"]
}

🧱 Architecture

  • FastAPI routes registered through the Airflow plugin manager
  • Uses AirflowClient (from helpers) for backend communication
  • Returns structured JSON responses for UI or automation scripts

🧾 License

MIT © Rahul Rajasekharan

Metadata

Release files for air-labs-bulk-pause-api 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for air-labs-bulk-pause-api 0.1.1
File Size Uploaded Provenance
air_labs_bulk_pause_api-0.1.1.tar.gz 5.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for air-labs-bulk-pause-api 0.1.1
File Interpreter ABI Platform
air_labs_bulk_pause_api-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.6 kB

Release files / air_labs_bulk_pause_api-0.1.1.tar.gz

Download URL air_labs_bulk_pause_api-0.1.1.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fb24f2280a057f102e29262522c117907e6f9e64733be4a0808b3c206880dcc6
BLAKE2b-256 checksum
How to use checksums
8efd0197184f45f016ed9870068efdef11da4221789053b43f2188af9181d2c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / air_labs_bulk_pause_api-0.1.1-py3-none-any.whl

Download URL air_labs_bulk_pause_api-0.1.1-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
915281163fa039f627832969d20831035757ddb47f80fe92cc13d9cfc4587efd
BLAKE2b-256 checksum
How to use checksums
7d9b3008af70e24db0f1132bc251c21154724f292477a7cdfdf6eab20bbb503d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Security for air-labs-bulk-pause-api 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page