# Endpoints ## /controller/ Methods: GET Lists the available controllers. ## /controller/{uuid}/ Methods: GET Information about the controller with the uuid {uuid}. ## /controller/{uuid}/jobset/ Methods: GET, PUT, DELETE Download a jobset (including parameters) to the controller with the uuid {uuid}. Example: ```json { "uuid": "0483d1d4-3ae8-4851-8517-f15f5aa887bf", "parameters": { "param_1": { // param definition }, "param_2": { // param definition }, … }, "jobs": { "init": { // job definition }, "measurement": { // job definition }, … }, // maybe in the future: "statemachine": { // a definition of which jobs get started // after each other, and under which conditions } } ``` ## /controller/{uuid}/jobcontrol/ Methods: GET, PUT PUT example: ```json { "command": "start", "job": "measurement" } PUT example: { "command": "stop" } GET example: { "status": "idle" } GET example: { "status": "running", "job": "measurement" } ``` ## /controller/{uuid}/eventlog/ Methods: GET Get a (continuos) list of log entries, in JSONL format. The data contains all status changes, job starts and stops, received measurement data etc. The data gets sent to all clients that are connected at the moment when the event occurs. If a client is not connected at this moment, it won't be able to capture the event. Maybe we could upgrade this to websockets later, but I assume we are OK with long-running GET requests as well. Notes: maybe we should add some context to the jobposition because then it could be used by the client directly instead of having to look if up. GET example: ```json {"event": "jobsetdeployed", "details": {"uuid": "0483d1d4-3ae8-4851-8517-f15f5aa887bf"}} {"event": "jobstarted", "details": {"job": "measurement"}} {"event": "taginfo", "details": {{"dry": ["time","weight","buttonpressed"], "wet": ["time","weight"]}}} {"event": "jobposition", "details": {"step": 0}} {"event": "jobposition", "details": {"step": 1}} {"event": "jobposition", "details": {"step": 2}} {"event": "jobposition", "details": {"step": 3}} {"event": "jobposition", "details": {"step": 4}} {"event": "data", "details": {"tag": "dry", "data": [1320, 44295232, 0]}} {"event": "data", "details": {"tag": "dry", "data": [1330, 44295232, 0]}} {"event": "data", "details": {"tag": "dry", "data": [1340, 44295232, 0]}} {"event": "data", "details": {"tag": "dry", "data": [1350, 44295232, 0]}} {"event": "data", "details": {"tag": "dry", "data": [1360, 44295232, 0]}} {"event": "data", "details": {"tag": "dry", "data": [1370, 44295232, 0]}} {"event": "data", "details": {"tag": "dry", "data": [1380, 44295232, 0]}} {"event": "data", "details": {"tag": "dry", "data": [1390, 44295232, 0]}} {"event": "jobposition", "details": {"step": 5}} {"event": "jobposition", "details": {"step": 6}} {"event": "data", "details": {"tag": "wet", "data": [1490, 44295232]}} {"event": "data", "details": {"tag": "wet", "data": [1500, 44295232]}} {"event": "data", "details": {"tag": "wet", "data": [1510, 44295232]}} {"event": "data", "details": {"tag": "wet", "data": [1520, 44295232]}} {"event": "jobposition", "details": {"step": 7}} {"event": "jobposition", "details": {"step": 8}} {"event": "jobstopped", "details": {"job: "measurement" "reason": "finished"}} {"event": "jobsetcleared", "details": {"uuid": "0483d1d4-3ae8-4851-8517-f15f5aa887bf"}} … ``` ## /controller/{uuid}/module/ Methods: GET Get a list of models with their descriptions and their status available on the controller. ## /controller/{uuid}/module/{moduleid}/ Methods: GET Get a detailed description and status of a module, including it's channels. ## /controller/{uuid}/module/{moduleid}/statecontrol/ Methods: GET, PUT Get or change the status of a module. Should also have the possibility to initialize modules with a certain value before starting it. Will only switch the module if it is not assigned to a job. PUT example: ```json { "targetstate": "started", "initializeparameters: { "param1": 3042, "param2": "mode_a" } } ``` ## /controller/{uuid}/module/{moduleid}/channels/values/ Methods: GET, PUT Get or set channel values. PUT can be used to only select *some* channel values by just leaving all others out. GET example: ```json { "param1": 3054, "param2": "mode_b" } ``` PUT example: ```json { "param1": 4422 }