Webservice for WSN-CO2 Research
- Set connection to database at 'config.py'
- Run webservice by excuting 'run.py'
.
|-- app
|-- static
|-- templates
|-- __init__.py
|-- forms.py
|-- models.py
|-- views.py
|-- db_repository
|-- flask
|-- tmp
To add node :
curl -i -H "Content-Type: application/json" -X POST -d '{
"id":"(node ID-integer)",
"desc":"(node's description-string)",
"pos":"(node's position-string)"}' http://(server's IP address)/api/v01/post/node/add
To edit node :
curl -i -H "Content-Type: application/json" -X POST -d '{
"id":"(insert node's ID that want to be edited-integer)",
"desc":"(new description-string)",
"pos":"(new position-string)"}' http://(server's IP address)/api/v01/post/node/edit
To delete node :
curl -i -H "Content-Type: application/json" -X POST -d '{
"id":"(node's ID that want to be deleted-integer)"}' http://(server's IP address)/api/v01/post/node/delete
To modify node status :
curl -i -H "Content-Type: application/json" -X POST -d '{
"id":"(node ID / 9999(to modify all nodes-integer) )",
"status":(desired status(0/1)-integer)}' http://(server's IP address)/api/v01/post/node/statchange
To add data :
curl -i -H "Content-Type: application/json" -X POST -d '{
"id":"(node ID of data source)",
"timestamp":"(data timestamp)",
"co2":"(co2 data)",
"temp":"(temperature data)",
"hum":"(humidity data)",
"light":"(light intensity data)"}' http://(server's IP address)/api/v01/post/data/add
To view available node in JSON :
http://(server's IP address)/api/v01/get/node
To view gathered data in JSON :
http://(server's IP address)/api/v01/get/data
To view gathered data for specific node in JSON :
http://(server's IP address)/api/v01/get/data/[node ID]
To download gathered data in CSV :
http://(server's IP address)/