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

From MozillaWiki
Jump to navigation Jump to search
(→‎Service List: + Mucho details)
Line 11: Line 11:


=== Service List ===
=== Service List ===
* To get list of services:
Services may requested by selector. A service selector is an object with the following fields:
 
* (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) object or array of objects `getters` (see GetterSelector): accept only services with channels matching all the selectors in this array;
* (optional) object or array of objects `setters` (see SetterSelector): accept only services with channels matching all the selectors in this array.
 
The GET accepts 0, 1 or an array of service selectors and will return all the services that match any of the selectors.
 
Example with 1 selector:
 
* Get services with tag "location: kitchen" and channel kind "OvenTemperature"
** GET http://localhost:3000/api/v1/services { tags: "location: kitchen", setters: { kind: "OvenTemperature" } }
 
Example with 2 selectors:
 
* Get services with tag "location: kitchen" or "location: entrance":
** GET http://localhost:3000/api/v1/services [{ tags: "location: kitchen" }, {tags: "location: entrance"}]
 
As a shortcut, providing no argument will locate all services:
 
* Get all services:
** GET http://localhost:3000/api/v1/services
** GET http://localhost:3000/api/v1/services



Revision as of 16:41, 1 April 2016

Taxonomy Documentation

Github Link: http://fxbox.github.io/taxonomy/doc/foxbox_taxonomy/index.html

Current REST API Examples

Account

Service List

Services may requested by selector. A service selector is an object with the following fields:

  • (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) object or array of objects `getters` (see GetterSelector): accept only services with channels matching all the selectors in this array;
  • (optional) object or array of objects `setters` (see SetterSelector): accept only services with channels matching all the selectors in this array.

The GET accepts 0, 1 or an array of service selectors and will return all the services that match any of the selectors.

Example with 1 selector:

  • Get services with tag "location: kitchen" and channel kind "OvenTemperature"

Example with 2 selectors:

As a shortcut, providing no argument will locate all services:

Channels

Time

Camera

Tags

Recipe

  • Send Recipe
  • List available Recipes

WebPush