Ansible Jobs API

The Jobs API from Ansible — 4 operation(s) for jobs.

OpenAPI Specification

ansible-jobs-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Ansible Automation Controller Auth Jobs API
  version: '2'
  description: 'REST API for Ansible Automation Controller (formerly Ansible Tower / AWX),

    the enterprise-grade automation engine inside the Red Hat Ansible Automation

    Platform. The API exposes management of inventories, hosts, credentials,

    projects, job templates, workflow job templates, schedules, organizations,

    teams, users, and the launching and inspection of jobs.

    '
  contact:
    name: Red Hat Ansible Support
    url: https://access.redhat.com/products/red-hat-ansible-automation-platform/
servers:
- url: https://{controller_host}/api/v2
  description: Self-hosted Ansible Automation Controller deployment
  variables:
    controller_host:
      default: controller.example.com
      description: Hostname of the Automation Controller instance.
security:
- OAuth2Token: []
- BasicAuth: []
tags:
- name: Jobs
paths:
  /jobs/:
    get:
      tags:
      - Jobs
      summary: List jobs
      operationId: listJobs
      parameters:
      - $ref: '#/components/parameters/Page'
      - $ref: '#/components/parameters/PageSize'
      - name: status
        in: query
        schema:
          type: string
          enum:
          - new
          - pending
          - waiting
          - running
          - successful
          - failed
          - error
          - canceled
      responses:
        '200':
          $ref: '#/components/responses/ListResponse'
  /jobs/{id}/:
    get:
      tags:
      - Jobs
      summary: Retrieve a job
      operationId: getJob
      parameters:
      - $ref: '#/components/parameters/Id'
      responses:
        '200':
          description: A job.
  /jobs/{id}/cancel/:
    post:
      tags:
      - Jobs
      summary: Cancel a job
      operationId: cancelJob
      parameters:
      - $ref: '#/components/parameters/Id'
      responses:
        '202':
          description: Cancel requested.
  /jobs/{id}/stdout/:
    get:
      tags:
      - Jobs
      summary: Get job stdout
      operationId: getJobStdout
      parameters:
      - $ref: '#/components/parameters/Id'
      - name: format
        in: query
        schema:
          type: string
          enum:
          - html
          - txt
          - json
          - ansi
          - txt_download
          - ansi_download
      responses:
        '200':
          description: Job stdout in the requested format.
components:
  parameters:
    Id:
      name: id
      in: path
      required: true
      schema:
        type: integer
    PageSize:
      name: page_size
      in: query
      schema:
        type: integer
        minimum: 1
        maximum: 200
        default: 25
    Page:
      name: page
      in: query
      schema:
        type: integer
        minimum: 1
        default: 1
  responses:
    ListResponse:
      description: A paginated list response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ListResponse'
  schemas:
    ListResponse:
      type: object
      properties:
        count:
          type: integer
        next:
          type: string
          nullable: true
        previous:
          type: string
          nullable: true
        results:
          type: array
          items:
            type: object
            additionalProperties: true
  securitySchemes:
    OAuth2Token:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Personal or application OAuth2 access token.
    BasicAuth:
      type: http
      scheme: basic
      description: HTTP Basic authentication using local controller credentials.