Skip to content

Backend

Herbert Wirnsberger edited this page Jun 9, 2017 · 24 revisions

REST-Service

Implementation

Swagger

Swagger (http://swagger.io/) is used to generate the Interface for the REST-Service. For the generation, the Maven-Plugin swagger-codegen-maven-plugin is used. Under <configOptions>, the configuration for the codegeneration can be specified, eg package name. Files and directories listed in /ignore.txt, will not be generated by swagger-codegen. The generated files can be found under target/generated-sources/swagger. target/genearted-sources/swagger/main is used as a source directory in order to provide the files.

Usage

Sensor Data is stored in the MongoDB. The following data can be retrieved over REST services:

Sensor names:

https://hogajama-57-hogarama.cloud.itandtel.at/hogajama-rs/rest/sensor/

Sensor data:

https://hogajama-57-hogarama.cloud.itandtel.at/hogajama-rs/rest/sensor/allData

Resultset can be limited by

  • maximum number of data points: add ?maxNumber=yourNumber
  • sensor name: add ?sensor=yourSensorName
  • both: add ?maxNumber=yourNumber&&sensor=yourSensorName

For example: https://hogajama-57-hogarama.cloud.itandtel.at/hogajama-rs/rest/sensor/allData?maxNumber=10&&sensor=Pflanze