Skip to content

TRes RESTful Interface

Daniele Alessandrelli edited this page Aug 22, 2013 · 5 revisions

T-Res RESTful Interface

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.

Task Registry (/tasks) methods

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

T-Res Task (/tasks/<task_name>) methods

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

Input Source (/tasks/<task_name>/is) methods

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

Output Destination (/tasks/<task_name>/od) methods

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

Processing Function (/tasks/<task_name>/pf) methods

Method Description Request CT Response CT
GET Returns the processing function None Application/octet-stream
PUT Sets the processing function Application/octet-stream None
POST Not allowed
DELETE Deletes the processing function None None

Last Output (/tasks/<task_name>/lo) methods

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.