WattDepot logo WattDepot3 HTTP API: Sensor Groups

GET /wattdepot/{group_id}/sensorgroups

http://server.wattdepot.org/wattdepot/{group_id}/sensorgroups Response
		      
[
   {
      "id": "ilima-6th-floor",
      "sensors":
         [
            {
               "id": "ilima-6-telco",
               "uri": "http://foo.com/ilima-6-telco",
               "location":
                     {
                        "description": "Hale Aloha Ilima residence hall 6th floor",
                        "altitude": 30,
                        "longitude": -157.812727,
                        "latitude": 21.294642,
                        "id": "ilima-6th"
                     },
               "model":
                     {
                        "id": "egauge1.0",
                        "protocol": "eGauge",
                        "type": "EGAUGE",
                        "version": "1.0"
                     },
               []
            },
            {
               "id": "ilima-6-elect",
               "uri": "http://foo.com/ilima-6-elect",
               "location": 
                     {
                        "description": "Hale Aloha Ilima residence hall 6th floor",
                        "altitude": 30,
                        "longitude": -157.812727,
                        "latitude": 21.294642,
                        "id": "ilima-6th"
                     },      
               "model":
                     {
                        "id": "egauge1.0",
                        "protocol": "eGauge",
                        "type": "EGAUGE",
                        "version": "1.0"
                     },
               []
            }
         ]
   }
]
		      
		    

Get a full list of defined Sensor Groups.

GET /wattdepot/{group_id}/sensorgroup/{sensorgroup_id}

http://server.wattdepot.org/wattdepot/{group_id}/sensorgroup/ilima-6th-floor Response
              
{
   "id": "ilima-6th-floor",
   "sensors":
      [
         {
            "id": "ilima-6-telco",
            "uri": "http://foo.com/ilima-6-telco",
            "location":
                  {
                     "description": "Hale Aloha Ilima residence hall 6th floor",
                     "altitude": 30,
                     "longitude": -157.812727,
                     "latitude": 21.294642,
                     "id": "ilima-6th"
                  },
            "model":
                  {
                     "id": "egauge1.0",
                     "protocol": "eGauge",
                     "type": "EGAUGE",
                     "version": "1.0"
                  },
            []
         },
         {
            "id": "ilima-6-elect",
            "uri": "http://foo.com/ilima-6-elect",
            "location": 
                  {
                     "description": "Hale Aloha Ilima residence hall 6th floor",
                     "altitude": 30,
                     "longitude": -157.812727,
                     "latitude": 21.294642,
                     "id": "ilima-6th"
                  },      
            "model":
                  {
                     "id": "egauge1.0",
                     "protocol": "eGauge",
                     "type": "EGAUGE",
                     "version": "1.0"
                  },
            []
         }
      ]
 }
              
            

Get the Sensor Group with the given sensorgroup_id.

PUT /wattdepot/{group_id}/sensorgroup/

curl -F '{id :"group1", "sensors": [{id: "sensor1", uri: "http://foo.com", location: {id :"loc2", "latitude": 21.294642, "longitude": -157.812727, "altitude": 40.0, "description": "40.0"}, model: {id :"sm1", "protocol": "Hammer", "type": "hammer", "version": "1.0"}, []}]} ' http://server.wattdepot.org/wattdepot/{group_id}/sensorgroup/
              
{
   "status": 200,
   "message": "OK"
}
              
            

Add the Sensor Group. Will return the HTTP status. Error status if duplicate unique id.

DEL /wattdepot/{group_id}/sensorgroup/{sensorgroup_id}

curl -X DELETE http://server.wattdepot.org/wattdepot/{group_id}/sensorgroup/ilima-6th-floor
              
{
   "status": 200,
   "message": "OK"
}
              
            

Deletes the Sensor Group with the given sensorgroup_id. Will return the HTTP status. Error status if sensorgroup_id is not defined.