openapi: 3.0.3
info:
  title: Cisco ISE API - Patch
  version: 1.0.0
servers:
  - url: https://10.126.110.205:443
    description: Inferred Url
tags:
  - name: hotpatch-api-controller
    description: the hotpatch API
  - name: patch-api-controller
    description: the patch API
paths:
  /api/v1/hotpatch:
    get:
      tags:
        - Patching
      summary: List installed hot patches
      description: 'List all the installed hot patches in the system. '
      operationId: listInstalledHotpatches
      parameters:
        - name: X-Request-ID
          in: header
          description: The request ID header consists of the request ID which is returned in the response headers and also appears in the API service logs.
          required: false
          schema:
            type: string
            exampleSetFlag: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HotpatchListResponse'
                exampleSetFlag: false
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                exampleSetFlag: false
      security:
        - BasicAuth: []
  /api/v1/hotpatch/install:
    post:
      tags:
        - Patching
      summary: Trigger hotpatch installation on Cisco ISE node.
      description: 'Triggers hot patch installation on the Cisco ISE node. A task ID is returned which  can be used to monitor the progress of the hot patch installation process.  As hot patch installation triggers the Cisco ISE to restart, the task API becomes  unavailable for a certain period of time. For installation of hotpatch on  secondary nodes, request needs to be sent to individual node instead of the Primary Administration Node. '
      operationId: installHotpatch
      parameters:
        - name: X-Request-ID
          in: header
          description: The request ID header consists of the request ID which is returned in the response headers and also appears in the API service logs.
          required: false
          schema:
            type: string
            exampleSetFlag: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HotpatchInstallRequest'
              exampleSetFlag: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatchTaskResponse'
                exampleSetFlag: false
        '201':
          description: Created
        '202':
          description: Hotpatch installation triggered successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatchTaskResponse'
                exampleSetFlag: false
        '400':
          description: Invalid input. A valid hotpatch name and repository name should be provided as query parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                exampleSetFlag: false
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '409':
          description: Conflict in the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                exampleSetFlag: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                exampleSetFlag: false
      security:
        - BasicAuth: []
  /api/v1/hotpatch/rollback:
    post:
      tags:
        - Patching
      summary: Rollback hotpatch from the Cisco ISE node.
      description: 'Triggers hot patch rollback on the Cisco ISE node. A task ID is returned which  can be used to monitor the progress of the hot patch rollback process.  As hot patch rollback triggers the Cisco ISE to restart, the task API becomes  unavailable for a certain period of time. For rollback of hotpatch on secondary nodes , request needs to be sent on individual node instead of the Primary Administration Node. '
      operationId: rollbackHotpatch
      parameters:
        - name: X-Request-ID
          in: header
          description: The request ID header consists of the request ID which is returned in the response headers and also appears in the API service logs.
          required: false
          schema:
            type: string
            exampleSetFlag: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HotpatchRollbackRequest'
              exampleSetFlag: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatchTaskResponse'
                exampleSetFlag: false
        '201':
          description: Created
        '202':
          description: Hotpatch rollback triggered successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatchTaskResponse'
                exampleSetFlag: false
        '400':
          description: Invalid input. A valid rollback hotpatch name and repository name should be provided as query parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                exampleSetFlag: false
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '409':
          description: Conflict in the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                exampleSetFlag: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                exampleSetFlag: false
      security:
        - BasicAuth: []
  /api/v1/patch:
    get:
      tags:
        - Patching
      summary: List installed patches
      description: 'List all the installed patches in the system, with the patch number for rollback. '
      operationId: listInstalledPatches
      parameters:
        - name: X-Request-ID
          in: header
          description: The request ID header consists of the request ID which is returned in the response headers and also appears in the API service logs.
          required: false
          schema:
            type: string
            exampleSetFlag: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatchListResponse'
                exampleSetFlag: false
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                exampleSetFlag: false
      security:
        - BasicAuth: []
  /api/v1/patch/install:
    post:
      tags:
        - Patching
      summary: Trigger patch installation on the Cisco ISE node.
      description: 'Triggers patch installation on the Cisco ISE node. A task ID is returned which can be used to monitor the progress of the patch installation process. As the patch   installation triggers the Cisco ISE to restart, the task API becomes unavailable for  a certain period of time. For installation of patch on secondary nodes, request needs  to be sent to individual node instead of the Primary Administration Node. '
      operationId: installPatch
      parameters:
        - name: X-Request-ID
          in: header
          description: The request ID header consists of the request ID which is returned in the response headers and also appears in the API service logs.
          required: false
          schema:
            type: string
            exampleSetFlag: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchInstallRequest'
              exampleSetFlag: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatchTaskResponse'
                exampleSetFlag: false
        '201':
          description: Created
        '202':
          description: Patch installation triggered successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatchTaskResponse'
                exampleSetFlag: false
        '400':
          description: Invalid input. A valid patch name and repository name should be provided as query parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                exampleSetFlag: false
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '409':
          description: Conflict in the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                exampleSetFlag: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                exampleSetFlag: false
      security:
        - BasicAuth: []
  /api/v1/patch/rollback:
    post:
      tags:
        - Patching
      summary: Removes patch from the Cisco ISE node.
      description: 'Triggers patch rollback on the Cisco ISE node. A task ID is returned which can be used to monitor the progress of the patch rollback process. As the patch   rollback triggers the Cisco ISE to restart, the task API becomes unavailable for  a certain period of time. For rollback of patch on secondary nodes , request needs to sent on individual node instead of the Primary Administration Node. '
      operationId: rollbackPatch
      parameters:
        - name: X-Request-ID
          in: header
          description: The request ID header consists of the request ID which is returned in the response headers and also appears in the API service logs.
          required: false
          schema:
            type: string
            exampleSetFlag: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchRollbackRequest'
              exampleSetFlag: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatchTaskResponse'
                exampleSetFlag: false
        '201':
          description: Created
        '202':
          description: Patch rollback triggered successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatchTaskResponse'
                exampleSetFlag: false
        '400':
          description: Invalid input. A valid patch number must be provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                exampleSetFlag: false
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '409':
          description: Conflict in the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                exampleSetFlag: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                exampleSetFlag: false
      security:
        - BasicAuth: []
