openApiDescription.yaml 7.3 KB

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