swagger: '2.0'
info:
  description: 'Use the IEM API to automate tasks, such as IED onboarding or Industrial Edge Application management. The specification is compatible starting from version 1.4.3 of the IEM.'
  version: v1.1.0
  title: Portal Public API
basePath: /portal/api/v1
tags:
  - name: statistics
  - name: devices
  - name: tokens
  - name: applications
  - name: app-configs
  - name: installjobs
  - name: batches
  - name: application-import-jobs
  - name: developer-applications
securityDefinitions:
  ApiKey:
    type: apiKey
    in: header
    name: Authorization
security:
  - ApiKey: []
paths:
  /application-import-jobs:
    post:
      tags:
        - application-import-jobs
      summary: Import application  to catalog
      description: This method import the application to catalog. IEMA v1.3 is required.
      operationId: import-application
      consumes:
        - multipart/form-data
      produces:
        - application/json
      parameters:
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
        - name: file to import
          in: formData
          description: The .app file to import application.
          required: true
          type: file
        - name: 'digest_file[optional]'
          in: formData
          description: The digest.json file if application is signed or need digest file.
          type: file
      responses:
        '202':
          description: successful operation (Requset accepted and it will return job status.)
          schema:
            $ref: '#/definitions/ImportAppJobStatus'
        '400':
          description: |-
            invalid.fileName
            file.size.exceeded
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '401':
          description: |-
            auth.missingAuthToken 
            auth.tokenExpired
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: |-
            auth.unauthorizedToken 
            auth.accessDenied 
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: |-
            notFound.file
            empty.userId 
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: |-
            something.wrong
            storage.space.unavailable
          schema:
            $ref: '#/definitions/ErrorResponseType'
  '/application-import-jobs/{id}':
    get:
      tags:
        - application-import-jobs
      summary: Get import application job status from jobId
      description: This method returns the import application job status. IEMA v1.3 is required.
      operationId: get-import-job-status
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: id
          in: path
          description: The unique job ID
          required: true
          type: string
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
      responses:
        '200':
          description: Successful operation
          schema:
            $ref: '#/definitions/ImportAppJobStatus'
        '400':
          description: invalid.data
        '401':
          description: |-
            auth.missingAuthToken
            auth_tokenExpired
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: |-
            auth.unauthorizedToken
            auth.accessDenied
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: notFound.job
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: |-
            something.wrong
            server.error
  '/devices/{deviceId}/statistics':
    get:
      tags:
        - statistics
      summary: Get statistics for a device
      description: This method returns statistics for a specified device
      operationId: get-statistics
      produces:
        - application/json
      parameters:
        - name: deviceId
          in: path
          description: The UUID of the device
          required: true
          type: string
          pattern: '[a-z0-9A-Z]{3,32}$'
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
      responses:
        '200':
          description: successful operation
          schema:
            $ref: '#/definitions/Statistics'
        '400':
          description: invalid.data
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '401':
          description: auth.missingAuthToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: |-
            auth.unauthorizedToken
            auth.accessDenied
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: notFound.device
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          schema:
            $ref: '#/definitions/ErrorResponseType'
          description: something.wrong

  /developer-applications:
    get:
      tags:
        - developer-applications
      summary: List all application
      description: This method returns a list of all applications the logged-in user created in the edge management and Invited application. IEMA v1.3 is required.
      operationId: list-user-applications
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
      responses:
        '200':
          description: Successful operation
          schema:
            $ref: '#/definitions/DeveloperApplication'
        '401':
          description: auth.missingAuthToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: |-
            auth.unauthorizedToken
            auth.accessDenied
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: something.wrong
          schema:
            $ref: '#/definitions/ErrorResponseType'
  '/developer-applications/{appid}/versions':
    get:
      tags:
        - developer-applications
      summary: List application's versions
      description: This method returns a list of a specific application (self created and invited). IEMA v1.3 is required.
      operationId: list-application-versions
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: appid
          in: path
          description: The unique application ID
          required: true
          type: string
          pattern: '^[a-z0-9A-Z]{32}$'
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
      responses:
        '200':
          description: Successful operation
          schema:
            $ref: '#/definitions/Version'
          examples: {}
        '401':
          description: auth.missingAuthToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
          examples: {}
        '403':
          description: |-
            auth.unauthorizedToken
            auth.accessDenied
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: notFound.application
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: something.wrong
          schema:
            $ref: '#/definitions/ErrorResponseType'
  /devices:
    get:
      tags:
        - devices
      summary: List Edge Devices
      description: This method returns a list of all Edge Devices available for the current user
      operationId: list-devices
      produces:
        - application/json
      parameters:
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
        - name: size
          in: query
          description: The size of the page
          required: false
          default: 10
          type: number
        - name: page
          in: query
          description: The page number
          required: false
          default: 1
          type: number
      responses:
        '200':
          description: Successful operation
          schema:
            $ref: '#/definitions/DeviceExternalVO'
        '401':
          description: auth.missingAuthToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: auth.unauthorizedToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: something.wrong
          schema:
            $ref: '#/definitions/ErrorResponseType'
    post:
      tags:
        - devices
      summary: Create a new Edge Device
      description: This method creates an edge device within the IEM with the given configuration. It returns a JSON string which can be used for onboarding an edge device.
      operationId: create-device
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
        - in: body
          name: body
          description: The device details object
          required: true
          schema:
            $ref: '#/definitions/DeviceCreation'
      responses:
        '200':
          description: Successful operation
          schema:
            $ref: '#/definitions/DeviceCreated'
        '400':
          schema:
            $ref: '#/definitions/ErrorResponseType'
          description: |-
            invalid.device.name
            invalid.macaddress
            deviceName.unavailable
            limit.gatewayInterface
            required.IP
            invalid.ip
            invalid.ntpServer
            no.proxy.invalid
            required.hostname
            proxy.invalid
        '401':
          description: auth.missingAuthToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: auth.unauthorizedToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          schema:
            $ref: '#/definitions/ErrorResponseType'
          description: notFound.user
        '409':
          schema:
            $ref: '#/definitions/ErrorResponseType'
          description: |-
            alreadyExists.deviceId
            alreadyExists.macadress
        '500':
          schema:
            $ref: '#/definitions/ErrorResponseType'
          description: |-
            platform.not.supported
            something.wrong
  '/devices/{deviceId}':
    get:
      tags:
        - devices
      summary: Get Edge Device details
      description: This method returns device metadata for a specified device
      operationId: get-device
      produces:
        - application/json
      parameters:
        - name: deviceId
          in: path
          description: UUID of the device
          required: true
          type: string
          pattern: '[a-z0-9A-Z]{3,32}$'
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
      responses:
        '200':
          description: Successful operation
          schema:
            $ref: '#/definitions/DeviceVO'
        '401':
          description: auth.missingAuthToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: auth.unauthorizedToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: notFound.user
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: something.wrong
          schema:
            $ref: '#/definitions/ErrorResponseType'
    delete:
      tags:
        - devices
      summary: Delete Edge Device
      description: This method removes an Edge Device and returns the device ID.
      operationId: delete-device
      produces:
        - application/json
      parameters:
        - name: deviceId
          in: path
          description: The unique Edge Device ID
          required: true
          type: string
          pattern: '[a-z0-9A-Z]{3,32}$'
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
      responses:
        '204':
          description: Successfully deleted device
        '400':
          description: |-
            invalid.data
            notFound.appliance
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '401':
          description: |-
            auth.missingPublicKey
            auth.invalidTokenGenerator
            auth.missingTokenGenerator
            auth.missingAuthToken
            auth.invalidToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: |-
            auth.unauthorizedToken
            auth.accessDenied
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: |-
            notFound.deviceId
            notFound.user
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: something.wrong
          schema:
            $ref: '#/definitions/ErrorResponseType'
  /devices/installed-apps:
    get:
      tags:
        - devices
      summary: List Edge Device apps
      description: 'This method returns a list of all applications installed on a specific Edge Device. If the Edge Device ID is not provided, then it lists all applications installed on all the Edge Devices assigned to the logged-in user.'
      operationId: list-apps-on-devices
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: deviceId
          in: query
          description: The unique Edge Device ID
          required: false
          type: string
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
      responses:
        '200':
          description: Successful operation
          schema:
            $ref: '#/definitions/DeviceApplication'
          examples: {}
        '401':
          description: |-
            auth.missingAuthToken
            auth_tokenExpired
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: auth.unauthorizedToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: notFound.user
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: |-
            something.wrong
            server.error
          schema:
            $ref: '#/definitions/ErrorResponseType'
  '/devices/{deviceId}/logs':
    get:
      tags:
        - devices
      summary: List edge device logs files
      description: This method returns list of edge device logs files. IEMA **v1.4*** is required.
      operationId: list-device-logs
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: deviceId
          in: path
          description: The unique Edge Device ID
          required: true
          type: string
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
      responses:
        '200':
          description: Successful operation
          schema:
            $ref: '#/definitions/DeviceLog'
          examples: {}
        '401':
          description: auth.missingAuthToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: auth.unauthorizedToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: notFound.device
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: something.wrong
          schema:
            $ref: '#/definitions/ErrorResponseType'
  '/devices/{deviceId}/logs/{logId}':
    get:
      tags:
        - devices
      summary: Download edge device logs by logId.
      description: This method downloads edge device logs. If you are using IEMA version below v1.4.7 please use this path instead 'devices/{deviceId}/log/{logId}'.
      operationId: download-device-logs
      consumes:
        - application/json
      produces:
        - application/octet-stream
      parameters:
        - name: logId
          in: path
          description: The unique log ID
          required: true
          type: string
        - name: deviceId
          in: path
          description: The unique device ID
          required: true
          type: string
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
      responses:
        '200':
          description: successful operation (return public path of the log file)
          schema:
            description: ''
            type: object
            properties:
              data:
                type: string
            required:
              - data
        '401':
          description: auth.missingAuthToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: auth.unauthorizedToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: |-
            notFound.logFile
            notFound.device
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: Unable to download logs.
          schema:
            $ref: '#/definitions/ErrorResponseType'
  /login/direct:
    post:
      tags:
        - tokens
      summary: Creates a user specific token.
      description: |-
        This method logs in a user to the edge management with the username, password, and verification code ( if multi-
        factor verification is enabled ). Example: '{"username":"myuser", "password":"mypassword"}'
      operationId: get-token
      security:
        - {}
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - in: body
          name: body
          description: 'The map of login credentials, including username, password and verificationCode (optional)'
          required: true
          schema:
            $ref: '#/definitions/Login'
      responses:
        '200':
          description: Successful operation
          schema:
            $ref: '#/definitions/LoginResponse'
          examples:
            example-1:
              value:
                data:
                  access_token: string
                  expires_in: 0
        '400':
          description: user.suspended
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: notFound.user
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: something.wrong
          schema:
            $ref: '#/definitions/ErrorResponseType'
  /logout:
    get:
      tags:
        - tokens
      summary: Invalidates the token.
      description: This method invalidates the token in IEM.
      operationId: invalidate-token
      produces:
        - application/json
      parameters:
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
      responses:
        '204':
          description: Successful operation
        '401':
          description: |-
            auth.missingAuthToken
            auth.tokenExpired
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: auth.unauthorizedToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: notFound.user
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: something.wrong
          schema:
            $ref: '#/definitions/ErrorResponseType'
  /auth-tokens/verify:
    get:
      tags:
        - tokens
      summary: Verifies the Auth Token
      description: This method will verify the Auth token.
      operationId: verify-token
      produces:
        - application/json
      parameters:
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
      responses:
        '200':
          description: Successful operation
          schema:
            $ref: '#/definitions/AuthorizationsVO'
          examples: {}
        '400':
          description: |-
            Bad Request, some preconditions did not match e.g. Token to validate is missing.
          schema:
            $ref: '#/definitions/ErrorResponseType'            
        '401':
          description: |-
            auth.missingAuthToken
            auth.tokenExpired
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: |-
            auth.accessDenied
            auth.unauthorizedToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: notFound.user
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: something.wrong
          schema:
            $ref: '#/definitions/ErrorResponseType'
  /applications:
    get:
      tags:
        - applications
      summary: List apps
      description: This method returns a list of applications in catalog .
      operationId: list-catalog
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
      responses:
        '200':
          description: Successful operation
          schema:
            $ref: '#/definitions/CatalogApplication'
        '401':
          description: |-
            auth.missingAuthToken
            auth.tokenExpired
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: auth.unauthorizedToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: notFound.user
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: |-
            something.wrong
            server.error
          schema:
            $ref: '#/definitions/ErrorResponseType'
  '/applications/{appId}/configs':
    get:
      tags:
        - app-configs
      summary: List app configs
      description: This method returns a list of configurations for a specific application in the edge management.
      operationId: list-config
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
        - name: appId
          in: path
          description: The unique application ID
          required: true
          type: string
      responses:
        '200':
          description: Successful operation
          schema:
            $ref: '#/definitions/ApplicationConfiguration'
        '400':
          description: invalid.id
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '401':
          description: |-
            auth.missingAuthToken
            auth.tokenExpired
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: |-
            auth.unauthorizedToken
            auth.accessDenied
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: |-
            notFound.user
            notFound.application
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: |-
            something.wrong
            server.error
          schema:
            $ref: '#/definitions/ErrorResponseType'
  '/applications/{appId}/configs/{configId}/template/{templateId}':
    get:
      tags:
        - app-configs
      summary: Download application configuration template
      description: This method downloads an application configuration template.
      operationId: get-template
      produces:
        - application/json
      parameters:
        - name: appId
          in: path
          description: The unique application ID
          required: true
          type: string
          pattern: '[a-z0-9A-Z]{3,32}$'
        - name: configId
          in: path
          description: The unique config ID
          required: true
          type: string
          pattern: '[a-z0-9A-Z]{3,32}$'
        - name: templateId
          in: path
          description: The unique config templateId ID
          required: true
          type: string
          pattern: '[a-z0-9A-Z]{3,32}$'
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
      responses:
        '200':
          description: successful operation
          schema:
            $ref: '#/definitions/OctetStreamData'
        '400':
          description: invalid.id
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '401':
          description: |-
            auth.missingAuthToken
            auth_tokenExpired
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: |-
            auth.unauthorizedToken
            auth.accessDenied
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: |-
            notFound.user
            notFound.application
            notFound.Appconfig
            notFound.file
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: |-
            something.wrong
            server.error
          schema:
            $ref: '#/definitions/ErrorResponseType'
  '/installjobs/{jobId}':
    get:
      tags:
        - installjobs
      summary: Get job status from jobId
      description: This method returns job status.
      operationId: get-job-status
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: jobId
          in: path
          description: The unique job ID
          required: true
          type: string
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
      responses:
        '200':
          description: Successful operation
          schema:
            description: ''
            type: object
            properties:
              data:
                type: string
                enum:
                  - COMPLETED
                  - PENDING
                  - QUEUED
                  - FAILED
                  - EXECUTING
                  - DELETED
                  - DELETING
            required:
              - data
          examples: {}
        '400':
          description: invalid.id
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '401':
          description: |-
            auth.missingAuthToken
            auth_tokenExpired
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: |-
            auth.unauthorizedToken
            auth.accessDenied
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: |-
            notFound.user
            notFound.job
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: |-
            something.wrong
            server.error
          schema:
            $ref: '#/definitions/ErrorResponseType'
  /installjobs:
    post:
      tags:
        - installjobs
      summary: Delete jobs
      description: This method removes a list of jobs from the edge management. 
      operationId: delete-job
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
        - in: body
          name: body
          description: The list of job IDs
          required: true
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: Successful operation
          schema:
            description: ''
            type: object
            properties:
              data:
                type: boolean
            required:
              - data
        '401':
          description: |-
            auth.missingAuthToken
            auth_tokenExpired
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: |-
            auth.unauthorizedToken
            auth.accessDenied
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: |-
            notFound.user
            notFound.job
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: |-
            server.error
            something.wrong
          schema:
            $ref: '#/definitions/ErrorResponseType'
    put:
      tags:
        - installjobs
      summary: 'Perform action(Retry, Rollback, RetryResubmit or RollbackResubmit) on job ids'
      description: This method performs intented action and provide action submission status in map for each job.
      operationId: retry-rollback-job
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
        - name: action
          in: query
          description: 'The action to perform (Retry, Rollback, RetryResubmit or RollbackResubmit)'
          required: true
          type: string
          enum:
            - Retry
            - Rollback
            - RetryResubmit
            - RollbackResubmit
        - in: body
          name: body
          description: The list of job IDs
          required: true
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: successful operation
          schema:
            $ref: '#/definitions/RetryResponse'
        '400':
          description: operation.invalid
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '401':
          description: |-
            auth.missingAuthToken
            auth_tokenExpired
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: |-
            auth.unauthorizedToken
            auth.accessDenied
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: |-
            notFound.user
            notFound.job
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: |-
            server.error
            something.wrong
          schema:
            $ref: '#/definitions/ErrorResponseType'
  /batches:
    post:
      tags:
        - batches
      summary: Execute commands on app
      description: 'This method executes commands (install, uninstall or update) on an application in the edge management.'
      operationId: submit-batch
      consumes:
        - multipart/form-data
      produces:
        - application/json
      parameters:
        - name: appid
          in: query
          description: The unique application ID
          required: true
          type: string
          pattern: '^[a-z0-9A-Z]{32}$'
        - name: operation
          in: query
          description: |-
            The operation to perform (install, uninstall, or update)

            Valid operations: (installApplication, updateApplication, uninstallApplication, startApplication, restartApplication, stopApplication, updateAppConfig, deleteAppConfig)
          required: true
          type: string
          enum:
            - installApplication
            - updateApplication
            - uninstallApplication
            - startApplication
            - restartApplication
            - stopApplication
            - updateAppConfig
            - deleteAppConfig
        - name: schedule
          in: query
          description: The time in ticks
          required: false
          type: string
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
        - name: files
          in: formData
          description: The files to send
          required: false
          type: array
          items:
            type: string
            format: binary
        - name: infoMap
          in: formData
          description: |-
            The unique Edge Device ID, other info regarding config,resourses etc (use InfoMap object ).

            Valid combinations:
             - version config: {"configs":[{"configId":"configid","versionId":"versionid"}
             - pre-defined template-based config: e.g. deploying or changing a template configuration: {"configId":"configid","templateId":"templateId"}
             - template config: {"configId":"configid","templateId":"templateId",
             "editedTemplateText":"editedText"}
             - file-based configuration: {"configId":"configid","fileId":"unique id"}]} where fileId is the uploaded file name field
          required: true
          type: string
      responses:
        '200':
          description: successful operation
          schema:
            description: ''
            type: object
            properties:
              data:
                type: string
            required:
              - data
            example:
              data: a90a4e19afa5443c88746313a2c315b3
        '400':
          description: |-
            Invalid.data
            invalid.fileName
            appId.notnull
            deviceId.notnull
            operation.invalid
            file.size.exceeded
            invalid.config
            required.config
            time_invalid
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '401':
          description: |-
            auth.missingAuthToken
            auth_tokenExpired
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: |-
            auth.unauthorizedToken
            auth.accessDenied
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: |-
            notFound.user
            notFound.application
            notFound.Appconfig
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: |-
            something.wrong
            server.error
          schema:
            $ref: '#/definitions/ErrorResponseType'
  '/batches/{batchId}':
    get:
      tags:
        - batches
      summary: Get batch status using batchId
      description: 'This method get batch status using batchId. If it''s READY, means batch is complete and soon its jobs will get created; PROCESSED ,it means all its job are created..'
      operationId: get-batch-status
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: batchId
          in: path
          description: The unique batch ID
          required: true
          type: string
          pattern: '^[a-z0-9A-Z]{32}$'
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
      responses:
        '200':
          description: Successful operation
          schema:
            description: ''
            type: object
            properties:
              data:
                type: string
                enum:
                  - READY
                  - PROCESSED
            required:
              - data
        '400':
          description: invalid.id
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '401':
          description: |-
            auth.missingAuthToken
            auth_tokenExpired
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: auth.unauthorizedToken
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: |-
            notFound.user
            notFound.batch
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: |-
            something.wrong
            server.error
          schema:
            $ref: '#/definitions/ErrorResponseType'
  '/batches/{batchId}/jobs':
    get:
      tags:
        - batches
      summary: List of jobs using batchId
      description: This method get list of jobs using batchId.
      operationId: get-batch-jobs
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: batchId
          in: path
          description: The unique batch ID
          required: true
          type: string
          pattern: '^[a-z0-9A-Z]{32}$'
        - name: Authorization
          in: header
          description: The authentication token
          required: true
          type: string
      responses:
        '200':
          description: Successful operation
          schema:
            $ref: '#/definitions/ApplicationJob'
        '400':
          description: invalid.id
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '401':
          description: |-
            auth.missingAuthToken
            auth_tokenExpired
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '403':
          description: |-
            auth.unauthorizedToken
            auth.accessDenied
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '404':
          description: |-
            notFound.user
            notFound.job
            notFound.batch
          schema:
            $ref: '#/definitions/ErrorResponseType'
        '500':
          description: |-
            something.wrong
            server.error
          schema:
            $ref: '#/definitions/ErrorResponseType'
