forked from contiki-os/contiki
-
Notifications
You must be signed in to change notification settings - Fork 4
TRes RESTful Interface
Daniele Alessandrelli edited this page Aug 22, 2013
·
5 revisions
The T-Res RESTful interface allows adding, modifying, and deleting T-Res tasks.
As shown by the following example, the interface is hierarchical.
/tasks
/tasks/<task_name>
/tasks/<task_name>/is
/tasks/<task_name>/od
/tasks/<task_name>/pf
/tasks/<task_name>/lo
Every T-res task is a sub-resource of /tasks
, the Task Registry resource. Moreover, every T-Res task has four sub-resources:
-
/is
, the input source resource; -
/od
, the output destination resource; -
/pf
, the processing function resource; and -
/lo
, the last output resource.
Method | Description | Request CT | Response CT |
---|---|---|---|
GET | Returns the list of installed T-Res tasks | None | CoRE link format |
PUT | Not allowed | None | None |
POST | Not allowed | ||
DELETE | Deletes a T-Res task | None | None |
Method | Description | Request CT | Response CT |
---|---|---|---|
GET | Returns the list of sub-resources | None | CoRE link format |
PUT | Creates a new (empty) T-Res task | None | None |
POST | Toggles task activation | None | Text/Plain |
DELETE | Deletes the T-Res task | None | None |
Method | Description | Request CT | Response CT |
---|---|---|---|
GET | Returns the list of input sources | None | CoRE link format |
PUT | Sets the input source(s) | CoRE link format | None |
POST | Adds one or more input sources | CoRE link format | None |
DELETE | Removes every input sources | None | None |
Method | Description | Request CT | Response CT |
---|---|---|---|
GET | Returns the output destination | None | CoRE link format |
PUT | Sets the output destination | CoRE link format | None |
POST | Not allowed | ||
DELETE | Removes the output destination | None | None |
Method | Description | Request CT | Response CT |
---|---|---|---|
PUT | Sets the processing function | Application/octet-stream | None |
POST | Not allowed | ||
DELETE | Deletes the processing function | None | None |
Method | Description | Request CT | Response CT |
---|---|---|---|
GET (obs) | Returns task's last output | None | Text/Plain |
PUT | Not allowed | ||
POST | Not allowed | ||
DELETE | Not allowed |
NOTE: the /lo
resource is observable.