184
edits
(→WebPush: add the new auth parameter) |
(→Services: Updated to Decentralized Taxonomy) |
||
| Line 16: | Line 16: | ||
* (optional) string `id`: accept only a service with a given id; | * (optional) string `id`: accept only a service with a given id; | ||
* (optional) string array of string `tags`: accept only services with all the tags in the array; | * (optional) string array of string `tags`: accept only services with all the tags in the array; | ||
* (optional) object or array of objects ` | * (optional) object or array of objects `channels` (see ChannelSelector): accept only services with channels matching all the selectors in this 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 24: | Line 23: | ||
Example with 1 selector: | Example with 1 selector: | ||
* Get services with tag "location: kitchen" and channel | * Get services with tag "location: kitchen" and a channel with feature "oven/temperature-celcius" | ||
** GET http://localhost:3000/api/v1/services { tags: "location: kitchen", | ** GET http://localhost:3000/api/v1/services { "tags": "location: kitchen", "channels": { "feature": "oven/temperature-celcius" } } | ||
Example with 2 selectors: | Example with 2 selectors: | ||
| Line 46: | Line 45: | ||
* Example | * Example | ||
** POST http://localhost:3000/api/v1/services/tags {"services":[{"id":"thinkerbell-root-service"}],"tags":[" | ** POST http://localhost:3000/api/v1/services/tags {"services":[{"id":"thinkerbell-root-service"}],"tags":["location:living-room"] } | ||
== Channels == | == Channels == | ||
edits