Connected Devices/Projects/Project Link/Taxonomy: Difference between revisions

Jump to navigation Jump to search
→‎Channels: Updated to Decentralized API
(→‎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|object `kind` (see ChannelKind): accept only channels of a given kind.
* (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
     PUT http://localhost:3000/api/v1/channels/get selector(s)
     POST http://localhost:3000/api/v1/channels selector(s)


<br/>
<br/>


Example:
Example:
     PUT http://localhost:3000/api/v1/channels/get [{"tags": "location: entrance", kind: "OpenClosed"}
     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":{"kind":"Log"},"value":{"String":"Hello, world"}}'
     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/getter/tags {"getter": selector(s), "tags": tag(s)}
** POST http://localhost:3000/api/v1/channels/channel/tags {"channel": selector(s), "tags": tag(s)}
** POST http://localhost:3000/api/v1/channels/setter/tags {"setter": selector(s), "tags": tag(s)}


* Remove Tags of a channel
* Remove Tags of a channel
** DELETE http://localhost:3000/api/v1/channels/getter/tags {"getter": selector(s), "tags": tag(s)}
** DELETE http://localhost:3000/api/v1/channels/channel/tags {"channel": selector(s), "tags": tag(s)}
** DELETE http://localhost:3000/api/v1/channels/setter/tags {"setter": selector(s), "tags": tag(s)}
 


= Specific services and channels =
= Specific services and channels =
184

edits

Navigation menu