184
edits
(→Services: Updated to Decentralized Taxonomy) |
(→Channels: Updated to Decentralized API) |
||
| Line 57: | Line 57: | ||
* (optional) string|array of string `tags`: accept only channels with all the tags in the array; | * (optional) string|array of string `tags`: accept only channels with all the tags in the array; | ||
* (optional) string|array of string `service_tags`: accept only channels of a service with all the tags in the array; | * (optional) string|array of string `service_tags`: accept only channels of a service with all the tags in the array; | ||
* (optional) string | * (optional) string `feature`: accept only channels that implement a given feature (e.g. "oven/temperature-celcius"). | ||
While each field is optional, at least one field must be provided. | While each field is optional, at least one field must be provided. | ||
| Line 67: | Line 67: | ||
* Fetch values from all channels matching any of the selectors | * Fetch values from all channels matching any of the selectors | ||
POST http://localhost:3000/api/v1/channels selector(s) | |||
<br/> | <br/> | ||
Example: | Example: | ||
POST http://localhost:3000/api/v1/channels [{"tags": "location: entrance", "feature": "oven/temperature-celcius"}] | |||
=== Sending === | === Sending === | ||
| Line 78: | Line 78: | ||
* Send one values to all channels matching any of the selectors: | * Send one values to all channels matching any of the selectors: | ||
PUT http://localhost:3000/api/v1/channels/set {"select": selector(s), "value": value} | PUT http://localhost:3000/api/v1/channels/set {"select": selector(s), "value": value} | ||
or | or | ||
| Line 89: | Line 90: | ||
The following snippet displays "Hello world" on all the devices that support Log, in particular the console. | The following snippet displays "Hello world" on all the devices that support Log, in particular the console. | ||
curl -X PUT http://localhost:3000/api/v1/channels/set -d '{"select":{" | curl -X PUT http://localhost:3000/api/v1/channels/set -d '{"select":{"feature":"log/append-text"},"value":{"String":"Hello, world"}}' | ||
=== Tags === | === Tags === | ||
* Assign Tags to a channel | * Assign Tags to a channel | ||
** POST http://localhost:3000/api/v1/channels/ | ** POST http://localhost:3000/api/v1/channels/channel/tags {"channel": selector(s), "tags": tag(s)} | ||
* Remove Tags of a channel | * Remove Tags of a channel | ||
** DELETE http://localhost:3000/api/v1/channels/ | ** DELETE http://localhost:3000/api/v1/channels/channel/tags {"channel": selector(s), "tags": tag(s)} | ||
= Specific services and channels = | = Specific services and channels = | ||
edits