definitions:
  ApplicationJob:
    description: ''
    type: object
    properties:
      data:
        type: array
        items:
          required:
            - installedJobId
            - objectId
            - status
            - appId
            - operation
          properties:
            installedJobId:
              type: string
            objectId:
              type: string
            status:
              type: string
              enum:
                - PENDING
                - QUEUED
                - COMPLETED
                - FAILED
                - UNASSIGNED
                - UNINSTALLING
                - DELETING
                - SKIPPED
                - DELETED
                - EXECUTING
            appId:
              type: string
            appVersion:
              type: string
              description: appVersion is not set for published apps.
            operation:
              type: string
              enum:
                - installApplication
                - updateApplication
                - uninstallApplication
                - startApplication
                - restartApplication
                - stopApplication
                - updateAppConfig
                - deleteAppConfig
    required:
      - data
    example:
      data:
        - installedJobId: 152a2c9a6caa4c6a990e1cf3dd930584
          objectId: 06cdac6c607e447dad16eef9f767a56e
          status: COMPLETED
          appId: b98838937bb34487a20c77b8e8b6a9f8
          appVersion: ''
          operation: installApplication
  RetryResponse:
    description: ''
    type: object
    properties:
      data:
        type: object
        properties:
          job-id:
            type: string
        required:
          - job-id
    required:
      - data
  ErrorResponseType:
    description: ''
    type: object
    properties:
      errors:
        type: array
        uniqueItems: true
        minItems: 1
        items:
          required:
            - code
            - message
            - errorCode
            - field
            - logref
          properties:
            code:
              type: string
            message:
              type: string
            errorCode:
              type: number
            field:
              type: string
            logref:
              type: string
            parentLogref:
              type: string
            innerError:
              type: string
    required:
      - errors
    example:
      errors:
        - code: string
          message: string
          errorCode: number
          field: string
          logref: string
          parentLogref: string
  InputStream:
    type: object
  OctetStreamData:
    type: object
    properties:
      octetStream:
        $ref: '#/definitions/InputStream'
      uri:
        type: string
      mimeType:
        type: string
  ApplicationConfigurationTemplate:
    type: object
    properties:
      appConfigTemplateId:
        type: string
      refName:
        type: string
        maxLength: 50
      description:
        type: string
      filename:
        type: string
        maxLength: 50
      schemaType:
        type: string
        description: This value is optional and is only set if versioned configuration is used.
  ApplicationConfiguration:
    description: ''
    type: object
    properties:
      data:
        type: array
        uniqueItems: true
        minItems: 1
        items:
          required:
            - appConfigId
            - displayName
            - description
            - versioned
          properties:
            appConfigId:
              type: string
            displayName:
              type: string
              maxLength: 100
            description:
              type: string
            appConfigVersionLst:
              type: array
              items:
                $ref: '#/definitions/ApplicationConfigurationVersion'
            versioned:
              type: boolean
            templateVo:
              $ref: '#/definitions/ApplicationConfigurationTemplate'
    example:
      data:
        - appConfigId: string
          displayName: string
          description: string
          appConfigVersionLst:
            - appConfigVersionId: string
              refName: string
              description: string
              filename: string
          versioned: true
          templateVo:
            appConfigTemplateId: string
            refName: string
            description: string
            filename: string
            schemaType: string
  ApplicationConfigurationVersion:
    type: object
    properties:
      appConfigVersionId:
        type: string
      refName:
        type: string
        maxLength: 50
      description:
        type: string
      filename:
        type: string
        maxLength: 50
  CatalogApplication:
    description: ''
    type: object
    properties:
      data:
        type: array
        uniqueItems: true
        minItems: 1
        items:
          required:
            - applicationId
            - userId
            - icon
            - title
          properties:
            applicationId:
              type: string
            userId:
              type: string
            icon:
              type: string
            title:
              type: string
    required:
      - data
  AuthorizationsVO:
    description: ''
    type: object
    properties:
      data:
        type: object
        properties:
          userId:
            type: string
          applicationId:
            type: string
          groupPermissions:
            type: object
          role:
            type: string
          authenticationType:
            type: string
        required:
          - userId
          - applicationId
          - groupPermissions
          - role
          - authenticationType
    required:
      - data
    example:
      data:
        userId: a39a5a50f510432a8e3bd832d9ec3c39
        applicationId: 41ff73c9719a42bdb0348355114ceb82
        groupPermissions: {}
        role: Admin
        authenticationType: BEARER
  Login:
    type: object
    required:
      - username
      - password
    properties:
      username:
        type: string
        description: Associated user name for basic auth
      password:
        type: string
        description: Associated password for basic auth
    example:
      username: string
      password: string
  LoginResponse:
    type: object
    properties:
      data:
        type: object
        properties:
          access_token:
            type: string
            description: access token
          expires_in:
            type: integer
            format: int64
            description: Exipration time of the token
    example:
      data:
        access_token: string
        expires_in: 12036854776000
  DeviceApplication:
    description: ''
    type: object
    properties:
      data:
        type: array
        items:
          required:
            - applicationId
            - icon
            - title
            - deviceId
            - deviceName
            - verionId
            - versionNumber
            - status
          properties:
            applicationId:
              type: string
            icon:
              type: string
            title:
              type: string
            deviceId:
              type: string
            deviceName:
              type: string
            verionId:
              type: string
            versionNumber:
              type: string
            status:
              type: string
              description: If app is published to the catalog, the app will get the status LIVE.
              enum:
                - REVIEWED
                - LIVE
    required:
      - data
  DeviceExternalVO:
    description: 'If a device is created, default state is set to ACTIVE. This behavior will be fixed and the default state will be PENDING.'
    type: object
    properties:
      data:
        type: array
        items:
          required:
            - userId
            - deviceId
            - deviceName
            - deviceStatus
            - platformId
            - swPlatformId
            - createdDate
            - modifiedDate
            - softwarePlatformName
          properties:
            userId:
              type: string
            deviceId:
              type: string
            deviceName:
              type: string
            deviceStatus:
              type: string
              enum:
                - PENDING
                - ACTIVE
                - DELETED
            platformId:
              type: string
            swPlatformId:
              type: string
            createdDate:
              type: number
            modifiedDate:
              type: number
            softwarePlatformName:
              type: string
    required:
      - data
    example:
      data:
      - userId: 753674fed1824c1a86081711f77cc6e0
        deviceId: 8efd6f5029334011adb8702f7def0ef7
        deviceName: nursultan
        deviceStatus: ACTIVE
        platformId: 75f1547995a142dcb9a3032327e26c47
        swPlatformId: 5e4871fa86d8488fa19ae54e036ac515
        createdDate: 1632494254000
        modifiedDate: 1637323567000
        softwarePlatformName: DOCKER_COMPOSE
      pageNo: 1
      totalPages: 1
      pageSize: 10
      totalCount: 3
  DeviceVO:    
    description: ''
    type: object
    properties:
      data:
        type: object
        properties:
          userId:
            type: string
          deviceId:
            type: string
          deviceName:
            type: string
          deviceStatus:
            type: string
          platformId:
            type: string
          swPlatformId:
            type: string
          createdDate:
            type: number
          modifiedDate:
            type: number
          softwarePlatformName:
            type: string
        required:
          - userId
          - deviceId
          - deviceName
          - deviceStatus
          - platformId
          - swPlatformId
          - createdDate
          - modifiedDate
          - softwarePlatformName
    required:
      - data
    example:
      data:
        userId: a39a5a50f510432a8e3bd832d9ec3c39
        deviceId: 06cdac6c607e447dad16eef9f767a56e
        deviceName: mydevice
        deviceStatus: ACTIVE
        platformId: 422a4adf1f18402f9d1c0f353b7ce49d
        swPlatformId: 0a39d22813d84f2c89f86f205400a619
        createdDate: 1616657417000
        modifiedDate: 1617186046000
        softwarePlatformName: DOCKER_COMPOSE
  DeviceCreation:
    description: Device Creation object
    type: object
    properties:
      device:
        type: object
        properties:
          onboarding:
            type: object
            properties:
              localUserName:
                type: string
              localPassword:
                type: string
              deviceName:
                type: string
              deviceTypeId:
                type: string
            required:
              - localUserName
              - localPassword
              - deviceName
          Device:
            type: object
            properties:
              Network:
                type: object
                properties:
                  Interfaces:
                    type: array
                    items:
                      required:
                        - MacAddress
                        - GatewayInterface
                        - DHCP
                      properties:
                        MacAddress:
                          type: string
                        GatewayInterface:
                          type: boolean
                        DHCP:
                          type: string
                        Static:
                          type: object
                          properties:
                            IPv4:
                              type: string
                            NetMask:
                              type: string
                            Gateway:
                              type: string
                          required:
                            - IPv4
                            - NetMask
                            - Gateway
                        DNSConfig:
                          type: object
                          properties:
                            PrimaryDNS:
                              type: string
                            SecondaryDNS:
                              type: string
                          required:
                            - PrimaryDNS
                            - SecondaryDNS
                        L2Conf:
                          type: object
                          properties:
                            StartingAddressIPv4:
                              type: string
                            NetMask:
                              type: string
                            Range:
                              type: string
                        isL2NetworkDisable:
                          type: boolean
                        selectedL2Range:
                          type: object
                          properties:
                            id:
                              type: string
                            nameToString:
                              type: string
                required:
                  - Interfaces
              dockerIP:
                type: string
          ntpServer:
            type: array
            items:
              type: object
              properties:
                ntpServer:
                  type: string
          proxies:
            type: array
            items:
              type: object
              properties:
                host:
                  type: string
                protocol:
                  type: string
                user:
                  type: string
                password:
                  type: string
                noProxy:
                  type: string
                customPorts:
                  type: array
                  items:
                    type: integer
            required:
              - Network
              - ntpServer
        required:
          - onboarding
          - Device
    required:
      - device
    example:
      device:
        onboarding:
          localUserName: john.doe@company.com
          localPassword: securepassword
          deviceName: testdevice
        Device:
          Network:
            Interfaces:
              - MacAddress: 'ff:ff:ff:ff:ff:1f'
                GatewayInterface: true
                DHCP: enabled
                Static:
                  IPv4: ''
                  NetMask: ''
                  Gateway: ''
                DNSConfig:
                  PrimaryDNS: 8.8.8.8
                  SecondaryDNS: 8.8.8.9
                L2Conf:
                  StartingAddressIPv4: 192.168.178.0
                  NetMask: 255.255.255.0
                  Range: '2'
                isL2NetworkDisable: true
                selectedL2Range:
                  id: '2'
                  nameToString: '2'
          dockerIP: 172.17.0.0/16
        ntpServers:
          - ntpServer: 0.de.pool.ntp.org
            preferred: false
          - ntpServer: 1.de.pool.ntp.org
        proxies:
          - host: 'proxy.org:8081'
            protocol: http
            user: myproxyuser
            password: myproxypassword
  Statistics:
    description: ''
    type: object
    properties:
      data:
        type: object
    required:
      - data
    example:
      data:
        '1638187400000': '{"AppCount":{"ApplicationCount":0.0,"InstalledAppPercentage":0.0,"MaxInstalledApp":20.0,"MaxRunningApp":10.0,"RunningAppPercentage":0.0,"RunningApplicationsCount":0.0},"DeviceId":"06cdac6c607e447dad16eef9f767a56e","InternetStatus":{"serialVersionUID":0.0,"NetworkType":"RelayNR","RouterIP":"","RelayServerID":"192.168.178.122","RelayServerAddress":"192.168.178.122","CurrentConnectedIP":"","CurrentConnectedPort":"","currentConnectedKeystonePort":"","RelayServerUsername":"","RelayServerPassword":"","RelayServerPort":"","RURLAddress":"","isRelaySet":false,"hostName":"","isRURLSet":false,"LanIPAddresses":["192.168.178.123"],"ExternalIPaddress":["mydomain.192.168.178.122:9443","192.168.178.123"],"BoxID":"26e120f7ed994613a21cbc90065efac7","TomcatPort":"32501","RURLTomcatPort":"32501"},"OperationalQualities":{"maxInstalledAppCount":20.0,"maxRunningAppCount":10.0,"maxUsableRamUsage":8192.0,"maxUsableStorageArea":20480.0,"maxCPULoad":100.0},"StorageInfo":{"DataSpaceFree":"25.4 GB","DataSpacePercentage":"5.92%","DataSpaceTotal":"28.6 GB","DataSpaceUsed":"1.7 GB"},"SystemInfo":{"CPUInfo":"x86_64","CpuCores":"2","CpuPercentage":"0.00","GetUptime":"0 days, 0 hours, 0 minutes","KubeAppliance":"false","MemoryFree":"6.4 GB","MemoryPercentage":"4.84","MemoryTotal":"7.8 GB","MemoryUsed":"385.3 MB"},"devicesCount":0.0,"interface":[{"interfaceName":"ens33","macAddress":"00:0C:29:FF:EE:0D","iPAddress":"192.168.178.123","subNetMask":"255.255.255.0","status":"Enabled","gateway":"192.168.178.1","primaryDns":"192.168.178.1","secondaryDns":"8.8.8.8","hostName":"mydomain","domainName":"mydomain.192.168.178.122:9443","isDHCP":true,"isEnabled":true,"dockerIP":"172.17.0.0/16"}]}'
  DeviceCreated:
    description: ''
    type: object
    properties:
      Device:
        type: object
        properties:
          Network:
            type: object
            properties:
              Interfaces:
                type: array
                uniqueItems: true
                minItems: 1
                items:
                  required:
                    - GatewayInterface
                    - MacAddress
                    - DHCP
                  properties:
                    GatewayInterface:
                      type: boolean
                    MacAddress:
                      type: string
                    DHCP:
                      type: string
                    Static:
                      type: object
                      properties:
                        IPv4:
                          type: string
                        NetMask:
                          type: string
                        Gateway:
                          type: string
                      required:
                        - IPv4
                        - NetMask
                        - Gateway
                    DNSConfig:
                      type: object
                      properties:
                        PrimaryDNS:
                          type: string
                        SecondaryDNS:
                          type: string
                      required:
                        - PrimaryDNS
                        - SecondaryDNS
                    L2Conf:
                      type: object
                      properties:
                        StartingAddressIPv4:
                          type: string
                        NetMask:
                          type: string
                        Range:
                          type: string
                      required:
                        - StartingAddressIPv4
                        - NetMask
                        - Range
            required:
              - Interfaces
          ntpServer:
            type: array
            items:
              type: string
          dockerIP:
            type: string
        required:
          - Network
          - ntpServer
          - dockerIP
      onboarding:
        type: object
        properties:
          localUserName:
            type: string
          localPassword:
            type: string
          deviceName:
            type: string
          deviceId:
            type: string
          platformActualName:
            type: string
          softwarePlatformName:
            type: string
          potalUrl:
            type: string
          nodeId:
            type: string
          userId:
            type: string
          deviceType:
            type: string
          swPlatformId:
            type: string
          platformId:
            type: string
          isActivationConfirmed:
            type: boolean
          deviceRole:
            type: string
        required:
          - localUserName
          - localPassword
          - deviceName
          - deviceId
          - platformActualName
          - softwarePlatformName
          - potalUrl
          - nodeId
          - userId
          - deviceType
          - swPlatformId
          - platformId
          - isActivationConfirmed
          - deviceRole
      agents:
        type: array
        uniqueItems: true
        items:
          required:
            - name
            - agentId
          properties:
            name:
              type: string
            proxy:
              type: array
            agentId:
              type: string
            security:
              type: object
              properties:
                baseUrl:
                  type: string
                clientCredentialProfile:
                  type: array
                  items:
                    type: string
                ca_chain:
                  type: string
              required:
                - baseUrl
                - clientCredentialProfile
                - ca_chain
      proxies:
        type: array
        uniqueItems: true
        items:
          required:
            - proxyId
            - host
            - protocol
            - user
            - password
          properties:
            proxyId:
              type: string
            host:
              type: string
            protocol:
              type: string
            user:
              type: string
            password:
              type: string
    required:
      - Device
      - onboarding
      - agents
      - proxies
    example:
      Device:
        Network:
          Interfaces:
            - GatewayInterface: true
              MacAddress: 'ff:ff:ff:ff:ff:1f'
              DHCP: enabled
              Static:
                IPv4: ''
                NetMask: ''
                Gateway: ''
              DNSConfig:
                PrimaryDNS: 8.8.8.8
                SecondaryDNS: 8.8.8.9
              L2Conf:
                StartingAddressIPv4: 192.168.178.0
                NetMask: 255.255.255.0
                Range: '2'
        ntpServer:
          - 0.de.pool.ntp.org iburst
          - 1.de.pool.ntp.org iburst
        dockerIP: 172.17.0.0/16
      onboarding:
        localUserName: ''
        localPassword: ''
        deviceName: test12
        deviceId: 0f6a2ec70e4f45cf87b35013bd8975c1
        platformActualName: x86_64
        softwarePlatformName: dockercompose
        potalUrl: 'mydomain.org'
        nodeId: 865192524d70492d8b8d983ceb2863f9
        userId: a39a5a50f510432a8e3bd832d9ec3c39
        deviceType: DockerCompose
        swPlatformId: 0a39d22813d84f2c89f86f205400a619
        platformId: 422a4adf1f18402f9d1c0f353b7ce49d
        isActivationConfirmed: false
        deviceRole: NODE
      agents:
        - name: portal
          proxy:
            - 0d93f4b47ea7413390a10cdd4887062f
          agentId: a0fbbbb87cea4e0894595291a8334bb1
          security:
            baseUrl: 'mydomain.org'
            clientCredentialProfile:
              - jwt-token
            ca_chain: base64
        - name: registry
          proxy:
            - 0d93f4b47ea7413390a10cdd4887062f
          agentId: ad9eda4a39f0481489d92841bb2e72f9
          security:
            baseUrl: 'mydomain.org'
            clientCredentialProfile:
              - jwt-token
            ca_chain: base64
      proxies:
        - proxyId: 0d93f4b47ea7413390a10cdd4887062f
          host: 'proxy.org:8081'
          protocol: http
          user: myproxyuser
          password: ''
  DeviceLog:
    description: ''
    type: object
    properties:
      data:
        type: object
        properties:
          logs:
            type: array
            items:
              required:
                - timeStamp
                - logId
              properties:
                timeStamp:
                  type: number
                logId:
                  type: string
    required:
      - data
  ImportAppJobStatus:
    description: ''
    type: object
    properties:
      data:
        type: object
        properties:
          id:
            type: string
          status:
            type: string
          message:
            type: string
        required:
          - id
          - status
          - message
    required:
      - data
    example:
      data:
        id: 1142ec8c83914285aefae5095af25e85
        status: COMPLETED
        message: Application Imported Successfully.
  DeveloperApplication:
    description: ''
    type: object
    properties:
      data:
        type: object
        properties:
          developer-applications:
            type: array
            uniqueItems: true
            minItems: 1
            items:
              required:
                - id
                - userId
                - iconUrl
                - title
              properties:
                id:
                  type: string
                userId:
                  type: string
                iconUrl:
                  type: string
                title:
                  type: string
        required:
          - developer-applications
    required:
      - data
    example:
      data:
        developer-applications:
          - id: string
            userId: string
            iconUrl: string
            title: string
  Version:
    description: ''
    type: object
    properties:
      data:
        type: object
        properties:
          versions:
            type: array
            uniqueItems: true
            minItems: 1
            items:
              required:
                - id
                - number
                - status
              properties:
                id:
                  type: string
                number:
                  type: string
                status:
                  type: string
        required:
          - versions
    required:
      - data
