openapi: 3.0.3
info:
  title: Aladdin SDS
  version: '1.0'
paths:
  /:
    get:
      tags: []
      parameters: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerStats'
      deprecated: false
      security: []
  /devices:
    get:
      tags: []
      summary: List devices
      parameters: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDevicesResponse'
      deprecated: false
      security: []
  /devices/command/firmware-upgrade:
    post:
      tags: []
      summary: Send HID firmware update command
      description: Send firmware update HID command to the device without device id
      parameters: []
      requestBody:
        description: Firmware update payload for device command
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FirmwareUpdateRequest'
        required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
      deprecated: false
      security: []
  /devices/{device_id}:
    get:
      tags: []
      summary: Get device
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDeviceResponse'
      deprecated: false
      security: []
  /devices/{device_id}/command/beep:
    post:
      tags: []
      summary: Send beep command
      description: Send beep command to the device with id {device_id}
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      requestBody:
        description: >-
          Beep configuration (count and delay). If not provided, defaults (count
          = 1 and 500 ms delay) will be used.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BeepRequest'
            example: '{"count": 1, "delayMs": 500}'
        required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
      deprecated: false
      security: []
  /devices/{device_id}/command/custom:
    post:
      tags: []
      summary: Send host command
      description: Send generic host command to the device with id {device_id}
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      requestBody:
        description: Generic payload for device command
        content:
          text/plain:
            schema:
              type: string
        required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
      deprecated: false
      security: []
  /devices/{device_id}/command/custom-service:
    post:
      tags: []
      summary: Send service command
      description: Send generic service command to the device with id {device_id}
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      requestBody:
        description: Generic payload for device command
        content:
          text/plain:
            schema:
              type: string
        required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
      deprecated: false
      security: []
  /devices/{device_id}/command/firmware-upgrade:
    post:
      tags: []
      summary: Send firmware update command
      description: Send firmware update command to the device with device id
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      requestBody:
        description: Firmware update payload for device command
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FirmwareUpdateRequest'
        required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
      deprecated: false
      security: []
  /devices/{device_id}/command/host-command/disable:
    post:
      tags: []
      summary: Send disable host commands
      description: Send disable host commands to the device with id {device_id}
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
      deprecated: false
      security: []
  /devices/{device_id}/command/host-command/enable:
    post:
      tags: []
      summary: Send enable host commands
      description: Send enable host commands to the device with id {device_id}
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
      deprecated: false
      security: []
  /devices/{device_id}/command/logs:
    post:
      tags: []
      summary: Send command
      description: Send generic command to the device with id {device_id}
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
      deprecated: false
      security: []
  /devices/{device_id}/command/reset:
    post:
      tags: []
      summary: Send reset command
      description: Send reset command to the device with id {device_id}
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
      deprecated: false
      security: []
  /devices/{device_id}/command/scan-response:
    post:
      tags: []
      summary: Send response for devices with two way communication to the device
      description: >-
        Send response for devices with two way communication to the device with
        id {device_id}
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      requestBody:
        description: Generic payload for two way response
        content:
          text/plain:
            schema:
              type: string
        required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
      deprecated: false
      security: []
  /devices/{device_id}/command/scan-response-disable:
    post:
      tags: []
      summary: Disable response for devices with two way communication to the device
      description: >-
        Disable response for devices with two way communication to the device
        with id {device_id}
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
      deprecated: false
      security: []
  /devices/{device_id}/command/scan-response-enable:
    post:
      tags: []
      summary: Enable response for devices with two way communication to the device
      description: >-
        Enable response for devices with two way communication to the device
        with id {device_id}
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
      deprecated: false
      security: []
  /devices/{device_id}/command/scanner/disable:
    post:
      tags: []
      summary: Send disable scanner command
      description: Send disable scanner command to the device with id {device_id}
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
      deprecated: false
      security: []
  /devices/{device_id}/command/scanner/enable:
    post:
      tags: []
      summary: Send enable scanner command
      description: Send enable scanner command to the device with id {device_id}
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
      deprecated: false
      security: []
  /devices/{device_id}/config:
    get:
      tags: []
      summary: Get config
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
      deprecated: false
      security: []
    put:
      tags: []
      summary: Save Config
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      requestBody:
        content:
          text/plain:
            schema:
              type: string
        required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
      deprecated: false
      security: []
  /devices/{device_id}/execute-zip-package:
    post:
      tags: []
      summary: Execute zip package
      description: Execute zip package on the device with id {device_id}
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      requestBody:
        description: Zip package path
        content:
          text/plain:
            schema:
              type: string
        required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
      deprecated: false
      security: []
  /devices/{device_id}/health:
    get:
      tags: []
      summary: Get health
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IHSResponse'
      deprecated: false
      security: []
  /devices/{device_id}/info:
    get:
      tags: []
      summary: Get info
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IHSResponse'
      deprecated: false
      security: []
  /devices/{device_id}/stats:
    get:
      tags: []
      summary: Get stats
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IHSResponse'
      deprecated: false
      security: []
  /devices/{device_id}/upload/:
    put:
      tags: []
      summary: Upload Config File
      parameters:
        - name: device_id
          in: path
          description: Device ID
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      requestBody:
        content:
          text/plain:
            schema:
              type: string
        required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
      deprecated: false
      security: []
  /host/host-id:
    get:
      tags: []
      summary: Get host id
      description: >-
        Allows our clients to get host id, in case hostname doesn't work for
        them
      parameters: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HostIdResponse'
      deprecated: false
      security: []
    post:
      tags: []
      summary: Set host id
      description: >-
        Allows our clients to specify host id, in case hostname doesn't work for
        them
      parameters: []
      requestBody:
        description: Host id payload for set host id command
        content:
          text/plain:
            schema:
              type: string
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HostResponse'
      deprecated: false
      security: []
  /host/info:
    get:
      tags: []
      summary: Get info
      parameters: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HostResponse'
      deprecated: false
      security: []
