Project

General

Profile

REST APIs » History » Revision 15

Revision 14 (Hammel, 03 Sep 2018 14:40) → Revision 15/16 (Hammel, 09 Sep 2018 14:18)

h1. REST APIs 

 h2. Monitor Node (imwww) 

 The following describe the API used by the monitor to process incoming requests. 

 table{width:100%}. 
 |_. Resource Name |_. HTTP Verbs        |_. HTTP Methods              |_. Returns        |_. Direction     |_. Description | 
 | Pair              | CREATE Pair         |    POST /pair/iot/<uuid>      /pair/iot             | ACK              UUID             | From IoT Node | Register Pair an IoT node w/Monitor using UUID w/ Monitor | 
 | Pair              | UPDATE CREATE Pair         |    POST /ping                 /pair/iot/<uuid>      | ACK              | From IoT Node | Register an IoT device is verifying its stored pairing information node w/Monitor using UUID | 
 | Pair              | CREATE Pair         |    POST /pair/jarvis/<uuid> | ACK              | From Jarvis     | Pair a Jarvis node with Monitor | 
 | Monitor           | GET Monitor ID      |    GET /monitor               | Monitor ID       | From Jarvis     | Monitor Identity information | 
 | Device            | GET Devices         |    POST /devices              | Device list      | From Jarvis     | Get list of device IDs and descriptors | 
 | Device            | UPDATE Device       |    POST /set/device           PUT /device/<uuid>         | Device state     | From Jarvis     | Change device state with JSON | 
 | Device            | GET Device          |    POST /device/<uuid>        | Device state     | From Jarvis     | Get Device state as JSON | 
 | Monitor           | GET Query Devices Eevices |    GET /query/devices         | Updates states | From monitor    | Causes monitor to update its device state information; only valid if received from localhost | 

 Notes 
 * Monitor identity includes location and possibly other descriptors that uniquely identify the monitor 
 * POST is required for GET requests because the sender must identify themselves with a valid encryption key, which is sent in a JSON body that GET does not allow.    This is because we are not using HTTPS but rather encrypting the requests and responses inside a JSON packet stored in the body of messages. 

 h2. IoT Node (embedded in Arduino device code) 

 The following describe the API used by a sensor to process incoming requests. 

 table{width:100%}. 
 |_. Resource Name |_. HTTP Verbs |_. HTTP Methods          |_. Returns      |_. Direction |_. Description | 
 | Device            | UPDATE Device|    POST /set              PUT /device/<uuid>     | Device config| state | From Monitor | Change device state with JSON | 
 | Device            | POST Query     |    POST /query            | Device config| state | From Monitor | Get Device state as JSON | 
 | Device            | GET Register |    GET /register/<uuid> | ACK            | From Monitor | Provides UUID from monitor |