---
openapi: 3.0.0
info:
  version: v1.0.0
  title: Flow Creator Configurator Public APIs
  license:
    name: 'Industrial Edge © 2023, Siemens AG. All rights reserved.'
servers: [
    {
            "url": "https://iem_ip:9443/flow-creator/api/v1",
            "description": 'API v1 URL using IEM IP'
    },
    {
            "url": "https://iem_ip/flow-creator/api/v1",
            "description": 'API v1 URL using IEM IP without port'
    },
    {
            "url": "https://dns_name/flow-creator/api/v1",
            "description": 'API v1 URL using IEM DNS' 
    },
]
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  schemas:
    DeployData:
      type: object
      properties:
        flows:
          type: object
          properties:
            flows.json:
              type: object
              properties:
                devices:
                  type: array
                  items:
                    type: object
                    properties:
                      username:
                        type: string
                        description: Username of the user
                        example: edge@siemens.com
                      password:
                        type: string
                        description: Password of the user
                        example: Edge@123
                      deviceId:
                        type: string
                        description: Unique ID of the selected device
                        example: 2e7030ab5b5d427abd23d3c3aa6cb8a7
                      deviceName:
                        type: string
                        description: Name of the selected device
                        example: edgeCore1
        files:
          type: object
          properties:
            file123.txt:
              type: object
              properties:
                devices:
                  type: array
                  items: 
                    type: object
                    properties:
                      username:
                        type: string
                        description: Username of the user
                        example: edge@siemens.com
                      password:
                        type: string
                        description: Password of the user
                        example: Edge@345
                      deviceId:
                        type: string
                        description: Unique ID of the selected device
                        example: f3180b07d0134156b033a23b3d67c4b6
                      deviceName:
                        type: string
                        description: Name of the selected device
                        example: edgeCore2
        nodes:
          type: object
          properties:
            nodeNames:
              type: array
              items:
                type: string
              example: 
              - node-red-contrib-email
            devices:
              type: array
              items: 
                type: object
                properties:
                  username:
                    type: string
                    description: Username of the user
                    example: edge@siemens.com
                  password:
                    type: string
                    description: Password of the user
                    example: Edge@345
                  deviceId:
                    type: string
                    description: Unique ID of the selected device
                    example: f3180b07d0134156b033a23b3d67c4b6
                  deviceName:
                    type: string
                    description: Name of the selected device
                    example: edgeCore2
    
    PostConfig:
      type: object
      properties:
        flow:
          type: object
          properties:
            filename:
              type: string
              example: flow.json
            devices:
              type: array
              items:
                type: object
                properties:
                  username:
                    type: string
                    description: Username of the user
                    example: edge@siemens.com
                  password:
                    type: string
                    description: Password of the user
                    example: Edge@345
                  deviceId:
                    type: string
                    description: Unique ID of the selected device
                    example: f3180b07d0134156b033a23b3d67c4b6
                  deviceName:
                    type: string
                    description: Name of the selected device
                    example: edgeCore2
        file:
          type: object
          properties:
            filename:
              type: string
              example: text.txt
            devices:
              type: array
              items:
                type: object
                properties:
                  username:
                    type: string
                    description: Username of the user
                    example: edge@siemens.com
                  password:
                    type: string
                    description: Password of the user
                    example: Edge@345
                  deviceId:
                    type: string
                    description: Unique ID of the selected device
                    example: f3180b07d0134156b033a23b3d67c4b6
                  deviceName:
                    type: string
                    description: Name of the selected device
                    example: edgeCore2
        node:
          type: object
          properties:
            nodeNames:
              type: array
              items:
                type: string
              example: 
              - node-red-contrib-email
            devices:
              type: array
              items: 
                type: object
                properties:
                  username:
                    type: string
                    description: Username of the user
                    example: edge@siemens.com
                  password:
                    type: string
                    description: Password of the user
                    example: Edge@345
                  deviceId:
                    type: string
                    description: Unique ID of the selected device
                    example: f3180b07d0134156b033a23b3d67c4b6
                  deviceName:
                    type: string
                    description: Name of the selected device
                    example: edgeCore2  
    DeviceList:
      type: object
      required:
      - data
      properties:
        data:
          type: array
          description: An array with each element having details of device and its
            configs for Flow Creator
          items:
            type: object
            required:
            - appId
            properties:
              appId:
                type: string
                description: Unique Id for the application installed on device
                example: 6cf3a12d668a4242aff12cfd8e2aa95f
    JobStatus:
      type: object
      required:
      - jobStatus
      properties:
        jobStatus:
          type: string
          enum:
          - PROCESSING
          - FAILED
          - COMPLETED
          - NO JOBS
          description: Status of a deployed job
          example: PROCESSING
    DeviceListPagination:
      type: array
      items:
        type: object
        properties:
          userId:
            type: string
            example: 709cf1c4dde24263ae3bbfc65f30253c
          deviceId:
            type: string
            example: d96b6d5131364d05a26383ab3ade7fc3
          deviceName:
            type: string
            example: iedname
          deviceStatus:
            type: string
            example: ACTIVE
          platformId:
            type: string
            example: de776db50f5042fc8d0f026f935bfa39
          swPlatformId:
            type: string
            example: bca94c20a4804380808d75af4974a629
          createdDate:
            type: integer
            example: 1666785248000
          modifiedDate:
            type: integer
            example: 1670391466000
          isRelaySet:
            type: boolean
            example: false
          isVisibleOnListingServer:
            type: boolean
            example: true
          labelId:
            type: integer
            example: 0
          isActivationConfirmed:
            type: boolean
            example: true
          nodes:
            type: array
            items:
              type: object
              properties:
                nodeId:
                  type: string
                  example: ddf72af3f0634559a1ee38de91f7292c
                deviceName:
                  type: string
                  example: iedname
                macAddress:
                  type: string
                  example: 10a30da9-6f36-4bd1-9c16-690b9096533e
                email:
                  type: string
                  example: user123@gmail.com
                deviceRole:
                  type: string
                  example: NODE
                deviceState:
                  type: string
                  example: ACTIVE
                deviceId:
                  type: string
                  example: d96b6d5131364d05a26383ab3ade7fc3
                createdDate:
                  type: integer
                  example: 1666785248000
                modifiedDate:
                  type: integer
                  example: 1670391542000
                discoveryDetailsVO:
                  type: object
                  properties:
                    sMasterID: 
                      type: string
                      example: ddf72af3f0634559a1ee38de91f7292c
                    sIPAddress:
                      type: string
                      example: iedname.192.168.30.127:9443,192.168.30.128
                    sLocalIPAddress:
                      type: string
                      example: 192.168.30.128, 192.168.147.128
                    sTomcatPort:
                      type: string
                    sPort1:
                      type: string
                    sPort2:
                      type: string
                      example: {\"iertVersion\":\"1.9.0-5\",\"productVersion\":\"ied-os-1.9.0-22-amd64-develop\"}
                    sPort3: 
                      type: string
                    sPort4:
                      type: string
                    sPort5:
                      type: string
                      example: ied-os-1.9.0-22-amd64-develop
                    sRURLTomcatPort:
                      type: string
                    sRAddress:
                      type: string
                    nStatus:
                      type: integer
                      example: 1
                    sRelayServerID:
                      type: string
                    sConnectURL:
                      type: string
                    sRelayServerAddress:
                      type: string
                    sRUserName:
                      type: string
                    sRPassword:
                      type: string
                    sHostKey:
                      type: string
                    nRPort:
                      type: integer
                      example: 0
                    dHBRdate:
                      type: integer
                      example: 1670396825000
                    deviceId:
                      type: string
                      example: ddf72af3f0634559a1ee38de91f7292c
                    tunnelStatus:
                      type: boolean
                      example: false
                version:
                  type: string
                  example: ied-os-1.9.0-22-amd64-develop
                timeDiff:
                  type: integer
                  example: 23256    
          capabilities:
            type: array
            items:
              type: object
              properties:
                capabilityID:
                  type: string
                  example: host.certificates
                scope:
                  type: string
                  example: protected
                name:
                  type: string
                  example: Manage certificates of host reverse proxy
                property:
                  type: string
                  example: mandatory
                description:
                  type: string
                details:
                  type: object
                  properties:
                    allowExternal:
                      type: boolean
                      example: true
                    certFilePath:
                      type: string
                    keyFilePath:
                      type: string
                    renewPolicy:
                      type: string
                      example: autoRenew
                           
        # data:
        #   type: array
        #   items:
        #     type: object
        #     properties:
        #       nodes:
        #         type: array
        #         items:
        #           type: object
        #           properties:
        #             discoveryDetailsVO:
        #               type: object
        #             version:
        #               type: string
        #       capabilites:
        #         type: array
        #         items:
        #           type: object
        #           properties:
        #             details:
        #               type: object
    FlowUpload:
      type: object
      required:
      - config
      properties:
        config:
          type: object
          description: Config for the given files of flows
          example: "[{\"id\":\"0b7e3913c7857d1f\",\"type\":\"subflow\",\"name\":\"Subflow 2\",\"info\":\"\",\"in\":[{\"x\":40,\"y\":80,\"wires\":[{\"id\":\"0bce04851394ed1b\"}]}],\"out\":[{\"x\":520,\"y\":80,\"wires\":[{\"id\":\"b92875182f9ffb84\",\"port\":0}]}]},{\"id\":\"0bce04851394ed1b\",\"type\":\"http request\",\"z\":\"0b7e3913c7857d1f\",\"name\":\"\",\"method\":\"GET\",\"ret\":\"txt\",\"paytoqs\":\"ignore\",\"url\":\"https://google.com\",\"tls\":\"\",\"persist\":false,\"proxy\":\"\",\"insecureHTTPParser\":false,\"authType\":\"\",\"senderr\":false,\"headers\":[],\"x\":190,\"y\":80,\"wires\":[[\"b92875182f9ffb84\"]]},{\"id\":\"b92875182f9ffb84\",\"type\":\"delay\",\"z\":\"0b7e3913c7857d1f\",\"name\":\"\",\"pauseType\":\"delay\",\"timeout\":\"5\",\"timeoutUnits\":\"seconds\",\"rate\":\"1\",\"nbRateUnits\":\"1\",\"rateUnits\":\"second\",\"randomFirst\":\"1\",\"randomLast\":\"5\",\"randomUnits\":\"seconds\",\"drop\":false,\"allowrate\":false,\"outputs\":1,\"x\":380,\"y\":80,\"wires\":[[]]},{\"id\":\"aa46ca3ad50dfbd1\",\"type\":\"tab\",\"label\":\"Flow 1\",\"disabled\":false,\"info\":\"\",\"env\":[]},{\"id\":\"b6b9e7fd0471351b\",\"type\":\"inject\",\"z\":\"aa46ca3ad50dfbd1\",\"name\":\"\",\"props\":[{\"p\":\"payload\"},{\"p\":\"topic\",\"vt\":\"str\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"topic\":\"\",\"payload\":\"\",\"payloadType\":\"date\",\"x\":180,\"y\":160,\"wires\":[[\"26c328ec16cd8822\"]]},{\"id\":\"8edd5680d691ccae\",\"type\":\"debug\",\"z\":\"aa46ca3ad50dfbd1\",\"name\":\"debug 1\",\"active\":true,\"tosidebar\":true,\"console\":false,\"tostatus\":false,\"complete\":\"false\",\"statusVal\":\"\",\"statusType\":\"auto\",\"x\":780,\"y\":160,\"wires\":[]},{\"id\":\"26c328ec16cd8822\",\"type\":\"subflow:0b7e3913c7857d1f\",\"z\":\"aa46ca3ad50dfbd1\",\"x\":480,\"y\":160,\"wires\":[[\"8edd5680d691ccae\"]]}]"

    EncryptedPassword:
      type: object
      required:
      - password
      properties:
        password:
          type: string
          description: Encrypt password for IEMUI
          example: "Iempass@123"
    Error:
      type: object
      required:
      - timestamp
      - status
      - error
      - message
      properties:
        timestamp:
          type: string
          format: date-time
          description: Timespamp in UTC at which point the error has occured
        status:
          type: integer
          format: number
          description: Status Code
        message:
          type: string
          description: Error message in US english
    ErrorExtended:
      allOf:
      - "$ref": "#/components/schemas/Error"
      type: object
      properties:
        error:
          type: string
          description: Error from within application
        code:
          type: string
          description: Error Code from within application
    UserStatus:
      type: object
      required:
      - lastActiveTime
      properties:
        lastActiveTime:
          type: string
          format: date-time
          description: DateTime in UTC
          example: '2021-02-18T13:38:44.640Z'
    NodeUpload:
      type: object
      properties:
        file:
          type: string
        description: The file to upload

  responses:
    SuccessfulOperation:
      description: Successful operation
      content:
        application/json:
          schema:
            type: object
            required:
            - status
            properties:
              status:
                type: string
                description: Status response
          example:
            status: OK
    EncryptedPasswordResponse:
      description: Password Encryption
      content:
        application/json:
          schema:
            type: object
            required:
            - encryptedPassword
            properties:
              encryptedPassword:
                type: string
                description: Encrypted password
                example: wbm1F/pkg5DFoulJtRUt29XbqYst9DrtXPg=
    ConnectionStatus:
      description: Successful operation to fetch events. To verify the deployment status of the flow, file, and node configurations, please refer to the description & status keys of the respective flow, file, and node objects in the response.
      content:
        application/json:
          schema:
            type: string
            example: "{\"auth-service-generic-error\":{\"status\":\"SUCCESS\",\"description\":\"Login successful\"},\"flow\":{\"exmaple_inject_debug_node_flow.json\":{\"description\":\"Flow push success\",\"status\":\"SUCCESS\",\"timestamp\":\"191919-10-197T08:197:98.969\"}},\"file\":{\"test.txt\":{\"description\":\"File push success\",\"status\":\"SUCCESS\",\"timestamp\":\"191919-10-197T08:196:98.969\"}},\"node\":null,\"watcher-service-generic-error\":{\"description\":\"No certificate recived from IED. Please restart your app.\",\"status\":\"FAILURE\"}}"
    DataConverterResponse:
      content:
        application/json:
          schema:
            type: object
            properties:
              type:
                type: string
                example: "Buffer"
              data:
                type: "array"
                items:
                  type: "string"
                  example: "72"
    GetBuiltInNodeResponse:
      content:
        application/json:
          schema:
            type:  object
            properties:
              modules:
                type: array
                items: 
                  type: object
                  properties:
                    id:
                      type: string
                    version:
                      type: string
                    description:
                      type: string
                    updated_at:
                      type: string
                    types:
                      type: array
                      items:
                        type: string
                    keywords:
                      type: array
                      items:
                        type: string
                    url:
                      type: string
                example:
                  - id: node-red-contrib-email
                    version: 1.17.1
                    description: SMTP email node for Node-RED
                    updated_at: 2023-05-03T12:24:25.238Z
                    types: ["email-transport", "email-send"]
                    keywords: ["node-red", "node", "SMTP", "email"]
                    url: https://flows.nodered.org/node/node-red-contrib-email
                  - id: node-red-contrib-mindconnect
                    version: 3.12.1
                    description: node red mindconnect node using mindconnect-nodejs library.
                    updated_at: 2022-05-10T16:16:36.689Z
                    types: ["mindconnect"]
                    keywords: ["MindSphere", "MindConnect", "node-red"]
                    url: https://flows.nodered.org/node/@mindconnect/node-red-contrib-mindconnect
                  - id: node-red-contrib-s7comm
                    version: 1.1.6
                    description: A Node-RED node to communicate with Siemens S7 PLCs.
                    updated_at: 2018-10-01T13:41:36.765Z
                    types: ["s7comm read","s7comm write","s7comm"]
                    keywords: ["node-red","SIMATIC","PLC","Siemens","S7","S7comm","RFC1006","iso-on-tcp"]
                    url: https://flows.nodered.org/node/node-red-contrib-s7comm
                  - id: node-red-contrib-opcua
                    version: 0.2.323
                    description: A Node-RED node to communicate via OPC UA based on node-opcua library.
                    updated_at: 2023-05-02T17:50:25.173Z
                    types: ["OpcUa-Item","OpcUa-Client","OpcUa-Browser","OpcUa-Server","OpcUa-Endpoint","OpcUa-Event","OpcUa-Method","OpcUa-Rights","OpcUa-Discovery"]
                    keywords: ["node-red","OPC UA","opc-ua","unified automation","opc foundation","node-opcua"]
                    url: https://flows.nodered.org/node/node-red-contrib-opcua
                  - id: node-red-dashboard
                    version: 3.2.0
                    description: A set of dashboard nodes for Node-RED
                    updated_at: 2023-03-09T15:34:51.491Z
                    types: ["ui_base","ui_button","ui_dropdown","ui_switch", "ui_slider","ui_numeric","ui_text_input","ui_date_picker","ui_colour_picker","ui_form","ui_text","ui_gauge","ui_chart","ui_audio","ui_toast", "ui_ui_control","ui_template","ui_link","ui_tab","ui_group","ui_spacer"]
                    keywords: ["node-red"]
                    url: https://flows.nodered.org/node/node-red-dashboard
                  - id: node-red-contrib-modbus
                    version: 5.27.2
                    description: The all in one Modbus TCP and Serial contribution package for Node-RED.
                    updated_at: 2023-04-10T06:39:10.891Z
                    types:  ["modbus-client","modbus-response","modbus-read",	"modbus-getter", "modbus-flex-getter","modbus-write","modbus-flex-write","modbus-server","modbus-flex-server",	"modbus-queue-info","modbus-flex-connector","modbus-io-config","modbus-response-filter","modbus-flex-sequencer"]
                    keywords: ["node-red","plusfornodered","modbus","automation","biancoroyal"]
                    url: https://flows.nodered.org/node/node-red-contrib-modbus
                  - id: node-red-contrib-livetwin-node
                    version: 2.3.0
                    description: LiveTwin node for all Models
                    updated_at: ""
                    types:  ["LiveTwin-Control","LiveTwin"]
                    keywords: ["node-red"]
                    url: https://support.industry.siemens.com/cs/document/109780275/
    GetConfigResponse:
      content:
        application/json:
          schema:
            type: object
            properties:
              flow:
                type: object
                properties:
                  filename:
                    type: string
                    example: flows.json
                  devices:
                    type: array
                    items: 
                      type: object
                      properties:
                        deviceId:
                          type: string
                          example: f13a07451d44419fabb30a93c2c8b32d
                        deviceName:
                          type: string
                          example: ied-plc-device
                        username:
                          type: string
                          example: IEUser
                        password:
                          type: string
                          example: IEPass@123
              file:
                type: object
                properties: 
                  filename: 
                    type: string
                    example: file123.txt
                  devices:
                    type: array
                    items: 
                      type: object
                      properties:
                        deviceId:
                          type: string
                          example: f13a07451d44419fabb30a93c2c8b32d
                        deviceName:
                          type: string
                          example: ied-plc-device
                        username:
                          type: string
                          example: IEUser
                        password:
                          type: string
                          example: IEPass@123
              node:
                type: object
                properties:
                  nodeNames:
                    type: array
                    items:
                      type: string
                    example: 
                    - node-red-contrib-email
                  devices:
                    type: array
                    items: 
                      type: object
                      properties:
                        username:
                          type: string
                          description: Username of the user
                          example: edge@siemens.com
                        password:
                          type: string
                          description: Password of the user
                          example: Edge@345
                        deviceId:
                          type: string
                          description: Unique ID of the selected device
                          example: f3180b07d0134156b033a23b3d67c4b6
                        deviceName:
                          type: string
                          description: Name of the selected device
                          example: edgeCore2  
    TokenNotFoundUnAuthorizedError:
      description: Authorization token is empty or not found in header
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 401
            error: unauthorized
            code: auth.notFoundToken
            message: An Error msg
    TokenUnAuthorizedError:
      description: Authorization token does not have suitable permissions
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 403
            error: forbidden
            code: auth.unauthorizedToken
            message: An Error msg
    AppNotFoundError:
      description: 'App not found/installed in the device or deviceId is not found or model is not found<br>Possible Error Codes: app.notinstalled, deviceId.notFound, model.notFound'
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 404
            error: notFound
            code: app.notinstalled
            message: An Error msg
    FileNotFoundError:
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 404
            error: notFound
            code: file.notFound
            message: Cannot delete,Please try again
    FlowNotFoundError:
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 404
            error: notFound
            code: flow.notFound
            message: Cannot delete,Please try again
    MethodNotAllowedError:
      description: Unsupported HTTP method used
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 405
            error: methodNotAllowed
            code: notAllowed.method
            message: An Error msg
    FileOperationAndTokenValidatorInternalServerError:
      description: 'Internal server errors: Portal url undefined, portal response
        error, File Write error from the server<br>Possible Error Codes:
        write.error, portalReq.errorResponse, portalurl.undefined'
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 500
            error: internalServerError
            code: write.error
            message: An Error msg
    ConnectionStatesInternalServerError:
      description: 'Internal server error: Portal url undefined, portal response errors
        <br>Possible Error Codes: portalReq.errorResponse, portalurl.undefined, getconnectionstatus.portalReq.errorResponse,
        getdevappId.PortalReq.errorResponse, deviceapplicationID.error'
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 500
            error: internalServerError
            code: write.error
            message: An Error msg
    TokenValidatorInternalServerError:
      description: 'Internal server errors: Portal url undefined, portal response
        error<br> Possible Error Codes: portalReq.errorResponse, portalurl.undefined'
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 500
            error: internalServerError
            code: portalReq.errorResponse
    IEMCertificatesNotFoundError:
      description: IEM Certificates could not be found/read by the server
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 503
            error: serviceUnavailable
            code: certificate.notfound
            message: An Error msg
    AppNotSupportedError:
      description: Application is not supported by the API
      content:
        application/json:
          schema:
            "$ref": '#/components/schemas/ErrorExtended'
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 400
            error: BadRequest
            code: appNotSupported
            message: This API is not supported for this Application Supported Applications are Industrial Edge Flow Creator Configurator
    InvalidFileSize:
      description: File is greater then 2 MB, Maximum supported file upload limit is 2 MB
      content:
        application/json:
          schema:
            "$ref": '#/components/schemas/ErrorExtended'
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 400
            error: payloadTooLarge
            code: invalid.file
            message: File is greater then 2 MB, Maximum supported file upload limit is 2 MB
    FileNotUploadedError:
      description: No file uploaded
      content:
        application/json:
          schema:
            "$ref": '#/components/schemas/ErrorExtended'
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 400
            error: notFound
            code: file.notUploaded
            message: No file uploaded
    InvalidFileExtension:
      description: Invalid file format. Only txt, xlsx, zip, tar, json, csv, tgz files are allowed
      content:
        application/json:
          schema:
            "$ref": '#/components/schemas/ErrorExtended'
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 400
            error: invalidRequestBody
            code: invalid.file
            message: Invalid file format. Only txt, xlsx, zip, tar, json, csv, tgz files are allowed
    InvalidNodeFileExtension:
      description: Invalid file format. Only .tgz files are allowed
      content:
        application/json:
          schema:
            "$ref": '#/components/schemas/ErrorExtended'
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 400
            error: invalidRequestBody
            code: invalid.file
            message: Invalid file format. Only .tgz files are allowed
    PasswordInvalidError:
      description: Invalid request body. Password key or value is not valid
      content:
        application/json:
          schema:
            "$ref": '#/components/schemas/ErrorExtended'
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 400
            error: requestBodyNotAllowed
            code: invalid.requestBody
            message: Invalid request body. Password key or value is not valid
    InvalidFileName:
      description: File name for uploaded file is not same as file name in params
      content:
        application/json:
          schema:
            "$ref": '#/components/schemas/ErrorExtended'
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 400
            error: invalidFileName
            code: invalid.filename
            message: File name for uploaded file is not same as file name in params
    InvalidFlowSize:
      description: File is greater then 2 MB, Maximum supported file upload limit is 2 MB
      content:
        application/json:
          schema:
            "$ref": '#/components/schemas/ErrorExtended'
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 400
            error: payloadTooLarge
            code: invalid.file
            message: File is greater then 2 MB, Maximum supported file upload limit is 2 MB
    ConfigNotFoundErrororInvalidRequest:
      description: The request body is empty or missing the "config" key
      content:
        application/json:
          schema:
            "$ref": '#/components/schemas/ErrorExtended'
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 400
            error: emptyBodyOrConfigKeyNotFound
            code: configKeyOrBody.notfound
            message: The request body is empty or missing the "config" key      
    InvalidAppIdError:
      description: Application ID is invalid
      content:
        application/json:
          schema:
            "$ref": '#/components/schemas/ErrorExtended'
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 400
            error: BadRequest
            code: invalidAppId
            message: The provided AppId is invalid
    InvalidDeviceDetailsError:
      description: Invalid request body. devices property in flows object must be an array.
    InvalidReqBodyError:
      description: Invalid request body.Expected keys are flows,files or nodes.
    InvalidFileFormatError:
      description: Invalid file format. Only txt, xlsx, zip, tar, json, csv, tgz files are allowed.
    InvalidNodesDataError:
      description: Invalid request body. nodes object must have exactly two keys, nodeNames and devices.
    InvalidNodeNamesArrayError:
      description: Invalid request body. nodeNames value must be an array of non-empty strings.
    DeployNotFoundError:
      description: 'DeviceId not found, empty target device list<br>Possible Error
        Codes: flow.notFound, deviceId.notFound'
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 404
            error: notFound
            code: flow.notFound
            message: flows.json not found.Please re-upload the flow
    DeployInternalServerError:
      description: 'Internal server errors: Portal url undefined, portal response
        error, File Read errors from the server, create job errors<br>Possible
        Error Codes: portalReq.errorResponse, portalurl.undefined, read.error'
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 500
            error: errorResponseFromPortal
            code: createpartialbatchID.error
            message: Error in submitJob, Cannot Create partialBatchID. Please try again.
    GetConfigInternalServerError:
      description: 'Internal server errors: Portal url undefined, portal response
        error, File Read errors from the server, <br>Possible
        Error Codes: portalReq.errorResponse, portalurl.undefined, read.error'
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 500
            error: errorResponseFromPortal
            code: createpartialbatchID.error
            message: Error in submitJob, Cannot Create partialBatchID. Please try again.
    PostConfigInternalServerError:
      description: 'Internal server errors: Portal url undefined, portal response
        error, File Write errors from the server, <br>Possible
        Error Codes: portalReq.errorResponse, portalurl.undefined, write.error'
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 500
            error: errorResponseFromPortal
            code: createpartialbatchID.error
            message: Error in submitJob, Cannot Create partialBatchID. Please try again.
    BatchIdInvalidError:
      description: BatchId is generated for zero or more than one device, only one
        device has to be selected
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 400
            error: invalidRequestBodyProperty
            code: operation.invalid
            message: An Error msg
    AppOrConfigNotFoundError:
      description: 'App is not installed/found in the device or default configs not
        found with the app<br>Possible Error Codes: app.notinstalled, configfile.notfound'
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 404
            error: wrongOrNoConfigurationFile
            code: configfile.notfound
            message: An Error msg
    AppNotSuportedBySubscriber:
      description: Subscriber Client Type is not supported by the API
      content:
        application/json:
          schema:
            "$ref": '#/components/schemas/ErrorExtended'
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 400
            error: BadRequest
            code: appNotSuportedBySubscriber
            message: The Subscriber Client is supported only by Industrial Edge Cloud Connector.
    ConflictError:
      description: Another User or instance of same user configuring the device
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 409
            error: requestConflicts
            code: conflict.clientActive
            message: An Error msg
    FetchInternalServerError:
      description: 'Internal Server Error<br>Possible Error Codes: portalReq.errorResponse,
        portalurl.undefined, empty.dataValues, userDetails.getError, settingdefaultValue.error,
        schemawriteFailure.invalid, filefetch.error, fileparse.error'
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 500
            error: internalServerError
            code: portalReq.errorResponse
            message: An Error msg
    JobStatusInternalServerError:
      description: 'Internal server errors: Portal url undefined, portal response
        error, File Read Write errors from the server, track job errors<br>Possible
        Error Codes: portalReq.errorResponse, portalurl.undefined, read.error, write.error,
        Jobstatustrackfailed.error'
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 500
            error: failedRequestsToPortal
            code: jobstatustrackfailed.error
            message: An Error msg
    DeviceIdNotFoundError:
      description: 'DeviceId not found<br>Possible Error Codes: deviceId.notFound'
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 404
            error: notFound
            code: deviceId.notFound
            message: An Error msg
    GetDevicesInternalServerError:
      description: 'Internal server errors: Portal url undefined, portal response
        error,<br>Possible Error Codes: portalReq.errorResponse,
        portalurl.undefined'
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ErrorExtended"
          example:
            timestamp: '2021-02-22T06:08:49.999Z'
            status: 500
            error: internalServerError
            code: operationFailed.getDeviceList
            message: An Error msg
security:
- bearerAuth: []
paths:
  "/provision":
    post:
      operationId: provision
      tags:
      - provision
      summary: Initializes a selected Flow Creator app on a IE device for configuration
      description: Initializes the configurator API server and processes the existing configurations for the device and app.This should be first API call to be made.
      parameters:
      - in: header
        name: Authorization
        schema:
          type: string
        required: true
        description: The authentication token
        example: 4c0b6cc23825cd7433f68e29143cd80a
      requestBody:
        description: BatchId generated by '/batches' API of IEM
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - batchId
              properties:
                batchId:
                  type: string
                  example: ef5b7507e85a4f148bfd4668238310e6
                  description: BatchId generated by '/batches' API of IEM
      responses:
        '200':
          description: Successful operation, returns the user selected deviceId and
            deviceName
          content:
            application/json:
              schema:
                type: object
                required:
                - deviceId
                - deviceName
                - app-id
                - app-name
                properties:
                  deviceId:
                    type: string
                    example: 9f74d814748747a696e10d7a184beb13
                    description: DeviceId of the selected device
                  deviceName:
                    type: string
                    example: deviceTest
                    description: DeviceName of the selected device
                  app-id:
                    type: string
                    example: 6cf3a12d668a4242aff12cfd8e2aa95f
                    description: Id of the App received from IEM
                  app-name:
                    type: string
                    description: Name of the app
                    example: Flow Creator
        '400':
          "$ref": "#/components/responses/BatchIdInvalidError"
        '401':
          "$ref": "#/components/responses/TokenNotFoundUnAuthorizedError"
        '403':
          "$ref": "#/components/responses/TokenUnAuthorizedError"
        '404':
          "$ref": "#/components/responses/AppOrConfigNotFoundError"
        '405':
          "$ref": "#/components/responses/MethodNotAllowedError"
        '409':
          "$ref": "#/components/responses/ConflictError"
        '500':
          "$ref": "#/components/responses/FetchInternalServerError"
        '503':
          "$ref": "#/components/responses/IEMCertificatesNotFoundError"
  "/deploy":
    post:
      operationId: deploy-config
      tags:
      - deploy
      summary: Deploys file, flow and nodefile configurations
      description: Transfers the configurations(flow,file,node) to selected multiple IE devices using the IE Management job manager. In case of flows this will replace all the existing flows in the Flow Creator app instances
      parameters:
      - in: header
        name: Authorization
        schema:
          type: string
        required: true
        description: The authentication token
        example: 4c0b6cc23825cd7433f68e29143cd80a
      - in: query
        name: app-id
        schema:
          type: string
        required: true
        description: Unique ID of the app installed on device
        example: 6cf3a12d668a4242aff12cfd8e2aa95f
      - in: query
        name: device-id
        description: Unique ID of the device
        schema:
          type: string
        required: true
        example: f13a07451d44422fabb30a93c2c8b32d
      requestBody:
        required: true
        description: Ensure that credentials used belong to the admin user for each device in the device array
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/DeployData"
      responses:
        '200':
          "$ref": "#/components/responses/SuccessfulOperation"
        '400':
          description: "Invalid Request"
          content:
            application/json:
              schema:
                example:
                  description: "string"
                oneOf:
                  - "$ref": "#/components/responses/AppNotSupportedError"
                  - "$ref": "#/components/responses/InvalidAppIdError"
                  - "$ref": "#/components/responses/InvalidReqBodyError"
                  - "$ref": "#/components/responses/InvalidFileFormatError"
                  - "$ref": "#/components/responses/InvalidDeviceDetailsError"
                  - "$ref": "#/components/responses/InvalidNodesDataError"
                  - "$ref": "#/components/responses/InvalidNodeNamesArrayError"
        '401':
          "$ref": "#/components/responses/TokenNotFoundUnAuthorizedError"
        '403':
          "$ref": "#/components/responses/TokenUnAuthorizedError"
        '404':
          "$ref": "#/components/responses/DeployNotFoundError"
        '405':
          "$ref": "#/components/responses/MethodNotAllowedError"
        '500':
          "$ref": "#/components/responses/DeployInternalServerError"
        '503':
          "$ref": "#/components/responses/IEMCertificatesNotFoundError"
  "/config":
    get:
      operationId: get-config
      tags:
      - config
      summary: Gets the installed configurations
      description: Gets the configurations(flow,file,node) that are already deployed for the Flow Creator app running on the specified IE device
      parameters:
      - in: header
        name: Authorization
        schema:
          type: string
        required: true
        description: The authentication token
        example: 4c0b6cc23825cd7433f68e29143cd80a
      - in: query
        name: app-id
        schema:
          type: string
        required: true
        description: Unique ID of the app installed on device
        example: 6cf3a12d668a4242aff12cfd8e2aa95f
      - in: query
        name: device-id
        description: Unique ID of the device
        schema:
          type: string
        required: true
        example: f13a07451d44422fabb30a93c2c8b32d
      responses:
        '200':
          "$ref": "#/components/responses/GetConfigResponse"
        '401':
          "$ref": "#/components/responses/TokenNotFoundUnAuthorizedError"
        '403':
          "$ref": "#/components/responses/TokenUnAuthorizedError"
        '404':
          "$ref": "#/components/responses/DeployNotFoundError"
        '405':
          "$ref": "#/components/responses/MethodNotAllowedError"
        '500':
          "$ref": "#/components/responses/GetConfigInternalServerError"
    post:
      operationId: post-config
      tags:
      - config
      summary: Posts the configurations
      description: Saves the configurations(flow,file,node) temporarily in the API server of the configurator, but it is not deployed to the IE device(s)
      parameters:
      - in: header
        name: Authorization
        schema:
          type: string
        required: true
        description: The authentication token
        example: 4c0b6cc23825cd7433f68e29143cd80a
      - in: query
        name: app-id
        schema:
          type: string
        required: true
        description: Unique ID of the app installed on device
        example: 6cf3a12d668a4242aff12cfd8e2aa95f
      - in: query
        name: device-id
        description: Unique ID of the device
        schema:
          type: string
        required: true
        example: f13a07451d44422fabb30a93c2c8b32d
      requestBody:
        required: true
        description: Ensure that credentials used belong to the admin user for each device in the device array
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/PostConfig"
      responses:
        '200':
          "$ref": "#/components/responses/SuccessfulOperation"
        '401':
          "$ref": "#/components/responses/TokenNotFoundUnAuthorizedError"
        '403':
          "$ref": "#/components/responses/TokenUnAuthorizedError"
        '404':
          "$ref": "#/components/responses/DeployNotFoundError"
        '405':
          "$ref": "#/components/responses/MethodNotAllowedError"
        '500':
          "$ref": "#/components/responses/PostConfigInternalServerError"
  "/devices/pages/{pageNo}/ownership/{ownershipNo}/pagesize/{pageSize}":
    get:
      operationId: get-devicelist-for-pagination
      tags:
      - deviceListing
      summary: List devices for pagination
      description: Gives the list of devices with app installed for the given page size and page no and ownership No
      parameters:
      - in: header
        name: Authorization
        schema:
          type: string
        required: true
        description: The authentication token
        example: 4c0b6cc23825cd7433f68e29143cd80a
      - in: path
        name: pageNo
        schema:
          type: integer
        required: true
        example: 1
      - in: path
        name: ownershipNo
        schema:
          type: integer
        required: true
        example: 3
      - in: path
        name: pageSize
        schema:
          type: integer
        required: true
        example: 1000
      - in: query
        name: app-id
        description: Filter devices where this app is installed
        schema:
          type: string
        required: true
        example: 9f74d814748747a696e10d7a184beb13
      - in: query
        name: device-id
        description: Unique ID of the device.
        schema:
          type: string
        required: true
        example: f13a07451d44419fabb30a93c2c8b32d
      responses:
        '200':
          description: Successful Operation, returns a list of devices where app was
            installed as per page details provided'
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/DeviceListPagination"
        '400':
          description: "Invalid Request"
          content:
            application/json:
              schema:
                example:
                  description: "string"
                oneOf:
                  - "$ref": "#/components/responses/AppNotSupportedError"
                  - "$ref": "#/components/responses/InvalidAppIdError"
        '401':
          "$ref": "#/components/responses/TokenNotFoundUnAuthorizedError"
        '403':
          "$ref": "#/components/responses/TokenUnAuthorizedError"
        '404':
          "$ref": "#/components/responses/AppNotFoundError"
        '405':
          "$ref": "#/components/responses/MethodNotAllowedError"
        '500':
          "$ref": "#/components/responses/TokenValidatorInternalServerError"
        '503':
          "$ref": "#/components/responses/IEMCertificatesNotFoundError"
  "/job/status/{type}":
    get:
      operationId: get-job-status
      tags:
      - status
      summary: Gets the status of job
      description: Tracks the status of the job on IEM for the specified IE device, generated after using the deploy API 
      parameters:
      - in: header
        name: Authorization
        schema: 
          type: string
        required: true
        description: The authentication token
        example: 4c0b6cc23825cd7433f68e29143cd80a
      - in: path
        name: type
        description: Identifies the operation type. Possible values are flows or files or nodes 
        schema:
          type: string
        required: true
        example: flows
      - in: query
        name: app-id
        description: Unique ID of the app installed on device.
        schema:
          type: string
        required: true
        example: 9f74d814748747a696e10d7a184beb13
      - in: query
        name: device-id
        description: Unique ID of the device.
        schema:
          type: string
        required: true
        example: f13a07451d44419fabb30a93c2c8b32d
      responses:
        '200':
          description: Successful operation, returns the status of job in device
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/JobStatus"
        '400':
          description: "Invalid Request"
          content:
            application/json:
              schema:
                example:
                  description: "string"
                oneOf:
                  - "$ref": "#/components/responses/AppNotSupportedError"
                  - "$ref": "#/components/responses/InvalidAppIdError"
        '401':
          "$ref": "#/components/responses/TokenNotFoundUnAuthorizedError"
        '403':
          "$ref": "#/components/responses/TokenUnAuthorizedError"
        '404':
          "$ref": "#/components/responses/AppNotFoundError"
        '405':
          "$ref": "#/components/responses/MethodNotAllowedError"
        '500':
          "$ref": "#/components/responses/JobStatusInternalServerError"
        '503':
          "$ref": "#/components/responses/IEMCertificatesNotFoundError"
  "/flows/{fileName}":
    post:
      operationId: flows
      tags:
      - inputConfigurations
      summary: Uploads a flow
      description: Uploads a flow file to the API server of the configurator.<br>Existing flow file in the server will be replaced.<br>Only files with the extension json are allowed.<br>The maximum supported file size limit for the flow file is 2 MB.<br>The flow file can contain sub-flows
      parameters:
      - in: path
        name: fileName
        description: File Name of the flow
        schema:
          type: string
        required: true
        example: 'flows.json'
      - in: query
        name: app-id
        description: Unique ID of the app
        schema:
          type: string
        required: true
        example: 6cf3a12d668a4242aff12cfd8e2aa95f
      - in: query
        name: device-id
        description: Unique ID of the device
        schema:
          type: string
        required: true
        example: f13a07451d44419fabb30a93c2c8b32d
      - in: header
        name: Authorization
        schema:
          type: string
        required: true
        description: The authentication token
        example: 4c0b6cc23825cd7433f68e29143cd80a
      requestBody:
        required: true
        description: Flow Uploaded
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/FlowUpload"
      responses:
        '200':
          "$ref": "#/components/responses/SuccessfulOperation"
        '400':
          description: "Invalid Request"
          content:
            application/json:
              schema:
                example:
                  description: "string"
                oneOf:
                  - "$ref": "#/components/responses/AppNotSupportedError"
                  - "$ref": "#/components/responses/InvalidAppIdError"
                  - "$ref": "#/components/responses/InvalidFlowSize"
                  - "$ref": "#/components/responses/ConfigNotFoundErrororInvalidRequest"
        '401':
          "$ref": "#/components/responses/TokenNotFoundUnAuthorizedError"
        '403':
          "$ref": "#/components/responses/TokenUnAuthorizedError"
        '404':
          "$ref": "#/components/responses/AppNotFoundError"
        '405':
          "$ref": "#/components/responses/MethodNotAllowedError"
        '500':
          "$ref": "#/components/responses/FileOperationAndTokenValidatorInternalServerError"
        '503':
          "$ref": "#/components/responses/IEMCertificatesNotFoundError"
  "/files/{fileName}":
    post:
      operationId: files
      tags:
      - inputConfigurations
      summary: Uploads a file
      description: Uploads a file to the API server of the configurator.<br>Uploaded file will be copied to the path with the prefix '/home/nodered/node-red-home/node-red-files/' followed by(filename or folder or compressed-filename/filename).<br>Only files with the extensions txt, xlsx, zip, tar, json, csv, and tgz are allowed.<br>Users can have multiple sub files inside zip/tgz/tar.<br>The maximum supported file upload limit is 2 MB
      parameters:
      - in: header
        name: Authorization
        schema:
          type: string
        required: true
        description: The authentication token
        example: 4c0b6cc23825cd7433f68e29143cd80a
      - in: path
        name: fileName
        description: File Name of the file
        schema:
          type: string
        required: true
        example: 'file.txt'
      - in: query
        name: app-id
        description: Unique ID of the app
        schema:
          type: string
        required: true
        example: 6cf3a12d668a4242aff12cfd8e2aa95f
      - in: query
        name: device-id
        description: Unique ID of the device
        schema:
          type: string
        required: true
        example: f13a07451d44419fabb30a93c2c8b32d
      - in: formData
        name: file
        description: The file to upload
        schema:
          type: file
        required: true
      responses:
        '200':
          "$ref": "#/components/responses/SuccessfulOperation"
        '400':
          description: "Invalid Request"
          content:
            application/json:
              schema:
                example:
                  description: "string"
                oneOf:
                  - "$ref": "#/components/responses/AppNotSupportedError"
                  - "$ref": "#/components/responses/InvalidAppIdError"
                  - "$ref": "#/components/responses/InvalidFileSize"
                  - "$ref": "#/components/responses/InvalidFileExtension"
                  - "$ref": "#/components/responses/InvalidFileName"
                  - "$ref": "#/components/responses/FileNotUploadedError"
        '401':
          "$ref": "#/components/responses/TokenNotFoundUnAuthorizedError"
        '403':
          "$ref": "#/components/responses/TokenUnAuthorizedError"
        '404':
          "$ref": "#/components/responses/AppNotFoundError"
        '405':
          "$ref": "#/components/responses/MethodNotAllowedError"
        '500':
          "$ref": "#/components/responses/FileOperationAndTokenValidatorInternalServerError"
        '503':
          "$ref": "#/components/responses/IEMCertificatesNotFoundError"
  "/conversion":
    post:
      operationId: dataConverter
      tags:
      - dataConverter
      summary: File Conversion
      description: Converts the file contents into bytes.<br>Byte format is needed for using the IEM UI which supports deploying files along with the installation of the Flow Creator app.<br>The format can also be used to update the configuration using the IEM UI 
      parameters:
      - in: header
        name: Authorization
        schema:
          type: string
        required: true
        description: The authentication token
        example: 4c0b6cc23825cd7433f68e29143cd80a
      - in: formData
        name: file
        description: The file to upload
        required: true
        schema:
          type: file
      responses:
        '200':
          "$ref": "#/components/responses/DataConverterResponse"
        '400':
          description: "Invalid Request"
          content:
            application/json:
              schema:
                example:
                  description: "string"
                oneOf:
                  - "$ref": "#/components/responses/AppNotSupportedError"
                  - "$ref": "#/components/responses/InvalidAppIdError"
                  - "$ref": "#/components/responses/FileNotUploadedError"  
        '401':
          "$ref": "#/components/responses/TokenNotFoundUnAuthorizedError"
        '403':
          "$ref": "#/components/responses/TokenUnAuthorizedError"
        '404':
          "$ref": "#/components/responses/AppNotFoundError"
        '405':
          "$ref": "#/components/responses/MethodNotAllowedError"
        '500':
          "$ref": "#/components/responses/FileOperationAndTokenValidatorInternalServerError"
        '503':
          "$ref": "#/components/responses/IEMCertificatesNotFoundError"
  "/devices/encryption":
    post:
      operationId: get-encrypt-password
      tags:
        - passwordEncryption
      summary: For password encryption
      description: Encrypts the password of the admin user of the IE device.<br>Encryption is needed for using the IEM UI which supports deploying configurations(flow,file,node) along with the installation of the Flow Creator app.<br>The format can also be used to update the configuration using the IEM UI
      parameters:
      - in: header
        name: Authorization
        schema:
          type: string
        required: true
        description: The authentication token
        example: 4c0b6cc23825cd7433f68e29143cd80a
      requestBody:
        required: true
        description: Encrypt Password
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/EncryptedPassword"
      responses:
        '200':
          "$ref": "#/components/responses/EncryptedPasswordResponse"
        '401':
          "$ref": "#/components/responses/TokenNotFoundUnAuthorizedError"
        '403':
          "$ref": "#/components/responses/TokenUnAuthorizedError"
        '404':
          "$ref": "#/components/responses/DeviceIdNotFoundError"
        '405':
          "$ref": "#/components/responses/MethodNotAllowedError"
        '400':
          "$ref": "#/components/responses/PasswordInvalidError"
        '500':
          "$ref": "#/components/responses/GetDevicesInternalServerError"
        '503':
          "$ref": "#/components/responses/IEMCertificatesNotFoundError"
  "/devices/status/user":
    put:
      operationId: update-user-status
      tags:
      - status
      summary: Updates the status of an active user
      description: Updates the last active time of a user with the current timestamp, the provision API call will fail, if made within a time interval of 10 seconds after the status call is made
      parameters:
      - in: header
        name: Authorization
        schema:
          type: string
        required: true
        description: The authentication token
        example: 4c0b6cc23825cd7433f68e29143cd80a
      - in: query
        name: device-id
        description: Unique ID of the device
        schema:
          type: string
        required: true
        example: 9f74d814748747a696e10d7a184beb13
      - in: query
        name: app-id
        description: Unique ID of the app installed on device
        schema:
          type: string
        required: true
        example: 9f74d814748747a696e10d7a184beb13
      responses:
        '200':
          "$ref": "#/components/responses/SuccessfulOperation"
        '400':
          description: "Invalid Request"
          content:
            application/json:
              schema:
                oneOf:
                  - "$ref": "#/components/responses/AppNotSupportedError"
                  - "$ref": "#/components/responses/InvalidAppIdError"
        '401':
          "$ref": "#/components/responses/TokenNotFoundUnAuthorizedError"
        '403':
          "$ref": "#/components/responses/TokenUnAuthorizedError"
        '404':
          "$ref": "#/components/responses/AppNotFoundError"
        '405':
          "$ref": "#/components/responses/MethodNotAllowedError"
        '500':
          "$ref": "#/components/responses/FileOperationAndTokenValidatorInternalServerError"
        '503':
          "$ref": "#/components/responses/IEMCertificatesNotFoundError"
  "/devices/status/connections":
    get:
      operationId: get-connections-status
      tags:
      - status
      summary: Gets events from the Flow Creator app for the IE device
      description: Gets all events from the IE device for the Flow Creator app, such as deployment status of the last flow, file or node deployed using the deploy API, and any error messages
      parameters:
      - in: header
        name: Authorization
        schema:
          type: string
        required: true
        description: The authentication token
        example: 4c0b6cc23825cd7433f68e29143cd80a
      - in: query
        name: device-id
        description: Unique ID of the device
        schema:
          type: string
        required: true
        example: 9f74d814748747a696e10d7a184beb13
      - in: query
        name: app-id
        description: Unique ID of the app installed on device
        schema:
          type: string
        required: true
      responses:
        '400':
          description: "Invalid Request"
          content:
            application/json:
              schema:
                oneOf:
                  - "$ref": "#/components/responses/AppNotSupportedError"
                  - "$ref": "#/components/responses/InvalidAppIdError"
        '401':
          "$ref": "#/components/responses/TokenNotFoundUnAuthorizedError"
        '200':
          "$ref": "#/components/responses/ConnectionStatus"
        '403':
          "$ref": "#/components/responses/TokenUnAuthorizedError"
        '404':
          "$ref": "#/components/responses/AppNotFoundError"
        '405':
          "$ref": "#/components/responses/MethodNotAllowedError"
        '500':
          "$ref": "#/components/responses/ConnectionStatesInternalServerError"
        '503':
          "$ref": "#/components/responses/IEMCertificatesNotFoundError"
  "/built-in-nodes":
    get:
      operationId: get-builtinnodes
      tags:
      - inputConfigurations
      summary: Gives the list of built in nodes 
      description: Provides the list of all built-in nodes along with their versions, descriptions, and links to the documentation
      parameters:
      - in: header
        name: Authorization
        schema:
          type: string
        required: true
        description: The authentication token
        example: 4c0b6cc23825cd7433f68e29143cd80a
      responses:
        '200':
          "$ref": "#/components/responses/GetBuiltInNodeResponse"
        '401':
          "$ref": "#/components/responses/TokenNotFoundUnAuthorizedError"
        '403':
          "$ref": "#/components/responses/TokenUnAuthorizedError"
        '405':
          "$ref": "#/components/responses/MethodNotAllowedError"
        '500':
          "$ref": "#/components/responses/GetConfigInternalServerError"
  "/custom-nodes/{fileName}":
    post:
      operationId: customnodes
      tags:
      - inputConfigurations
      summary: Upload a custom node 
      description: Uploads a custom node to the API server of the configurator.<br>Only nodefile with the extension tgz are allowed.<br>The maximum supported node upload limit is 10MB
      parameters:
      - in: path
        name: fileName
        description: File Name of the file uploaded
        schema:
          type: string
        required: true
        example: 'node-red-google-notify-1.4.8.tgz'
      - in: query
        name: device-id
        description: Unique ID of the device
        schema:
          type: string
        required: true
        example: 9f74d814748747a696e10d7a184beb13
      - in: query
        name: app-id
        description: Unique ID of the app installed on device
        schema:
          type: string
        required: true
        example: 9f74d814748747a696e10d7a184beb13
      - in: header
        name: Authorization
        schema:
          type: string
        required: true
        description: The authentication token
        example: 4c0b6cc23825cd7433f68e29143cd80a
      - in: formData
        name: file
        description: The file to upload
        schema:
          type: file
        required: true              
      responses:
        '200':
          "$ref": "#/components/responses/SuccessfulOperation"
        '400':
          description: "Invalid Request"
          content:
            application/json:
              schema:
                oneOf:
                  - "$ref": "#/components/responses/AppNotSupportedError"
                  - "$ref": "#/components/responses/InvalidAppIdError"
                  - "$ref": "#/components/responses/InvalidFileName"
                  - "$ref": "#/components/responses/InvalidNodeFileExtension"
                  - "$ref": "#/components/responses/FileNotUploadedError"
        '401':
          "$ref": "#/components/responses/TokenNotFoundUnAuthorizedError"
        '403':
          "$ref": "#/components/responses/TokenUnAuthorizedError"
        '404':
          "$ref": "#/components/responses/AppNotFoundError"
        '405':
          "$ref": "#/components/responses/MethodNotAllowedError"
        '500':
          "$ref": "#/components/responses/FileOperationAndTokenValidatorInternalServerError"
        '503':
          "$ref": "#/components/responses/IEMCertificatesNotFoundError"
tags: []