components:
  schemas:
    DeviceDTO:
      type: object
      additionalProperties: false
      properties:
        connectionStrings:
          type: array
          items:
            type: string
        productName:
          type: string
        configId:
          type: string
        fwVersion:
          type: string
        id:
          type: string
        serialNumber:
          type: string
        children:
          type: array
          items:
            $ref: '#/components/schemas/DeviceDTO'
        model:
          type: string
        family:
          type: string
    MemoryUsage:
      type: object
      additionalProperties: false
      properties:
        percUsage:
          type: number
          format: double
        usedMemory:
          type: number
          format: double
        freeMemory:
          type: number
          format: double
        totalMemory:
          type: number
          format: double
        maxMemory:
          type: number
          format: double
      required:
        - percUsage
        - usedMemory
        - freeMemory
        - totalMemory
        - maxMemory
    ServerStats:
      type: object
      additionalProperties: false
      properties:
        apiVersion:
          type: string
        version:
          type: string
        memoryUsage:
          $ref: '#/components/schemas/MemoryUsage'
      required:
        - apiVersion
        - version
        - memoryUsage
    BeepRequest:
      type: object
      additionalProperties: false
      properties:
        count:
          type: integer
          format: int32
        delayMs:
          type: integer
          format: int32
      required:
        - count
        - delayMs
    FirmwareUpdateRequest:
      type: object
      additionalProperties: false
      properties:
        uri:
          type: string
          example: file:///C:/path/to/firmware.dfw
        uriMacro:
          type: string
          example: file:///C:/path/to/macro.xml
        commandId:
          type: string
          nullable: true
          example: 'null'
      required:
        - uri
        - uriMacro
    DeviceCommandResponse:
      type: object
      additionalProperties: false
      properties:
        message:
          type: string
          nullable: true
        apiVersion:
          type: string
        code:
          type: integer
          format: int32
        commandId:
          type: string
          nullable: true
        content:
          type: string
          nullable: true
      required:
        - apiVersion
        - code
    GetDeviceResponse:
      type: object
      additionalProperties: false
      properties:
        message:
          type: string
          nullable: true
        apiVersion:
          type: string
        content:
          $ref: '#/components/schemas/DeviceDTO'
      required:
        - apiVersion
        - content
    GetDevicesResponse:
      type: object
      additionalProperties: false
      properties:
        message:
          type: string
          nullable: true
        apiVersion:
          type: string
        content:
          type: array
          items:
            $ref: '#/components/schemas/DeviceDTO'
      required:
        - apiVersion
        - content
    HostIdResponse:
      type: object
      additionalProperties: false
      properties:
        message:
          type: string
          nullable: true
        apiVersion:
          type: string
        hostId:
          type: string
      required:
        - apiVersion
        - hostId
    HostResponse:
      type: object
      additionalProperties: false
      properties:
        message:
          type: string
          nullable: true
        apiVersion:
          type: string
        content:
          type: object
          additionalProperties:
            type: object
          example:
            aa: '2022-08-14T21:13:03.546Z'
            bb: '2022-08-14T21:13:03.546Z'
      required:
        - apiVersion
        - content
    IHSResponse:
      type: object
      additionalProperties: false
      properties:
        message:
          type: string
          nullable: true
        apiVersion:
          type: string
        content:
          type: object
          additionalProperties:
            type: object
          example:
            aa: '2022-08-14T21:13:03.546Z'
            bb: '2022-08-14T21:13:03.546Z'
      required:
        - apiVersion
        - content
  securitySchemes:
    None:
      scheme: basic
      type: http
servers:
  - url: http://{host}:{port}/
    description: SDS Server
    variables:
      port:
        default: '9000'
        description: Server port
      host:
        default: localhost
        description: Server host
security: []
