Apache Airflow Backfill API

The Backfill API from Apache Airflow — 6 operation(s) for backfill.

OpenAPI Specification

airflow-backfill-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Airflow Asset Backfill API
  description: Airflow API. All endpoints located under ``/api/v2`` can be used safely, are stable and backward compatible. Endpoints located under ``/ui`` are dedicated to the UI and are subject to breaking change depending on the need of the frontend. Users should not rely on those but use the public ones instead.
  version: '2'
tags:
- name: Backfill
paths:
  /api/v2/backfills:
    get:
      tags:
      - Backfill
      summary: Airflow List Backfills
      operationId: list_backfills
      security:
      - OAuth2PasswordBearer: []
      - HTTPBearer: []
      parameters:
      - name: dag_id
        in: query
        required: true
        schema:
          type: string
          title: Dag Id
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 50
          title: Limit
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: Offset
      - name: order_by
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          description: 'Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `id`'
          default:
          - id
          title: Order By
        description: 'Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `id`'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackfillCollectionResponse'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Forbidden
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      tags:
      - Backfill
      summary: Airflow Create Backfill
      operationId: create_backfill
      security:
      - OAuth2PasswordBearer: []
      - HTTPBearer: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BackfillPostBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackfillResponse'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Forbidden
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Conflict
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /api/v2/backfills/{backfill_id}:
    get:
      tags:
      - Backfill
      summary: Airflow Get Backfill
      operationId: get_backfill
      security:
      - OAuth2PasswordBearer: []
      - HTTPBearer: []
      parameters:
      - name: backfill_id
        in: path
        required: true
        schema:
          type: integer
          minimum: 0
          title: Backfill Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackfillResponse'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /api/v2/backfills/{backfill_id}/pause:
    put:
      tags:
      - Backfill
      summary: Airflow Pause Backfill
      operationId: pause_backfill
      security:
      - OAuth2PasswordBearer: []
      - HTTPBearer: []
      parameters:
      - name: backfill_id
        in: path
        required: true
        schema:
          type: integer
          minimum: 0
          title: Backfill Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackfillResponse'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Conflict
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /api/v2/backfills/{backfill_id}/unpause:
    put:
      tags:
      - Backfill
      summary: Airflow Unpause Backfill
      operationId: unpause_backfill
      security:
      - OAuth2PasswordBearer: []
      - HTTPBearer: []
      parameters:
      - name: backfill_id
        in: path
        required: true
        schema:
          type: integer
          minimum: 0
          title: Backfill Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackfillResponse'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Conflict
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /api/v2/backfills/{backfill_id}/cancel:
    put:
      tags:
      - Backfill
      summary: Airflow Cancel Backfill
      operationId: cancel_backfill
      security:
      - OAuth2PasswordBearer: []
      - HTTPBearer: []
      parameters:
      - name: backfill_id
        in: path
        required: true
        schema:
          type: integer
          minimum: 0
          title: Backfill Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackfillResponse'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Conflict
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /api/v2/backfills/dry_run:
    post:
      tags:
      - Backfill
      summary: Airflow Create Backfill Dry Run
      operationId: create_backfill_dry_run
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BackfillPostBody'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DryRunBackfillCollectionResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - OAuth2PasswordBearer: []
      - HTTPBearer: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ReprocessBehavior:
      type: string
      enum:
      - failed
      - completed
      - none
      title: ReprocessBehavior
      description: 'Internal enum for setting reprocess behavior in a backfill.


        :meta private:'
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    DryRunBackfillCollectionResponse:
      properties:
        backfills:
          items:
            $ref: '#/components/schemas/DryRunBackfillResponse'
          type: array
          title: Backfills
        total_entries:
          type: integer
          title: Total Entries
      type: object
      required:
      - backfills
      - total_entries
      title: DryRunBackfillCollectionResponse
      description: Backfill collection serializer for responses in dry-run mode.
    BackfillPostBody:
      properties:
        dag_id:
          type: string
          title: Dag Id
        from_date:
          type: string
          format: date-time
          title: From Date
        to_date:
          type: string
          format: date-time
          title: To Date
        run_backwards:
          type: boolean
          title: Run Backwards
          default: false
        dag_run_conf:
          additionalProperties: true
          type: object
          title: Dag Run Conf
          default: {}
        reprocess_behavior:
          $ref: '#/components/schemas/ReprocessBehavior'
          default: none
        max_active_runs:
          type: integer
          title: Max Active Runs
          default: 10
        run_on_latest_version:
          type: boolean
          title: Run On Latest Version
          default: true
      additionalProperties: false
      type: object
      required:
      - dag_id
      - from_date
      - to_date
      title: BackfillPostBody
      description: Object used for create backfill request.
    DryRunBackfillResponse:
      properties:
        logical_date:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Logical Date
        partition_key:
          anyOf:
          - type: string
          - type: 'null'
          title: Partition Key
        partition_date:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Partition Date
      type: object
      required:
      - logical_date
      - partition_key
      - partition_date
      title: DryRunBackfillResponse
      description: Backfill serializer for responses in dry-run mode.
    BackfillCollectionResponse:
      properties:
        backfills:
          items:
            $ref: '#/components/schemas/BackfillResponse'
          type: array
          title: Backfills
        total_entries:
          type: integer
          title: Total Entries
      type: object
      required:
      - backfills
      - total_entries
      title: BackfillCollectionResponse
      description: Backfill Collection serializer for responses.
    HTTPExceptionResponse:
      properties:
        detail:
          anyOf:
          - type: string
          - additionalProperties: true
            type: object
          title: Detail
      type: object
      required:
      - detail
      title: HTTPExceptionResponse
      description: HTTPException Model used for error response.
    BackfillResponse:
      properties:
        id:
          type: integer
          minimum: 0.0
          title: Id
        dag_id:
          type: string
          title: Dag Id
        from_date:
          type: string
          format: date-time
          title: From Date
        to_date:
          type: string
          format: date-time
          title: To Date
        dag_run_conf:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Dag Run Conf
        is_paused:
          type: boolean
          title: Is Paused
        reprocess_behavior:
          $ref: '#/components/schemas/ReprocessBehavior'
        max_active_runs:
          type: integer
          title: Max Active Runs
        created_at:
          type: string
          format: date-time
          title: Created At
        completed_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Completed At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        dag_display_name:
          type: string
          title: Dag Display Name
      type: object
      required:
      - id
      - dag_id
      - from_date
      - to_date
      - dag_run_conf
      - is_paused
      - reprocess_behavior
      - max_active_runs
      - created_at
      - completed_at
      - updated_at
      - dag_display_name
      title: BackfillResponse
      description: Base serializer for Backfill.
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      description: To authenticate Airflow API requests, clients must include a JWT (JSON Web Token) in the Authorization header of each request. This token is used to verify the identity of the client and ensure that they have the appropriate permissions to access the requested resources. You can use the endpoint ``POST /auth/token`` in order to generate a JWT token. Upon successful authentication, the server will issue a JWT token that contains the necessary information (such as user identity and scope) to authenticate subsequent requests. To learn more about Airflow public API authentication, please read https://airflow.apache.org/docs/apache-airflow/stable/security/api.html.
      flows:
        password:
          scopes: {}
          tokenUrl: /auth/token
    HTTPBearer:
      type: http
      scheme: bearer