Red Hat OpenShift Clusters API

Manage OpenShift clusters across cloud providers

OpenAPI Specification

red-hat-openshift-clusters-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Red Hat OpenShift Container Platform Add-ons Clusters 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: Clusters
  description: Manage OpenShift clusters across cloud providers
paths:
  /api/clusters_mgmt/v1/clusters:
    get:
      operationId: listClusters
      summary: List Clusters
      description: Returns a list of OpenShift clusters registered with the Cluster Manager. Supports filtering by cloud provider, region, version, and state. Results are paginated.
      tags:
      - Clusters
      parameters:
      - name: page
        in: query
        description: Page number for pagination (1-indexed)
        schema:
          type: integer
          default: 1
      - name: size
        in: query
        description: Number of results per page
        schema:
          type: integer
          default: 100
      - name: search
        in: query
        description: SQL-like search expression for filtering
        schema:
          type: string
      - name: order
        in: query
        description: SQL-like ORDER BY clause
        schema:
          type: string
      responses:
        '200':
          description: List of clusters returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClusterList'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createCluster
      summary: Create Cluster
      description: Creates a new OpenShift cluster on the specified cloud provider and region. Supports ROSA (AWS), ARO (Azure), and other OpenShift flavors.
      tags:
      - Clusters
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Cluster'
      responses:
        '201':
          description: Cluster creation initiated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cluster'
        '400':
          description: Invalid cluster configuration
        '401':
          $ref: '#/components/responses/Unauthorized'
  /api/clusters_mgmt/v1/clusters/{cluster_id}:
    get:
      operationId: getCluster
      summary: Get Cluster
      description: Returns detailed information about a specific OpenShift cluster.
      tags:
      - Clusters
      parameters:
      - $ref: '#/components/parameters/clusterId'
      responses:
        '200':
          description: Cluster details returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cluster'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    patch:
      operationId: updateCluster
      summary: Update Cluster
      description: Updates an existing cluster configuration (partial update).
      tags:
      - Clusters
      parameters:
      - $ref: '#/components/parameters/clusterId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClusterPatch'
      responses:
        '200':
          description: Cluster updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cluster'
    delete:
      operationId: deleteCluster
      summary: Delete Cluster
      description: Deletes an OpenShift cluster. This operation is irreversible.
      tags:
      - Clusters
      parameters:
      - $ref: '#/components/parameters/clusterId'
      responses:
        '204':
          description: Cluster deletion initiated
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    ClusterPatch:
      type: object
      properties:
        display_name:
          type: string
        nodes:
          type: object
          properties:
            compute:
              type: integer
    Error:
      type: object
      properties:
        kind:
          type: string
        id:
          type: string
        href:
          type: string
        code:
          type: string
        reason:
          type: string
    ClusterList:
      type: object
      properties:
        kind:
          type: string
          default: ClusterList
        page:
          type: integer
        size:
          type: integer
        total:
          type: integer
        items:
          type: array
          items:
            $ref: '#/components/schemas/Cluster'
    Cluster:
      type: object
      properties:
        kind:
          type: string
          default: Cluster
        id:
          type: string
        href:
          type: string
        name:
          type: string
        display_name:
          type: string
        cloud_provider:
          type: object
          properties:
            id:
              type: string
        region:
          type: object
          properties:
            id:
              type: string
        version:
          type: object
          properties:
            id:
              type: string
            raw_id:
              type: string
        state:
          type: string
          enum:
          - ready
          - installing
          - uninstalling
          - error
          - hibernating
        creation_timestamp:
          type: string
          format: date-time
        managed:
          type: boolean
        multi_az:
          type: boolean
        nodes:
          type: object
          properties:
            compute:
              type: integer
            infra:
              type: integer
            master:
              type: integer
        api:
          type: object
          properties:
            url:
              type: string
        console:
          type: object
          properties:
            url:
              type: string
  responses:
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication required or invalid token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  parameters:
    clusterId:
      name: cluster_id
      in: path
      required: true
      description: The cluster identifier
      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