From 934c4c81710e9e645aae6e3e403f6240fb5b9ad4 Mon Sep 17 00:00:00 2001 From: Patrick McDonagh Date: Mon, 22 Feb 2016 18:38:06 -0600 Subject: [PATCH] Updated README to reflect recent configuration changes. Added preliminary API documentation as well --- README.md | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 48436f9..76d9ce6 100644 --- a/README.md +++ b/README.md @@ -61,11 +61,7 @@ npm install -g forever 7. Enter tag information in web server. -8. Set IP of PLC in datalogger program. In python/tagserver_.py find the line that contains the variable - ``` - PLC_IP_ADDRESS = ... - ``` - enter the PLC IP Address in quotes behind the equals sign. THIS WILL SOON BE A WEB-CONFIGURED ITEM. +8. Set IP of PLC in web server. Without configuration, the program will default to looking for the PLC at 192.168.1.10. 9. Test the Python datalogger functiality. ``` @@ -83,3 +79,22 @@ npm install -g forever OR forever www/app.js ``` +## API Documentation +``` +app.post('/json/tag/add', fns.createTag); // Adds a tag to the scan list +app.post('/json/tag/update/', fns.updateTag); // Updates tag data +app.get('/json/tag/delete/:tag', fns.deleteTag); // Removes a tag from the scan list +app.get('/json/tag/:id', fns.getTag); // Gets a specific tag in the scan list +app.get('/json/tag', fns.getAllTags); // Lists all tags in the scan list +app.get('/json/val/:tag', fns.latestValueSingleTag); // Gets the latest value of a single tag +app.get('/json/series/:tag/:hours', fns.seriesTagValues); // Gets all the values of a tag for the last X hours +app.get('/json/valBetween/:tag/:startDatetime/:endDatetime', fns.seriesTagValuesBetween); // Gets the values of a tag between the start time and end time +app.get('/json/CSV/all', fns.allDataCSV); // Gets a CSV of all values stored +app.get('/json/CSV/:tag/:startDatetime/:endDatetime', fns.seriesCSVBetween); // Gets a CSV of the values of a tag between the start time and end time +app.get('/json/CSV/:tag/:hours', fns.seriesCSV); // Gets a CSV of the values of a tag for the last x hours +app.get('/json/all', fns.latestValueAllTags); // Gets the latest values of all tags in the scan list +app.get('/json/config', fns.getSetup); // Gets the contents of the config table +app.post('/json/config', fns.updateSetup); // Adds a new parameter to the config table +app.get('/json/logger/status', fns.checkLoggerStatus); // Gets the status of the data logger +app.get('/json/logger/restart', fns.restartLogger); // Restarts the data logger +```