Guide for Extensions

3 Testbed Provider Services (Testbed to FIESTA-IoT)

3.2 TPS API Definition

The 1st Table below illustrates the main API primitives that support the Testbed Provider Services functionalities, while 2nd Table provides more details about each one of the functions that comprise the API.

List of primitives comprising the Testbed Provider Services API

<<interface>>

TpiServicesInterface

---

POST:getLastObservations (getLastObservationsPayload:JsonObject): 

String annotatedMeasurements,

POST:getObservations (getObservationsPayload:JsonObject):

String annotatedMeasurements,

POST:pushLastObservations (pushLastObservationsPayload:JsonObject):String

POST:stopPushOfObservations (stopPushOfObservationsPayload:JsonObject):String



A Testbed SHALL implement methods of the Testbed Provider Services API as specified in 2nd Table below:

Testbed Provider Services API definition

Service Name

Input

Output

Info

getLastObservations

JsonObject getLastObservationsPayload

Response (String annotatedMeasurements, HttpHeaders Content-Type)

This service provides the latest values of a specific Sensor list within an annotated document once. It also provides the annotated document’s Content-Type. The acceptable content types are listed below.

getObservations

JsonObject  getObservationsPayload

Response (String annotatedMeasurements, HttpHeaders Content-Type) 

This service provides the values of a specific Sensor list for a specific time period within an annotated document once. It also provides the annotated document’s Content-Type. The acceptable content types are listed below.

pushLastObservations

JsonObject pushLastObservations Payload

Response (String successMessage)

This service pushes continuously the last values of a specific Sensor list to a specific endpoint. The Response SHOULD contain the stopPushOfObservations endpoint URL.

stopPushOfObservations

JsonObject stopPushOfObservationsPayload

Response (String successMessage)

This service stops the pushing of the observations for a list of sensors to an endpoint.

The accepted content types (Content-Type) mentioned above are:
• application/ld+json
• application/n-quads
• application/n-triples
• application/n3
• application/rdf+json
• application/rdf+thrift
• application/rdf+xml
• application/trig
• application/trix
• application/trix+xml
• application/turtle
• application/x-trig
• application/x-turtle
• null/rdf
• text/csv
• text/n-quads
• text/n3
• text/nquads
• text/plain
• text/rdf+n3
• text/trig
• text/turtle



Object Definition

The analysis of the JSON objects that are introduced in the previous section is provided below:

Definition of getLastObservationsPayload object:

{

    "sensorIDs": [<String> sensorIDs]

}

 

Definition of getObservationsPayload object:

{

     "sensorIDs": [<String> sensorIDs],

     "startDate": <Date> startDate,

     "stopDate": <Date> stopDate

}

Note: the Date has ISO 8601 date and time format ("yyyy-MM-ddThh:mm:ss") in UTC and the start date precedes the stop date in time. If the startDate and the stopDate appear in other format, they have to be converted to the above one.

Definition of pushLastObservationsPayload object:

{

    "sensorIDs": [<String> sensorIDs],

    "endpointURI": <String> theEndpointURI

}

Definition of stopPushOfObservations object:

{

    "sensorIDs": [<String> sensorIDs],

    "endpointURI": <String> theEndpointURI

}