> ## Documentation Index
> Fetch the complete documentation index at: https://docs.draftt.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Query Upgrade Plan sections for a component



## OpenAPI

````yaml https://api.draftt.io/swagger post /component/{componentId}/upgradePlan/query
openapi: 3.1.0
info:
  title: Draftt API
  version: 0.2.1
servers:
  - url: https://api.draftt.io/v1
security:
  - BearerAuth: []
paths:
  /component/{componentId}/upgradePlan/query:
    post:
      tags:
        - Upgrade Plan
      summary: Query Upgrade Plan sections for a component
      operationId: queryComponentUpgradePlans
      parameters:
        - name: componentId
          in: path
          required: true
          schema:
            type: integer
          description: Component ID
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DrafttQueryRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DrafttQueryResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    DrafttQueryRequest:
      type: object
      properties:
        sections:
          type: array
          items:
            type: string
            enum:
              - deployments
              - controlPlane
              - nodes
              - k8sApi
          description: Flavor-specific upgrade-plan sections to retrieve.
      required:
        - sections
      additionalProperties: false
      example:
        sections:
          - deployments
          - controlPlane
          - nodes
          - k8sApi
    DrafttQueryResponse:
      type: object
      properties:
        items:
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/K8sUpgradePlanApiAttributes'
              - $ref: '#/components/schemas/DrafttApiAttributes'
          description: Array of Upgrade Plans containing the requested sections
      required:
        - items
      example:
        items:
          - id: '73'
            componentId: '123'
            name: Kubernetes 1.31 upgrade
            technology: eks
            currentVersion: '1.30'
            desiredVersion: '1.31'
            status: pending
            upgradePlan:
              deployments:
                changes:
                  - k8sResourceId: 62d2425e-35c4-4c25-ae02-6503ee0cc94f
                    name: ingress-nginx
                    currentVersion: 1.10.0
                    desiredVersion: 1.11.0
                    status: pending
    K8sUpgradePlanApiAttributes:
      allOf:
        - $ref: '#/components/schemas/DrafttApiAttributes'
        - type: object
          properties:
            technology:
              type: string
              enum:
                - eks
                - gke
                - aks
            upgradePlan:
              type: object
              properties:
                deployments:
                  $ref: '#/components/schemas/K8sUpgradePlanApiSection'
                controlPlane:
                  $ref: '#/components/schemas/K8sUpgradePlanApiSection'
                nodes:
                  $ref: '#/components/schemas/K8sUpgradePlanApiSection'
                k8sApi:
                  $ref: '#/components/schemas/K8sUpgradePlanApiSection'
    DrafttApiAttributes:
      type: object
      properties:
        id:
          type: string
          format: int64
        componentId:
          type: string
          format: int64
        name:
          type: string
        technology:
          type: string
          description: Upgrade-plan flavor discriminator.
        currentVersion:
          type: string
        desiredVersion:
          type: string
        status:
          type: string
          enum:
            - active
            - pending
            - completed
        upgradePlan:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DrafttApiSection'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        completedAt:
          type:
            - string
            - 'null'
          format: date-time
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - componentId
        - name
        - technology
        - currentVersion
        - desiredVersion
        - status
        - upgradePlan
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
          required:
            - message
      required:
        - error
    K8sUpgradePlanApiSection:
      type: object
      properties:
        changes:
          type: array
          items:
            $ref: '#/components/schemas/K8sUpgradePlanApiChange'
      required:
        - changes
    DrafttApiSection:
      type: object
      properties:
        changes:
          type: array
          items:
            $ref: '#/components/schemas/DrafttApiChange'
      required:
        - changes
    K8sUpgradePlanApiChange:
      allOf:
        - $ref: '#/components/schemas/DrafttApiChange'
        - type: object
          properties:
            k8sResourceId:
              type: string
              format: uuid
              description: >-
                Present on resource-backed changes. Legacy plans may omit it
                during the rollout window.
            imageName:
              type: string
            namespace:
              type: string
            workloadName:
              type: string
            maxCompatibleVersion:
              type: string
            replacementToolName:
              type: string
            requiredAction:
              type: string
            helmChart:
              type: string
            desiredHelmChartData:
              type: object
              additionalProperties: true
            workloadManagement:
              type: object
              additionalProperties: true
            nodeManagement:
              type: object
              additionalProperties: true
            crdManagement:
              type: object
              additionalProperties: true
            deprecatedResources:
              type: array
              items:
                $ref: '#/components/schemas/K8sUpgradePlanApiResource'
    DrafttApiChange:
      type: object
      properties:
        name:
          type: string
        currentVersion:
          type: string
        desiredVersion:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - warning
            - pending
            - completed
            - removed
            - info
            - acknowledged
        description:
          type: string
    K8sUpgradePlanApiResource:
      type: object
      properties:
        k8sResourceId:
          type: string
          format: uuid
        name:
          type: string
        version:
          type: string
        namespace:
          type:
            - string
            - 'null'
        lastApplied:
          type: boolean
        managedBy:
          type: string
        helmRelease:
          type: object
          additionalProperties: true
        requiredChanges:
          type: array
          items:
            type: object
            additionalProperties: true
        apiVersionState:
          type: object
          additionalProperties: true
      required:
        - name
        - version
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: Too Many Requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````