Red Hat OpenShift Builds API

Build and BuildConfig resources for source-to-image and Dockerfile builds

OpenAPI Specification

red-hat-openshift-builds-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Red Hat OpenShift Container Platform Add-ons Builds API
  description: The OpenShift Container Platform REST API extends the Kubernetes API with OpenShift-specific resources for builds, image streams, routes, deployment configs, and project management. The API is organized into groups served at /apis/{group}/{version}. All operations require authentication via Bearer token obtained from the OAuth server. This specification covers the core OpenShift-specific API groups including apps.openshift.io, build.openshift.io, image.openshift.io, route.openshift.io, project.openshift.io, and security.openshift.io.
  version: '4.0'
  contact:
    name: Red Hat OpenShift Support
    url: https://access.redhat.com/support
  termsOfService: https://www.redhat.com/en/about/agreements
servers:
- url: https://api.{cluster}:6443
  description: OpenShift API Server
  variables:
    cluster:
      default: cluster.example.com
      description: OpenShift cluster API hostname
security:
- bearerAuth: []
tags:
- name: Builds
  description: Build and BuildConfig resources for source-to-image and Dockerfile builds
paths:
  /apis/build.openshift.io/v1/namespaces/{namespace}/buildconfigs:
    get:
      operationId: listBuildConfigs
      summary: List Build Configs
      description: Returns a list of BuildConfigs in the specified namespace. BuildConfigs define the source-to-image or Dockerfile build process for generating container images.
      tags:
      - Builds
      parameters:
      - $ref: '#/components/parameters/namespace'
      - $ref: '#/components/parameters/labelSelector'
      responses:
        '200':
          description: List of build configs returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuildConfigList'
    post:
      operationId: createBuildConfig
      summary: Create Build Config
      description: Creates a new BuildConfig defining the build process.
      tags:
      - Builds
      parameters:
      - $ref: '#/components/parameters/namespace'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BuildConfig'
      responses:
        '201':
          description: BuildConfig created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuildConfig'
  /apis/build.openshift.io/v1/namespaces/{namespace}/builds:
    get:
      operationId: listBuilds
      summary: List Builds
      description: Returns a list of Build instances in the specified namespace.
      tags:
      - Builds
      parameters:
      - $ref: '#/components/parameters/namespace'
      - $ref: '#/components/parameters/labelSelector'
      responses:
        '200':
          description: List of builds returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuildList'
components:
  schemas:
    Build:
      type: object
      properties:
        apiVersion:
          type: string
          default: build.openshift.io/v1
        kind:
          type: string
          default: Build
        metadata:
          $ref: '#/components/schemas/ObjectMeta'
        status:
          type: object
          properties:
            phase:
              type: string
              enum:
              - New
              - Pending
              - Running
              - Complete
              - Failed
              - Error
              - Cancelled
            startTimestamp:
              type: string
              format: date-time
            completionTimestamp:
              type: string
              format: date-time
    ObjectMeta:
      type: object
      properties:
        name:
          type: string
        namespace:
          type: string
        uid:
          type: string
        resourceVersion:
          type: string
        creationTimestamp:
          type: string
          format: date-time
        labels:
          type: object
          additionalProperties:
            type: string
        annotations:
          type: object
          additionalProperties:
            type: string
    BuildConfigList:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/BuildConfig'
    BuildConfig:
      type: object
      properties:
        apiVersion:
          type: string
          default: build.openshift.io/v1
        kind:
          type: string
          default: BuildConfig
        metadata:
          $ref: '#/components/schemas/ObjectMeta'
        spec:
          type: object
          properties:
            source:
              type: object
            strategy:
              type: object
            output:
              type: object
    BuildList:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Build'
  parameters:
    labelSelector:
      name: labelSelector
      in: query
      description: Label selector to filter resources (e.g., app=myapp)
      schema:
        type: string
    namespace:
      name: namespace
      in: path
      required: true
      description: Kubernetes namespace
      schema:
        type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
externalDocs:
  description: OpenShift Container Platform API Reference
  url: https://docs.openshift.com/container-platform/latest/rest_api/index.html