components:
  schemas:
    ErrorResponse:
      title: ErrorResponse
      type: object
      properties:
        response:
          $ref: '#/components/schemas/Message'
          exampleSetFlag: true
        version:
          type: string
          example: 1.0.0
          exampleSetFlag: true
      exampleSetFlag: false
    Hotpatch:
      title: Hotpatch
      type: object
      properties:
        hotpatchName:
          type: string
          exampleSetFlag: true
        installDate:
          type: string
          exampleSetFlag: true
      exampleSetFlag: false
    HotpatchInstallRequest:
      title: HotpatchInstallRequest
      required:
        - hotpatchName
        - repositoryName
      type: object
      properties:
        hotpatchName:
          type: string
          example: ise-apply-CSCxx99999_3.1.0.518_patch1-SPA.tar.gz
          exampleSetFlag: true
        isDirectoryListed:
          type: boolean
          example: true
          exampleSetFlag: true
        repositoryName:
          type: string
          example: repo_name
          exampleSetFlag: true
      exampleSetFlag: false
    HotpatchListResponse:
      title: HotpatchListResponse
      type: object
      properties:
        response:
          type: array
          exampleSetFlag: true
          items:
            $ref: '#/components/schemas/Hotpatch'
            exampleSetFlag: false
      exampleSetFlag: false
    HotpatchRollbackRequest:
      title: HotpatchRollbackRequest
      required:
        - hotpatchName
        - repositoryName
      type: object
      properties:
        hotpatchName:
          type: string
          example: ise-rollback-CSCxx99999_3.1.0.518_patch1-SPA.tar.gz
          exampleSetFlag: true
        isDirectoryListed:
          type: boolean
          example: true
          exampleSetFlag: true
        repositoryName:
          type: string
          example: repo_name
          exampleSetFlag: true
      exampleSetFlag: false
    Message:
      title: Message
      type: object
      properties:
        message:
          type: string
          example: Repository (repo_name) does not exist. Please configure the repository from Cisco ISE UI to proceed
          exampleSetFlag: true
      exampleSetFlag: false
    Patch:
      title: Patch
      type: object
      properties:
        installDate:
          type: string
          exampleSetFlag: true
        patchNumber:
          type: integer
          format: int32
          exampleSetFlag: true
      exampleSetFlag: false
    PatchInstallRequest:
      title: PatchInstallRequest
      required:
        - patchName
        - repositoryName
      type: object
      properties:
        isDirectoryListed:
          type: boolean
          example: true
          exampleSetFlag: true
        patchName:
          type: string
          example: ise-patchbundle-3.1.0.518-Patch1-21061111.SPA.x86_64.tar.gz
          exampleSetFlag: true
        repositoryName:
          type: string
          example: repo_name
          exampleSetFlag: true
      exampleSetFlag: false
    PatchListResponse:
      title: PatchListResponse
      type: object
      properties:
        iseVersion:
          type: string
          exampleSetFlag: true
        patchVersion:
          type: array
          exampleSetFlag: true
          items:
            $ref: '#/components/schemas/Patch'
            exampleSetFlag: false
      exampleSetFlag: false
    PatchRollbackRequest:
      title: PatchRollbackRequest
      required:
        - patchNumber
      type: object
      properties:
        patchNumber:
          type: integer
          format: int32
          example: 1
          exampleSetFlag: true
      exampleSetFlag: false
    PatchTaskResponse:
      title: PatchTaskResponse
      type: object
      properties:
        response:
          $ref: '#/components/schemas/TaskIdResponse'
          exampleSetFlag: true
        version:
          type: string
          example: 1.0.0
          exampleSetFlag: true
      exampleSetFlag: false
    TaskIdResponse:
      title: TaskIdResponse
      type: object
      properties:
        id:
          type: string
          description: ID which can be used to track the status of install / rollback of patch and hotpatch.
          example: a1714b90-be06-11eb-bf27-c208c4aa1432
          exampleSetFlag: true
        message:
          type: string
          example: Patch install task has been initiated. Please use Task Service status API to get the status of the patch install job
          exampleSetFlag: true
      exampleSetFlag: false
