openApiDescription.yaml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. openapi: 3.0.3
  2. info:
  3. title: SensLog 2.0
  4. version: 1.0.0
  5. externalDocs:
  6. description: Find out more about SensLog
  7. url: http://senslog.org
  8. servers:
  9. - url: http://localhost:8080/senslog/api
  10. tags:
  11. - name: "Version 1"
  12. description: "Origin version of public API"
  13. - name: "Version 2"
  14. description: "New version of public API"
  15. paths:
  16. /v1/FeederServlet:
  17. post:
  18. tags:
  19. - Version 1
  20. operationId: insertionToSenslog
  21. parameters:
  22. - in: header
  23. name: X-Auth-Token
  24. description: "JWT token to authenticate a content."
  25. schema:
  26. type: string
  27. format: jwt
  28. - name: Operation
  29. in: query
  30. required: true
  31. schema:
  32. type: string
  33. enum:
  34. - InsertObservation
  35. - InsertPosition
  36. - InsertAlertEvent
  37. - SolvingAlertEvent
  38. - name: unit_id
  39. in: query
  40. description: "Identifier of unit. Avaliable only for operation types: [InsertObservation, InsertPosition]"
  41. schema:
  42. type: integer
  43. format: int64
  44. - name: sensor_id
  45. in: query
  46. description: "Identifier of sensor. Avaliable only for operation types: [InsertObservation]"
  47. schema:
  48. type: integer
  49. format: int64
  50. - name: date
  51. in: query
  52. description: "Timestamp of measured value (e.g. 2015-07-15 12:00:00+0200). Avaliable only for operation types: [InsertObservation, InsertPosition]"
  53. schema:
  54. type: string
  55. - name: value
  56. in: query
  57. description: "Measured value. Avaliable only for operation types: [InsertObservation]"
  58. schema:
  59. type: number
  60. format: double
  61. - name: lat
  62. in: query
  63. description: "Latitude of position. Avaliable only for operation types: [InsertPosition]"
  64. schema:
  65. type: number
  66. format: double
  67. - name: lon
  68. in: query
  69. description: "Longitude of position. Avaliable only for operation types: [InsertPosition]"
  70. schema:
  71. type: number
  72. format: double
  73. - name: alt
  74. in: query
  75. description: "Altitude of position in meters. Avaliable only for operation types: [InsertPosition]"
  76. schema:
  77. type: number
  78. format: double
  79. - name: speed
  80. in: query
  81. description: "Speed of the unit. Avaliable only for operation types: [InsertPosition]"
  82. schema:
  83. type: number
  84. format: double
  85. - name: dop
  86. in: query
  87. description: "Dilution of precision. Avaliable only for operation types: [InsertPosition]"
  88. schema:
  89. type: integer
  90. format: int32
  91. responses:
  92. 200:
  93. description: "Successfull operation."
  94. content:
  95. text/plain:
  96. schema:
  97. type: boolean
  98. 400:
  99. description: "Invalid parameter value."
  100. content:
  101. text/plain:
  102. schema:
  103. type: object
  104. properties:
  105. timestamp:
  106. type: integer
  107. description: "Epoch time"
  108. example: 1609459200
  109. message:
  110. type: string
  111. description: "Description of failure."
  112. example: "Parameter 'unit_id' is not a number."
  113. 406:
  114. description: Invalid operation type
  115. content:
  116. text/plain:
  117. schema:
  118. type: object
  119. properties:
  120. timestamp:
  121. type: integer
  122. description: "Epoch time"
  123. example: 1609459200
  124. message:
  125. type: string
  126. description: "Description of failture."
  127. example: "Unsupported operation 'WrongOperation'."
  128. /v1/SensorService:
  129. get:
  130. tags:
  131. - Version 1
  132. operationId: sensorService
  133. parameters:
  134. - name: Operation
  135. in: query
  136. required: true
  137. schema:
  138. type: string
  139. enum:
  140. - GetLastObservations
  141. - GetSensors
  142. - GetObservations
  143. - name: group
  144. in: query
  145. description: "Name of group of units. Can be used with 'sensor_id' parameter. Avaliable only for operation types: [GetLastObservations]"
  146. schema:
  147. type: string
  148. - name: unit_id
  149. in: query
  150. description: "Identifier of unit. Can be used with 'sensor_id' parameter. Avaliable only for operation types: [GetLastObservations]"
  151. schema:
  152. type: integer
  153. format: int64
  154. - name: sensor_id
  155. in: query
  156. description: "Identifier of sensor.\n Avaliable only for operation types: [GetLastObservations]"
  157. schema:
  158. type: integer
  159. format: int64
  160. responses:
  161. 200:
  162. description: "List of observations."
  163. content:
  164. application/json:
  165. schema:
  166. type: array
  167. items:
  168. type: object
  169. properties:
  170. unit_id:
  171. type: integer
  172. format: int64
  173. example: 1230000
  174. sensor_id:
  175. type: integer
  176. format: int64
  177. example: 2830001
  178. value:
  179. type: number
  180. format: double
  181. example: 0.3453
  182. time_stamp:
  183. type: string
  184. example: "2021-03-15 12:00:00+02"
  185. 400:
  186. description: "Invalid parameter value."
  187. content:
  188. application/json:
  189. schema:
  190. type: object
  191. properties:
  192. timestamp:
  193. type: integer
  194. description: "Epoch time"
  195. example: 1609459200
  196. message:
  197. type: string
  198. description: "Description of failture."
  199. example: "Parameter 'unit_id' is not a number."
  200. 406:
  201. description: "Invalid operation type"
  202. content:
  203. application/json:
  204. schema:
  205. type: object
  206. properties:
  207. timestamp:
  208. type: integer
  209. description: "Epoch time"
  210. example: 1609459200
  211. message:
  212. type: string
  213. description: "Description of failture."
  214. example: "Unsupported operation 'WrongOperation'."
  215. /info:
  216. get:
  217. tags:
  218. - "Version 2"
  219. operationId: info
  220. responses:
  221. 200:
  222. description: "General information about running server."
  223. content:
  224. application/json:
  225. schema:
  226. type: object
  227. properties:
  228. uptime:
  229. type: string
  230. example: "10 min 05 sec"
  231. appVersion:
  232. type: string
  233. example: "1.3.5"
  234. buildVersion:
  235. type: string
  236. example: "1609459200"
  237. components: {}