openapi: '3.0.2'
info:
  title: DPS API Server specifications for both IED and IEM
  version: '2.1.0'
  description: API specifications for the Databus Provisioning Service (DPS) for both IED and IEM.
  contact:
    name: Team Abhiyanta
servers:
  - url: 'https://{iedIp}/ie-dps-communication-broker/dps/api/v2/api/v1'
    description: Application with network mode host
    variables:
      iedIp:
        default: localhost
        description: IP address of the IED device
  - url: 'http://ie-dps-communication-broker/dps/api/v2:6779/api/v1'
    description: Application with proxy-redirect network
tags:
  - name: Users
    description: ""
  - name: Topics
    description: ""
  - name: Persistency
    description: ""
  - name: Certificates
    description: ""
  - name: ExternalClient
    description: ""
  - name: AllowAnonymous
    description: ""
components:
  schemas:
    datamodel.AppParams:
      properties:
        appId:
          example: app1
          type: string
        deviceName:
          example: abhiyanta1
          type: string
      required:
      - appId
      - deviceName
      type: object
    datamodel.UserParams:
      properties:
        credential:
          $ref: '#/components/schemas/datamodel.Credential'
        appParams:
          $ref: '#/components/schemas/datamodel.AppParams'
      required:
        - userName
        - appParams
      type: object     
   
    datamodel.Credential:
      properties:        
        userName:
          example: admin
          type: string
        password:
          example: admin123
          type: string
      required:      
      - userName
      - password
      type: object
    datamodel.UserData:
      type: object
      properties:
        appParams:
          $ref: '#/components/schemas/datamodel.AppParams'
        credential:          
          $ref: '#/components/schemas/datamodel.Credential'      
                
      required:
      - appParams
      - credential
    datamodel.TopicData:
      properties:
        userParams:
          $ref: '#/components/schemas/datamodel.UserParams' 
        topicsInfo:
          items:
            $ref: '#/components/schemas/datamodel.TopicInfo'
          type: array
      required:
      - userParams
      - topicsInfo
      type: object
    datamodel.TopicDataForDelete:
      properties:
        appParams:
          $ref: '#/components/schemas/datamodel.AppParams'
        credential:          
          $ref: '#/components/schemas/datamodel.Credential'   
        topicsInfo:
          example: ["/topic/1"]
          type: array
          items:
            type: string
      required:
      - userData
      - topicsInfo
      type: object
    datamodel.TopicInfo:
      properties:
        topicName:
          example: /topic/1
          type: string
        topicDetails:
          example: Test topic
          type: string  
        permission:
          enum:
          - subscribe
          - both
          - none
          example: both
          type: string
        permissionOthers:
          enum:
          - subscribe
          - both
          - none
          example: subscribe
          type: string  
        metadata:
          example: '{}'
          type: string    
        
      required:
      - topicName
      - permission
      type: object
    utils.ErrorCode:
      properties:
        code:
          type: integer
        description:
          type: string
      type: object  
    utils.HTTPResponse:
      properties:
        errorCode:
           $ref: '#/components/schemas/utils.ErrorCode'
        message:
          type: string
        jobId:
          type: string  
        responseData:
          $ref: '#/components/schemas/utils.ResponseData'
        severity:
          type: string
          example: info
        status:
          type: string
          example: success
        timeStamp:
          type: string
          example: 2023-08-01T12:34:56Z
      type: object  
    utils.ResponseData:
      properties:
        datasetNum:
          example: 0
          type: integer
        totalDataset:
          example: 0
          type: integer
        responseData:
          example: ""
          type: string
      type: object
    datamodel.PersistenceConfig:
      type: object
      properties:
        enabled:
          type: boolean
          description: Flag to enable/disable data persistence
        retentionPeriod:
          type: string
          enum: ['5m', '1h', '1d']
          default: '5m'
    datamodel.ExternalClientConfig:
      type: object
      properties:
        isExternalClientEnabled:
          type: boolean
          description: Flag to enable/disable external client access
          example: true
      required:
      - isExternalClientEnabled
    datamodel.AllowAnonymousConfig:
      type: object
      properties:
        allowAnonymous:
          type: boolean
          description: Flag to allow or deny anonymous access
          example: false
      required:
      - allowAnonymous
      
  securitySchemes:
    APIKey:
      name: Authorization
      type: apiKey
      in: header
