Revision for “REST API” created on February 20, 2015 @ 08:52:34
Title | REST API |
---|---|
Content | Each IoT Resource provides an easy-to-use REST interface to retrieve data about the resource and it is current state. It is also possible to invoke actions.
<h3>Retrieving Services</h3>
By providing the endpoint and the keyword <em>services </em>it is possible to retrieve all services offered.<a href="http://www.iotworldservices.com/wp-content/uploads/2014/12/resourceREST1.png"><img class="aligncenter wp-image-461 size-large" src="http://www.iotworldservices.com/wp-content/uploads/2014/12/resourceREST1-1024x498.png" alt="resourceREST1" width="620" height="302" /></a>
<h3>Retrieving Statevariables</h3>
Supplying the service name and the keyword statevariables will list all statevariables associated with the service. is
<a href="http://www.iotworldservices.com/wp-content/uploads/2014/12/resourceREST2.png"><img class="size-medium wp-image-462 aligncenter" src="http://www.iotworldservices.com/wp-content/uploads/2014/12/resourceREST2-300x146.png" alt="resourceREST2" width="300" height="146" /></a>
<h3>Checking Statevariable Values</h3>
<a href="http://www.iotworldservices.com/wp-content/uploads/2014/12/resourceREST3.png"><img class="size-medium wp-image-463 aligncenter" src="http://www.iotworldservices.com/wp-content/uploads/2014/12/resourceREST3-300x66.png" alt="resourceREST3" width="300" height="66" /></a>
<h3>Retrieving Actions</h3>
<a href="http://www.iotworldservices.com/wp-content/uploads/2014/12/resourceREST4.png"><img class="size-medium wp-image-464 aligncenter" src="http://www.iotworldservices.com/wp-content/uploads/2014/12/resourceREST4-300x189.png" alt="resourceREST4" width="300" height="189" /></a>
<h3>Invoking Actions</h3>
Actions can be invoked using parameters following the syntax action?param1=X&param2=Y
<h3>Summary</h3>
<table>
<tbody>
<tr>
<td width="481">http://<endpoint>/services</td>
<td width="481"> Retrieves all services offered by the IoTResource</td>
</tr>
<tr>
<td width="481">http://<span style="text-decoration: underline;"><span style="color: #0066cc;"><endpoint></span></span>/services/<name></td>
<td width="481">Retrieves all state variables associated with the service</td>
</tr>
<tr>
<td width="481">http://<span style="text-decoration: underline;"><span style="color: #0066cc;"><endpoint></span></span>/services/<name>/statevariables</td>
<td width="481">Retrieves the current value of all state variables</td>
</tr>
<tr>
<td width="481">http://<span style="text-decoration: underline;"><span style="color: #0066cc;"><endpoint></span></span>/services/<name>/statevariables/<name></td>
<td width="481">Retrieves the value of a specified state variable</td>
</tr>
<tr>
<td width="481">http://<span style="text-decoration: underline;"><span style="color: #0066cc;"><endpoint></span></span>/services/<name>/actions</td>
<td width="481">Retrieves all actions that can be performed on the IoTResource</td>
</tr>
<tr>
<td width="481">http://<span style="text-decoration: underline;"><span style="color: #0066cc;"><endpoint></span></span>/services/<name>/actions/<name>?param1=X&param2=Y</td>
<td width="481">Invokes an action with or without parameters.</td>
</tr>
</tbody>
</table> |
Excerpt |