openapi: 3.0.0 info: title: ACNode Dashboard API version: 0.1.0 servers: - url: /api/ components: securitySchemes: ApiKeyAuth: type: apiKey in: header name: API-KEY description: API Key for machine use CookieAuth: type: apiKey in: cookie name: ACNodeDashboardSession description: When a human is logged in, this is what is used schemas: ACNode: type: object properties: id: type: integer description: The Node Id name: type: string description: The name of the node mqttName: type: string description: The name of the node on MQTT. Used for not containing spaces nodeType: type: string description: The type of the node inService: type: bool description: Is the tool in service on ACServer? LastSeen: type: integer description: The UTC timestamp the node was last seen deprecated: true LastSeenAPI: type: integer description: The UTC timestamp of when the node was last seen contacting ACServer LastSeenMQTT: type: integer description: The UTC timestamp of when the node was last seen sending messages on MQTT LastStarted: type: integer description: The UTC timestamp of when the node last sent a START message, or 0 if it has not been seen to send one MemFree: type: integer description: Amount of RAM free on the device MemUsed: type: integer description: Amount of RAM in use on the device Status: type: string description: The last known status message of the device Version: type: string description: The firmware version of the device CameraId: type: integer description: The Zoneminder Camera Id associated with the Node required: false IsTransient: type: boolean description: Is the node known to only be active some of the time SettingsVersion: type: integer required: false description: Settings struct version EEPROMSettingsVersion: type: integer required: false description: Settings struct version contained in EEPROM ResetCause: type: string required: false description: The cause of the last reset PrinterStatus: $ref: '#/components/schemas/PrinterStatus' PrinterStatus: type: object required: false properties: mqttConnected: type: boolean required: true description: Is Octoprint connected over MQTT? octoprintConnected: type: boolean required: true description: Is Octoprint connected to the printer? firmwareVersion: type: string required: true description: Firmware version of the printer zHeight: type: number required: true description: Last known Z height of the printer piUndervoltage: type: boolean required: true description: Is the pi struggling for power? piOverheat: type: boolean required: true description: Is the pi cooking? hotendTemperature: type: number required: true description: Last known temperature of the hotend bedTemperature: type: number required: true description: Last known temperature of the bed security: - ApiKeyAuth: [] CookieAuth: [] paths: /nodes: get: summary: Returns a list of ACNodes responses: 200: description: A list of known nodes content: application/json: schema: type: array items: type: string /nodes/{nodeName}: get: summary: Returns the details of a node parameters: - name: nodeName in: path description: MQTT name of the node required: true schema: type: string responses: 200: description: Nodes details content: application/json: schema: $ref: '#/components/schemas/ACNode' 404: description: Unknown node /nodes/setProps/{nodeName}: post: summary: Set the properties of the node parameters: - name: nodeName in: path description: MQTT name of the node required: true schema: type: string requestBody: content: application/json: schema: type: object properties: CameraId: type: integer description: Zoneminder ID of camera required: false isTransient: type: boolean description: Is the node transient? required: false responses: 204: description: Accepted 404: description: Node not known /nodes/setStatus/{id}: post: summary: Set the status of a node, intended for log parser parameters: - name: id in: path description: ACServer ID of the node required: true schema: type: integer requestBody: content: application/json: schema: type: object properties: version: type: string description: Firmware Version required: false timestamp: type: integer description: Unix timestamp of last activity required: false responses: 204: description: Accepted 404: description: Node not known /auth/login: post: summary: User login. Returns a cookie security: [] requestBody: content: application/json: schema: type: object properties: username: type: string description: user's username required: yes password: type: string description: The user's password required: yes responses: 204: description: Login Successful 401: description: Login Failed content: application/json: schema: type: object properties: error: type: string description: Description of Error 400: description: Bad Request /auth/logout: get: summary: Log the current user out responses: 204: description: Success /auth/currentuser: get: summary: Get information about the logged in user responses: 200: description: User information content: application/json: schema: type: object properties: username: type: string description: username name: type: string description: the user's name admin: type: boolean description: true if the user is an administrator 401: description: Not logged in /accesslogs: get: summary: Returns a list of ACNodes with access logs available responses: 200: description: A list of known nodes content: application/json: schema: type: array items: type: string /accesslogs/{node}: get: summary: Get the access logs for a particular node parameters: - name: node in: path description: the name of the node to get the log for required: true schema: type: string - name: page in: query required: false description: the page to get schema: type: integer responses: 404: description: The node does not exist 200: description: Usage logs content: application/json: schema: type: object properties: count: type: integer description: total number of entries page: type: integer description: The current page number pageCount: type: integer description: The number of pages entries: type: array items: type: object properties: timestamp: description: timestamp of the usage type: integer user_name: type: string description: the name of the user user_id: type: string description: the user id, in the format of HS1234 user_card: type: string description: the card ID used success: type: boolean description: was the usage successful, as in, not denied picture_key: type: string description: Filename of photo of entry attempt