184
edits
(→Specific services and channels: Decentralized Taxonomy) |
(→Channels: + Feature is now required) |
||
| Line 53: | Line 53: | ||
A selector is an object with the following fields: | A selector is an object with the following fields: | ||
* (required for Fetch/Send, optional in other cases) string `feature`: accept only channels that implement a given feature (e.g. "oven/temperature-celcius") | |||
* (optional) string id: accept only a channel with a given id; | * (optional) string id: accept only a channel with a given id; | ||
* (optional) string `service`: accept only channels of a service with a given id; | * (optional) string `service`: accept only channels of a service with a given id; | ||
* (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; | ||
Generally, except for (de)assigning tags, '''using an id is considered a bad idea''', as this ties the application to a specific device, and this will fail if the device is replaced (consider that this is equivalent to using an IP address instead of a domain name). | Generally, except for (de)assigning tags, '''using an id is considered a bad idea''', as this ties the application to a specific device, and this will fail if the device is replaced (consider that this is equivalent to using an IP address instead of a domain name). | ||
| Line 82: | Line 81: | ||
* Send a bunch of values to all channels matching any of the selectors: | * Send a bunch of values to all channels matching any of the selectors: | ||
PUT http://localhost:3000/api/v1/channels/set [{"select": selector(s), "value": value}, {"select": selector(s), "value: value}, ...] | PUT http://localhost:3000/api/v1/channels/set [{"select": selector(s), "value": value}, {"select": selector(s), "value": value}, ...] | ||
Values are defined by Adapters, so you should check the documentation of individual adapters to see what is possible. | |||
==== Example (with CURL) ==== | ==== Example (with CURL) ==== | ||
edits