Apache Airflow Job API

The Job API from Apache Airflow — 1 operation(s) for job.

OpenAPI Specification

airflow-job-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Airflow Asset Job 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: Job
paths:
  /api/v2/jobs:
    get:
      tags:
      - Job
      summary: Airflow Get Jobs
      description: Get all jobs.
      operationId: get_jobs
      security:
      - OAuth2PasswordBearer: []
      - HTTPBearer: []
      parameters:
      - name: is_alive
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Is Alive
      - name: start_date_gte
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Start Date Gte
      - name: start_date_gt
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Start Date Gt
      - name: start_date_lte
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Start Date Lte
      - name: start_date_lt
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Start Date Lt
      - name: end_date_gte
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: End Date Gte
      - name: end_date_gt
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: End Date Gt
      - name: end_date_lte
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: End Date Lte
      - name: end_date_lt
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: End Date Lt
      - 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, dag_id, state, job_type, start_date, end_date, latest_heartbeat, executor_class, hostname, unixname`'
          default:
          - id
          title: Order By
        description: 'Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `id, dag_id, state, job_type, start_date, end_date, latest_heartbeat, executor_class, hostname, unixname`'
      - name: job_state
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Job State
      - name: job_type
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Job Type
      - name: hostname
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Hostname
      - name: executor_class
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Executor Class
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobCollectionResponse'
        '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
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    JobCollectionResponse:
      properties:
        jobs:
          items:
            $ref: '#/components/schemas/JobResponse'
          type: array
          title: Jobs
        total_entries:
          type: integer
          title: Total Entries
      type: object
      required:
      - jobs
      - total_entries
      title: JobCollectionResponse
      description: Job Collection Response.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
    JobResponse:
      properties:
        id:
          type: integer
          title: Id
        dag_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Dag Id
        state:
          anyOf:
          - type: string
          - type: 'null'
          title: State
        job_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Job Type
        start_date:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Start Date
        end_date:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: End Date
        latest_heartbeat:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Latest Heartbeat
        executor_class:
          anyOf:
          - type: string
          - type: 'null'
          title: Executor Class
        hostname:
          anyOf:
          - type: string
          - type: 'null'
          title: Hostname
        unixname:
          anyOf:
          - type: string
          - type: 'null'
          title: Unixname
        dag_display_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Dag Display Name
      type: object
      required:
      - id
      - dag_id
      - state
      - job_type
      - start_date
      - end_date
      - latest_heartbeat
      - executor_class
      - hostname
      - unixname
      title: JobResponse
      description: Job 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.
  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