paths:
  /user:
    post:
      operationId: addUser
      tags:
        - Users
      description: 'Add a non-existing user'      
      parameters:
        - name: Authorization
          in: header
          description: The authentication token.
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/datamodel.UserData'
      responses:
        '200':
          description: User created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                example-1:
                  value:
                    errorCode: {}
                    message: user is added successfully                    
                    jobId: job-123
                    responseData: {}
                    severity: info
                    status: success
                    timeStamp: 2023-08-01T12:34:56Z     
           
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 451
                      description: invalid Schema
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z  
                   
                error-2:
                  value:
                    errorCode:
                      code: 454
                      description: configuration is already available
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z      
                error-3:
                  value:
                    errorCode:
                      code: 457
                      description: invalid json
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z              
               
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/utils.HTTPResponse' 
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 450
                      description: authentication token is missing 
                    message: Error message from code                    
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z   
                error-2:
                  value:
                    errorCode:
                      code: 458
                      description: authentication token is invalid 
                    message: Error message from code                    
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z             
                error-3:
                  value:
                    errorCode:
                      code: 452
                      description: invalid application 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-02T10:22:33Z       
                error-4:
                  value:
                    errorCode:
                      code: 460
                      description: device information currently unavailable  
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z      
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/utils.HTTPResponse' 
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 550
                      description: json marshal error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z

                error-2:
                  value:
                    errorCode:
                      code: 551
                      description: json unmarshal error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-02T10:22:33Z

                error-3:
                  value:
                    errorCode:
                      code: 552
                      description: string decode error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z    
                  
                error-4:
                  value:
                    errorCode:
                      code: 553
                      description: i/o error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z     
                error-5:
                  value:
                    errorCode:
                      code: 554
                      description: error generating hash
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z   
                error-6:
                  value:
                    errorCode:
                      code: 555
                      description: device with databus installed could not be found 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z     
                error-7:
                  value:
                    errorCode:
                      code: 556
                      description: REST api failed 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z      
                error-8:
                  value:
                    errorCode:
                      code: 557
                      description: sql error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z      
                  
                error-9:
                  value:
                    errorCode:
                      code: 558
                      description: error from databus 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z         
                error-10:
                  value:
                    errorCode:
                      code: 561
                      description: Type assertion error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z              


        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/utils.HTTPResponse'   
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 559
                      description:  check DPS/Databus configuration for partial completion 
                    message: Error message from code
                    jobId: job-123
                    responseData: 
                      datasetNum: 1
                      responseData: '{"operationId":"01GMNVX0Z7VQ5TB08GB1V8BHCE"}'
                      totalDataset: 1
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z        
        '429':
          description: Too Many Requests
          content:
            text/plain:
              schema:
                type: string
                example: 'You have reached maximum request limit'
    delete: 
      operationId: deleteUser
      tags:
        - Users
      description: 'Delete existing user'      
      parameters:
        - name: Authorization
          in: header
          description: The authentication token.
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/datamodel.UserData'    
      responses:
        '200':
          description: User deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                example-1:
                  value:
                    errorCode: {}
                    message: user is deleted successfully                    
                    jobId: job-123
                    responseData: {}
                    severity: info
                    status: success
                    timeStamp: 2023-08-01T12:34:56Z
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 451
                      description: invalid Schema
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z    
                error-2:
                  value:
                    errorCode:
                      code: 457
                      description: invalid json
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z  
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/utils.HTTPResponse' 
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 450
                      description: authentication token is missing 
                    message: Error message from code                    
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z   
                error-2:
                  value:
                    errorCode:
                      code: 458
                      description: authentication token is invalid 
                    message: Error message from code                    
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z             
                error-3:
                  value:
                    errorCode:
                      code: 452
                      description: invalid application 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-02T10:22:33Z     
                error-4:
                  value:
                    errorCode:
                      code: 455
                      description: invalid user 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z      
                error-5:
                  value:
                    errorCode:
                      code: 453
                      description: invalid password
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z  
                error-6:
                  value:
                    errorCode:
                      code: 460
                      description: device information currently unavailable  
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z 
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/utils.HTTPResponse' 
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 550
                      description: json marshal error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 551
                      description: json unmarshal error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-02T10:22:33Z
                error-3:
                  value:
                    errorCode:
                      code: 552
                      description: string decode error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z                      
                error-4:
                  value:
                    errorCode:
                      code: 553
                      description: i/o error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z     
                error-5:
                  value:
                    errorCode:
                      code: 554
                      description: error generating hash
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z    
                error-6:
                  value:
                    errorCode:
                      code: 555
                      description: device with databus installed could not be found 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z     
                error-7:
                  value:
                    errorCode:
                      code: 556
                      description: REST api failed 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z      
                error-8:
                  value:
                    errorCode:
                      code: 557
                      description: sql error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z                      
                error-9:
                  value:
                    errorCode:
                      code: 558
                      description: error from databus 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z         
                error-10:
                  value:
                    errorCode:
                      code: 561
                      description: Type assertion error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z              
        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/utils.HTTPResponse'   
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 559
                      description:  check DPS/Databus configuration for partial completion 
                    message: Error message from code
                    jobId: job-123
                    responseData: 
                      datasetNum: 1
                      responseData: '{"operationId":"01GMNVX0Z7VQ5TB08GB1V8BHCE"}'
                      totalDataset: 1
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z        
        '429':
          description: Too Many Requests
          content:
            text/plain:
              schema:
                type: string
                example: 'You have reached maximum request limit'
  /topics:
    post:
      operationId: addTopics
      tags:
        - Topics
      description: Add topics for a user
      parameters:
        - name: Authorization
          in: header
          description: The authentication token.
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/datamodel.TopicData'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                example-1:
                  value:
                    errorCode: {}
                    message: topics are added successfully                    
                    jobId: job-123
                    responseData: {}
                    severity: info
                    status: success
                    timeStamp: 2023-08-01T12:34:56Z     
           
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 451
                      description: invalid Schema 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z       
                error-2:
                  value:
                    errorCode:
                      code: 457
                      description: invalid json 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z                
                error-3:
                  value:
                    errorCode:
                      code: 454
                      description: configuration is already available
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z  
                error-4:
                  value:
                    errorCode:
                      code: 459
                      description: duplicate configuration in request 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z      
               
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/utils.HTTPResponse' 
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 450
                      description: authentication token is missing 
                    message: Error message from code                    
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z    
                error-2:
                  value:
                    errorCode:
                      code: 458
                      description: authentication token is invalid 
                    message: Error message from code                    
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z       
                error-3:
                  value:
                    errorCode:
                      code: 452
                      description: invalid application 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-02T10:22:33Z    
                error-4:
                  value:
                    errorCode:
                      code: 455
                      description: invalid user 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z        
                error-5:
                  value:
                    errorCode:
                      code: 456
                      description: requested permission for topic is not allowed by owner user 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z       
                error-6:
                  value:
                    errorCode:
                      code: 460
                      description: device information currently unavailable 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z               
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/utils.HTTPResponse' 
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 550
                      description: json marshal error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z

                error-2:
                  value:
                    errorCode:
                      code: 551
                      description: json unmarshal error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-02T10:22:33Z

                error-3:
                  value:
                    errorCode:
                      code: 552
                      description: string decode error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z   
                 
                error-4:
                  value:
                    errorCode:
                      code: 553
                      description: i/o error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z     
                error-5:
                  value:
                    errorCode:
                      code: 554
                      description: error generating hash 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: "2023-08-03T15:45:22Z"   
                error-6:
                  value:
                    errorCode:
                      code: 555
                      description: device with databus installed could not be found
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z     
                error-7:
                  value:
                    errorCode:
                      code: 556
                      description:  REST api failed 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z      
                error-8:
                  value:
                    errorCode:
                      code: 557
                      description: sql error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z      
                
                error-9:
                  value:
                    errorCode:
                      code: 558
                      description: error from databus 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z       
                error-10:
                  value:
                    errorCode:
                      code: 561
                      description: Type assertion error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z     
                         
        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/utils.HTTPResponse'   
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 559
                      description: check DPS/Databus configuration for partial completion
                    message: Error message from code
                    jobId: job-123
                    responseData: 
                      datasetNum: 1
                      responseData: '{"operationId":"01GMNVX0Z7VQ5TB08GB1V8BHCE"}'
                      totalDataset: 1
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z        
        '429':
          description: Too Many Requests
          content:
            text/plain:
              schema:
                type: string
                example: 'You have reached maximum request limit'
    delete:
      operationId: deleteTopics
      tags:
        - Topics
      description: 'Delete existing topics'      
      parameters:
        - name: Authorization
          in: header
          description: The authentication token.
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/datamodel.TopicDataForDelete'    
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                example-1:
                  value:
                    errorCode: {}
                    message: topics are deleted successfully                    
                    jobId: job-123
                    responseData: {}
                    severity: info
                    status: success
                    timeStamp: 2023-08-01T12:34:56Z   
                example-2:
                  value:
                    errorCode: {}
                    message: topics are deleted partially                    
                    jobId: job-123
                    responseData:
                      datasetNum: 1
                      totalDataset: 1
                      responseData: '["/topic/1"]'
                    severity: info
                    status: success
                    timeStamp: 2023-08-01T12:34:56Z 
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 451
                      description: invalid Schema 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z       
                error-2:
                  value:
                    errorCode:
                      code: 457
                      description: invalid json 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z                
                error-3:
                  value:
                    errorCode:
                      code: 459
                      description: duplicate configuration in request 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z    
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/utils.HTTPResponse' 
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 450
                      description: authentication token is missing 
                    message: Error message from code                    
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z    
                error-2:
                  value:
                    errorCode:
                      code: 458
                      description: authentication token is invalid 
                    message: Error message from code                    
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z       
                error-3:
                  value:
                    errorCode:
                      code: 452
                      description: invalid application 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-02T10:22:33Z    
                error-4:
                  value:
                    errorCode:
                      code: 455
                      description: invalid user 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z  
                error-5:
                  value:
                    errorCode:
                      code: 453
                      description: invalid password
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z     
                error-6:
                  value:
                    errorCode:
                      code: 462
                      description: invalid topics
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z        
                error-7:
                  value:
                    errorCode:
                      code: 460
                      description: device information currently unavailable 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z 
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/utils.HTTPResponse' 
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 550
                      description: json marshal error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z

                error-2:
                  value:
                    errorCode:
                      code: 551
                      description: json unmarshal error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-02T10:22:33Z

                error-3:
                  value:
                    errorCode:
                      code: 552
                      description: string decode error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z   
                 
                error-4:
                  value:
                    errorCode:
                      code: 553
                      description: i/o error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z     
                error-5:
                  value:
                    errorCode:
                      code: 554
                      description: error generating hash
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z    
                error-6:
                  value:
                    errorCode:
                      code: 555
                      description: device with databus installed could not be found
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z     
                error-7:
                  value:
                    errorCode:
                      code: 556
                      description:  REST api failed 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z      
                error-8:
                  value:
                    errorCode:
                      code: 557
                      description: sql error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z      
                
                error-9:
                  value:
                    errorCode:
                      code: 558
                      description: error from databus 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z       
                error-10:
                  value:
                    errorCode:
                      code: 561
                      description: Type assertion error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z
        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/utils.HTTPResponse'   
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 559
                      description: check DPS/Databus configuration for partial completion
                    message: Error message from code
                    jobId: job-123
                    responseData: 
                      datasetNum: 1
                      responseData: '{"operationId":"01GMNVX0Z7VQ5TB08GB1V8BHCE"}'
                      totalDataset: 1
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z        
        '429':
          description: Too Many Requests
          content:
            text/plain:
              schema:
                type: string
                example: 'You have reached maximum request limit'
  /topics/{appId}:
    get:
      operationId: getTopics
      tags:
        - Topics
      description: 'Get topics'      
      parameters:
        - in: path
          name: appId
          description: Application id.
          required: true
          schema:
            type: string  
        - in: query
          name: deviceName
          description: Device Name.
          schema:
            type: string  
        - name: Authorization
          in: header
          description: The authentication token.
          required: true
          schema:
            type: string
      responses:
        '200':
          description:  Fetched topic details successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                example-1:
                  value:
                    errorCode: {}
                    message: got the topics info                    
                    jobId: ""
                    responseData: 
                      datasetNum: 1
                      totalDataset: 1
                      responseData: '{[{"topicName": "/topic/1","userName":"user1","permissionOthers": "subscribe","metadata": "{}"}]'
                    severity: info
                    status: success
                    timeStamp: 2023-08-01T12:34:56Z     
           
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 461
                      description: invalid parameters
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z              
               
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/utils.HTTPResponse' 
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 450
                      description: authentication token is missing 
                    message: Error message from code                    
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z   
                error-2:
                  value:
                    errorCode:
                      code: 458
                      description: authentication token is invalid 
                    message: Error message from code                    
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z             
                error-3:
                  value:
                    errorCode:
                      code: 452
                      description: invalid application 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-02T10:22:33Z           
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/utils.HTTPResponse' 
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 550
                      description: json marshal error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z

                error-2:
                  value:
                    errorCode:
                      code: 551
                      description: json unmarshal error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-02T10:22:33Z

                error-3:
                  value:
                    errorCode:
                      code: 552
                      description: string decode error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z    
                  
                error-4:
                  value:
                    errorCode:
                      code: 553
                      description: i/o error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z        
                error-5:
                  value:
                    errorCode:
                      code: 556
                      description: REST api failed 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z      
                error-6:
                  value:
                    errorCode:
                      code: 557
                      description: sql error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z      
       
                error-7:
                  value:
                    errorCode:
                      code: 561
                      description: Type assertion error 
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z              

        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/utils.HTTPResponse'   
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 559
                      description:  check DPS/Databus configuration for partial completion 
                    message: Error message from code
                    jobId: job-123
                    responseData: 
                      datasetNum: 1
                      responseData: '{"operationId":"01GMNVX0Z7VQ5TB08GB1V8BHCE"}'
                      totalDataset: 1
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
        '404':
          description: Path parameters are not provided
        '429':
          description: Too Many Requests
          content:
            text/plain:
              schema:
                type: string
                example: 'You have reached maximum request limit'
  /persistence:
    get:
      operationId: getPersistence
      summary: Get data persistence configuration
      description: |-
        This endpoint allows you to retrieve the current data persistence configuration.
        
        **Note**: Authorization token can be fetched using https://{deviceIP}/device/edge/api/v2/login/direct.
      tags:
        - Persistency    
      parameters:
        - name: Authorization
          in: header
          description: The authentication token.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Fetched persistence configuration successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                example-1:
                  value:
                    errorCode: {}
                    message: Persistence data retrieved successfully
                    jobId: ""
                    responseData:
                      datasetNum: 1
                      totalDataset: 1
                      responseData: '{"enabled": true, "retentionPeriod": "5m"}'
                    severity: info
                    status: success
                    timeStamp: 2023-08-01T12:34:56Z
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 450
                      description: authentication token is missing
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 458
                      description: authentication token is invalid
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 550
                      description: json marshal error
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 557
                      description: sql error
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z
        '429':
          description: Too Many Requests
          content:
            text/plain:
              schema:
                type: string
                example: 'You have reached maximum request limit'
    put:
      operationId: updatePersistence
      summary: Update data persistence configuration
      description: |-
        This endpoint allows you to update the data persistence configuration.
        
        **Note**: Authorization token can be fetched using https://{deviceIP}/device/edge/api/v2/login/direct.
      tags:
        - Persistency
      security:
        - APIKey: []
      parameters:
        - name: Authorization
          in: header
          description: The authentication token.
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/datamodel.PersistenceConfig'
      responses:
        '200':
          description: Persistence configuration updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                example-1:
                  value:
                    errorCode: {}
                    message: Persistence data updated successfully
                    jobId: job-123
                    responseData:
                      datasetNum: 1
                      totalDataset: 1
                      responseData: '{"enabled": true, "retentionPeriod": "5m"}'
                    severity: info
                    status: success
                    timeStamp: 2023-08-01T12:34:56Z
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 451
                      description: invalid Schema
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 457
                      description: invalid json
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 450
                      description: authentication token is missing
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 458
                      description: authentication token is invalid
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 550
                      description: json marshal error
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 557
                      description: sql error
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z
        '429':
          description: Too Many Requests
          content:
            text/plain:
              schema:
                type: string
                example: 'You have reached maximum request limit'
  /certificates:
    get:
      operationId: getCertificates
      summary: Get SSL/TLS certificate configuration
      description: |-
        This endpoint allows you to retrieve the current SSL/TLS certificate configuration.
        
        **Note**: Authorization token can be fetched using https://{deviceIP}/device/edge/api/v2/login/direct.
      tags:
        - Certificates
      security:
        - APIKey: []
      parameters:
        - name: Authorization
          in: header
          description: The authentication token.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Fetched certificate configuration successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                example-1:
                  value:
                    errorCode: {}
                    message: Certificates data retrieved successfully
                    jobId: ""
                    responseData:
                      datasetNum: 1
                      totalDataset: 1
                      responseData: '{"certificateFile": "encodedcertificatestream", "keyFile": "encodedkeystream", "caCertificateFile": "encodedcacertstream"}'
                    severity: info
                    status: success
                    timeStamp: 2023-08-01T12:34:56Z
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 450
                      description: authentication token is missing
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 458
                      description: authentication token is invalid
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 550
                      description: json marshal error
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 557
                      description: sql error
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z
        '429':
          description: Too Many Requests
          content:
            text/plain:
              schema:
                type: string
                example: 'You have reached maximum request limit'
    put:
      operationId: updateCertificates
      summary: Update SSL/TLS certificate configuration
      description: |-
        This endpoint allows you to update the SSL/TLS certificate configuration.
        
        **Note**: Authorization token can be fetched using https://{deviceIP}/device/edge/api/v2/login/direct.
      tags:
        - Certificates
      security:
        - APIKey: []
      parameters:
        - name: Authorization
          in: header
          description: The authentication token.
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                certificateFile:
                  type: string
                  format: binary
                keyFile:
                  type: string
                  format: binary
                caCertificateFile:
                  type: string
                  format: binary
      responses:
        '200':
          description: Certificate configuration updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                example-1:
                  value:
                    errorCode: {}
                    message: Certificates data updated successfully
                    jobId: job-123
                    responseData:
                      datasetNum: 1
                      totalDataset: 1
                      responseData: '{"certificateFile": "encodedcertificatestream", "keyFile": "encodedkeystream", "caCertificateFile": "encodedcacertstream"}'
                    severity: info
                    status: success
                    timeStamp: 2023-08-01T12:34:56Z
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 451
                      description: invalid Schema
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 450
                      description: authentication token is missing
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 458
                      description: authentication token is invalid
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 550
                      description: json marshal error
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 553
                      description: i/o error
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z
        '429':
          description: Too Many Requests
          content:
            text/plain:
              schema:
                type: string
                example: 'You have reached maximum request limit'
    delete:
      operationId: deleteCertificates
      summary: Delete SSL/TLS certificate configuration
      description: |-
        This endpoint allows you to delete the SSL/TLS certificate configuration.
        
        **Note**: Authorization token can be fetched using https://{deviceIP}/device/edge/api/v2/login/direct.
      tags:
        - Certificates
      security:
        - APIKey: []
      parameters:
        - name: Authorization
          in: header
          description: The authentication token.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Successful response, but no content
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 450
                      description: authentication token is missing
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 458
                      description: authentication token is invalid
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 550
                      description: json marshal error
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 557
                      description: sql error
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z
        '429':
          description: Too Many Requests
          content:
            text/plain:
              schema:
                type: string
                example: 'You have reached maximum request limit'
  /externalclientaccess:
    get:
      operationId: getExternalClientConfig
      summary: Get external client access configuration
      description: |-
        This endpoint allows you to retrieve the current external client access configuration.
        
        **Note**: Authorization token can be fetched using https://{deviceIP}/device/edge/api/v2/login/direct.
      tags:
        - ExternalClient
      security:
        - APIKey: []
      parameters:
        - name: Authorization
          in: header
          description: The authentication token.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Fetched external client configuration successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                example-1:
                  value:
                    errorCode: {}
                    message: External client configuration retrieved successfully
                    jobId: ""
                    responseData:
                      datasetNum: 1
                      totalDataset: 1
                      responseData: '{"isExternalClientEnabled": true}'
                    severity: info
                    status: success
                    timeStamp: 2023-08-01T12:34:56Z
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 450
                      description: authentication token is missing
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 458
                      description: authentication token is invalid
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 550
                      description: json marshal error
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 557
                      description: sql error
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z
        '429':
          description: Too Many Requests
          content:
            text/plain:
              schema:
                type: string
                example: 'You have reached maximum request limit'
    put:
      operationId: updateExternalClientConfig
      summary: Enable or disable external client access
      description: |-
        This endpoint allows you to update the isExternalClientEnabled flag which controls whether external client access is enabled.
        
        **Note**: Authorization token can be fetched using https://{deviceIP}/device/edge/api/v2/login/direct.
      tags:
        - ExternalClient
      security:
        - APIKey: []
      parameters:
        - name: Authorization
          in: header
          description: The authentication token.
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/datamodel.ExternalClientConfig'
      responses:
        '200':
          description: External client configuration updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                example-1:
                  value:
                    errorCode: {}
                    message: External client configuration updated successfully.
                    jobId: job-123
                    responseData:
                      datasetNum: 1
                      totalDataset: 1
                      responseData: '{"isExternalClientEnabled": true}'
                    severity: info
                    status: success
                    timeStamp: 2023-08-01T12:34:56Z
                example-2:
                  value:
                    errorCode: {}
                    message: External client configuration updated successfully. Warning - allowAnonymous flag is currently enabled, so external clients will NOT be allowed to connect. Disable anonymous access to enable external client connections.
                    jobId: job-123
                    responseData:
                      datasetNum: 1
                      totalDataset: 1
                      responseData: '{"isExternalClientEnabled": true, "allowAnonymous": true}'
                    severity: warning
                    status: success
                    timeStamp: 2023-08-01T12:34:56Z
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 451
                      description: invalid Schema
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 457
                      description: invalid json
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 450
                      description: authentication token is missing
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 458
                      description: authentication token is invalid
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 550
                      description: json marshal error
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 557
                      description: sql error
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z
        '429':
          description: Too Many Requests
          content:
            text/plain:
              schema:
                type: string
                example: 'You have reached maximum request limit'
  /allowanonymous:
    get:
      operationId: getAllowAnonymousConfig
      summary: Get allow anonymous configuration
      description: |-
        This endpoint allows you to retrieve the current allow anonymous configuration.
        
        **Note**: Authorization token can be fetched using https://{iedip}/device/edge/api/v2/login/direct.
      tags:
        - AllowAnonymous
      security:
        - APIKey: []
      parameters:
        - name: Authorization
          in: header
          description: The authentication token.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Fetched allow anonymous configuration successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                example-1:
                  value:
                    errorCode: {}
                    message: Allow anonymous configuration retrieved successfully
                    jobId: ""
                    responseData:
                      datasetNum: 1
                      totalDataset: 1
                      responseData: '{"allowAnonymous": false}'
                    severity: info
                    status: success
                    timeStamp: 2023-08-01T12:34:56Z
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 450
                      description: authentication token is missing
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 458
                      description: authentication token is invalid
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 550
                      description: json marshal error
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 557
                      description: sql error
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z
        '429':
          description: Too Many Requests
          content:
            text/plain:
              schema:
                type: string
                example: 'You have reached maximum request limit'
    put:
      operationId: updateAllowAnonymousConfig
      summary: Update allow anonymous configuration
      description: |-
        This endpoint allows you to update the allowAnonymous flag which controls whether anonymous access is allowed.
        
        **Note**: Authorization token can be fetched using https://{iedip}/device/edge/api/v2/login/direct.
      tags:
        - AllowAnonymous
      security:
        - APIKey: []
      parameters:
        - name: Authorization
          in: header
          description: The authentication token.
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/datamodel.AllowAnonymousConfig'
      responses:
        '200':
          description: Allow anonymous configuration updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                example-1:
                  value:
                    errorCode: {}
                    message: Allow anonymous configuration updated successfully
                    jobId: job-123
                    responseData:
                      datasetNum: 1
                      totalDataset: 1
                      responseData: '{"allowAnonymous": false}'
                    severity: info
                    status: success
                    timeStamp: 2023-08-01T12:34:56Z
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 451
                      description: invalid Schema
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 457
                      description: invalid json
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 450
                      description: authentication token is missing
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 458
                      description: authentication token is invalid
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.HTTPResponse'
              examples:
                error-1:
                  value:
                    errorCode:
                      code: 550
                      description: json marshal error
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-01T12:34:56Z
                error-2:
                  value:
                    errorCode:
                      code: 557
                      description: sql error
                    message: Error message from code
                    jobId: ""
                    responseData: {}
                    severity: error
                    status: failed
                    timeStamp: 2023-08-03T15:45:22Z
        '429':
          description: Too Many Requests
          content:
            text/plain:
              schema:
                type: string
                example: 'You have reached maximum request limit'