> ## 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 draftt sections for a component



## OpenAPI

````yaml https://api.draftt.io/swagger post /component/{componentId}/draftt/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}/draftt/query:
    post:
      tags:
        - Component
      summary: Query draftt sections for a component
      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:
              - eksAddOns
              - deployments
              - controlPlane
              - nodes
              - k8sApi
          description: List of draftt sections to retrieve
      example:
        sections:
          - deployments
          - controlPlane
    DrafttQueryResponse:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
            properties:
              componentId:
                type: string
              name:
                type: string
              type:
                type: string
              currentVersion:
                type: string
              desiredVersion:
                type: string
              status:
                type: string
                enum:
                  - active
                  - pending
                  - completed
              upgradePlan:
                type: object
                properties:
                  AddOns:
                    $ref: '#/components/schemas/APIUpgradePlan'
                  deployments:
                    $ref: '#/components/schemas/APIUpgradePlan'
                  controlPlane:
                    $ref: '#/components/schemas/APIUpgradePlan'
                  nodes:
                    $ref: '#/components/schemas/APIUpgradePlan'
                  k8sApi:
                    $ref: '#/components/schemas/APIUpgradePlan'
              createdAt:
                type: string
                format: date-time
              updatedAt:
                type: string
                format: date-time
          description: Array of draftt items with requested sections
      example:
        items:
          - componentId: '123'
            name: ' Cluster'
            type: ''
            currentVersion: 1.23.0
            desiredVersion: 1.24.0
            status: active
            upgradePlan:
              AddOns:
                changes:
                  - name: aws-ebs-csi-driver
                    currentVersion: 1.5.0
                    desiredVersion: 1.6.0
                    status: active
                    deprecatedResources:
                      - name: csi-node
                        version: v1beta1
                        namespace: kube-system
                        requiredChanges:
                          - isBreaking: true
                            path: spec.template
                            type: PROPERTY_REMOVED
                            newValue:
                              type: object
                              properties: {}
                            oldValue:
                              type: string
            createdAt: '2024-05-06T11:25:51.513Z'
            updatedAt: '2024-05-06T11:25:51.513Z'
    APIUpgradePlan:
      type: object
      properties:
        changes:
          type: array
          items:
            $ref: '#/components/schemas/APIK8sChange'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
          required:
            - message
      required:
        - error
    APIK8sChange:
      type: object
      properties:
        name:
          type: string
        currentVersion:
          type: string
        desiredVersion:
          type: string
        status:
          type: string
          enum:
            - active
            - pending
            - completed
            - acknowledged
        helmChart:
          type: string
        deprecatedResources:
          type: array
          items:
            $ref: '#/components/schemas/APIK8sDeprecatedResource'
    APIK8sDeprecatedResource:
      type: object
      properties:
        name:
          type: string
        version:
          type: string
        namespace:
          type: string
        lastApplied:
          type: boolean
        helmRelease:
          type: object
          properties:
            name:
              type: string
            namespace:
              type: string
            chart:
              type: string
            version:
              type: string
            apiVersions:
              type: object
              properties:
                name:
                  type: string
                kind:
                  type: string
                apiVersion:
                  type: string
        requiredChanges:
          type: array
          items:
            $ref: '#/components/schemas/APIK8sRequiredChange'
    APIK8sRequiredChange:
      type: object
      properties:
        isBreaking:
          type: boolean
        newValue:
          $ref: '#/components/schemas/SchemaProperty'
        oldValue:
          $ref: '#/components/schemas/SchemaProperty'
        path:
          type: string
        type:
          $ref: '#/components/schemas/ChangeType'
    SchemaProperty:
      type: object
      properties:
        type:
          type: string
        format:
          type: string
        description:
          type: string
        required:
          type: boolean
        properties:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SchemaProperty'
        items:
          $ref: '#/components/schemas/SchemaProperty'
        enum:
          type: array
          items:
            type: object
        default:
          type: object
        nullable:
          type: boolean
        anyOf:
          type: array
          items:
            $ref: '#/components/schemas/SchemaProperty'
        allOf:
          type: array
          items:
            $ref: '#/components/schemas/SchemaProperty'
        oneOf:
          type: array
          items:
            $ref: '#/components/schemas/SchemaProperty'
    ChangeType:
      type: string
      enum:
        - PROPERTY_ADDED
        - PROPERTY_REMOVED
        - PROPERTY_TYPE_CHANGED
        - PROPERTY_REQUIRED
        - PROPERTY_OPTIONAL
        - PROPERTY_FORMAT_CHANGED
        - SCHEMA_STRUCTURE_CHANGED
  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

````