source: src/mapservice/openapi.yaml@ 306f18a

debian/bullseye
Last change on this file since 306f18a was 306f18a, checked in by Joachim Langenbach <joachim.langenbach@…>, 7 years ago
  • added queue table
    • added logview to make the envelope of a log available
    • Added processing state to Log MetaData and Log table
    • Added icons for the processing state from Breeze
  • Property mode set to 100644
File size: 36.1 KB
RevLine 
[3a89adb]1openapi: 3.0.0
2info:
3 title: GNUBoat Mapservice API
4 contact:
5 name: EngSaS - Engineering Solutions and Services Langenbach
6 url: 'http://www.engsas.com'
7 email: info@engsas.de
8 license:
9 name: GPL 3
10 url: 'https://www.gnu.org/licenses/gpl-3.0.en.html'
11 version: v1
12 description: API to upload log files with water depth to GNUBoat server
13servers:
14 - url: 'https://gnuboat.engsas.com/mapservice/{version}'
15 description: The production API server
16 variables:
17 version:
18 default: v1
19 - url: 'http://localhost:8080/mapservice/{version}'
20 description: The local flask development url
21 variables:
22 version:
23 default: v1
24paths:
[ec8d5d0]25 /user:
[be25db1]26 get:
[28198a1]27 description: Returns information of current/authorized user
[be25db1]28 tags:
29 - users
30 summary: Returns info of a user
31 operationId: usersGet
32 security:
33 - basicAuth: []
34 - apiKeyAuth: []
35 responses:
36 '200':
37 description: OK
38 content:
39 application/json:
40 schema:
41 $ref: '#/components/schemas/User'
42 examples:
43 User:
44 $ref: '#/components/examples/User'
45 '400':
46 $ref: '#/components/responses/BadRequest'
47 '401':
48 $ref: '#/components/responses/Unauthorized'
49 post:
50 description: Registers a new user
51 tags:
52 - users
53 summary: Registers a new user
54 operationId: usersRegister
55 requestBody:
56 content:
57 application/json:
58 schema:
59 $ref: '#/components/schemas/UserCreation'
60 examples:
61 Water:
62 $ref: '#/components/examples/UserCreation'
63 responses:
64 '201':
65 description: Userr created
66 content:
67 application/json:
68 schema:
69 $ref: '#/components/schemas/User'
70 examples:
71 Water:
72 $ref: '#/components/examples/User'
73 '400':
74 $ref: '#/components/responses/BadRequest'
75 options:
76 description: Used by CORS preflight
77 tags:
78 - users
79 responses:
80 '200':
81 description: CORS prefilght requests should return 200 as status code
82 content:
[13cbe66]83 application/json: {}
[ec8d5d0]84 /user/apikey_create:
[be25db1]85 get:
86 description: Generates and returns a new API key for current user
87 tags:
88 - users
89 summary: Returns a new API key
90 operationId: usersApiKeyCreate
91 security:
92 - basicAuth: []
93 responses:
94 '200':
95 description: OK
96 content:
97 application/json:
98 schema:
99 $ref: '#/components/schemas/apiKeys'
[13cbe66]100 example: NewApiKey4711
[be25db1]101 '400':
102 $ref: '#/components/responses/BadRequest'
103 '401':
104 $ref: '#/components/responses/Unauthorized'
105 '/user/{api_key}':
106 delete:
107 description: Deletes given API key and returns remaining API keys of the user
108 tags:
109 - users
110 summary: Deletes API key
111 operationId: usersApiKeyDelete
112 security:
113 - basicAuth: []
114 parameters:
115 - name: api_key
116 in: path
117 description: API key
118 required: true
119 schema:
120 $ref: '#/components/schemas/apiKey'
[13cbe66]121 example: DelApiKey4711
[be25db1]122 responses:
123 '200':
124 description: OK
125 content:
126 application/json:
127 schema:
128 $ref: '#/components/schemas/apiKeys'
[13cbe66]129 example: ApiKey4711
[be25db1]130 '400':
131 $ref: '#/components/responses/BadRequest'
132 '401':
133 $ref: '#/components/responses/Unauthorized'
[13cbe66]134 '404':
135 $ref: '#/components/responses/NotFound'
[be25db1]136 '/user/activate/{activation_code}':
137 get:
138 description: Activates a user account
139 tags:
140 - users
141 summary: Activates a user account
142 operationId: usersActivate
143 parameters:
144 - name: activation_code
145 in: path
146 description: Activation code
147 required: true
148 schema:
149 $ref: '#/components/schemas/activationCode'
[13cbe66]150 example: dac9630aec642a428cd73f4be0a03569
[be25db1]151 responses:
152 '302':
153 description: OK or not OK
154 headers:
155 Location:
156 schema:
157 type: string
[13cbe66]158 description: 'URL to the website, showing the result of the activation'
[ec8d5d0]159 /waters:
[3a89adb]160 get:
161 description: Returns all waters
162 tags:
163 - waters
164 summary: Find waters by id
165 operationId: watersGet
166 parameters:
167 - name: name
[be25db1]168 in: query
[3a89adb]169 schema:
[041e464]170 $ref: '#/components/schemas/itemName'
[13cbe66]171 example: Missi
[3a89adb]172 - name: manager
[be25db1]173 in: query
[3a89adb]174 schema:
175 $ref: '#/components/schemas/username'
[13cbe66]176 example: jane
[3a89adb]177 - $ref: '#/components/parameters/orderBy'
178 - $ref: '#/components/parameters/offset'
179 - $ref: '#/components/parameters/limit'
180 responses:
181 '200':
182 description: OK
183 content:
184 application/json:
185 schema:
186 $ref: '#/components/schemas/waters'
187 examples:
188 Waters:
189 $ref: '#/components/examples/waters'
[13cbe66]190 '404':
191 $ref: '#/components/responses/NotFound'
[3a89adb]192 post:
193 description: Adds a new water to the database
194 tags:
195 - waters
196 summary: Add a new water
[be25db1]197 operationId: watersCreate
[3a89adb]198 security:
199 - basicAuth: []
200 - apiKeyAuth: []
201 requestBody:
202 content:
203 application/json:
204 schema:
205 $ref: '#/components/schemas/WaterCreation'
[13cbe66]206 example:
[041e464]207 name: Rhein
208 osmId: 1756854
[13cbe66]209 osmType: Relation
[3a89adb]210 responses:
211 '201':
212 description: Water created
213 content:
214 application/json:
215 schema:
216 $ref: '#/components/schemas/Water'
217 examples:
218 Water:
219 $ref: '#/components/examples/Water'
220 '400':
221 $ref: '#/components/responses/BadRequest'
222 '401':
223 $ref: '#/components/responses/Unauthorized'
224 '/waters/{id}':
225 get:
226 description: Returns the water identified by id
227 tags:
228 - waters
229 summary: Represents a water
[13cbe66]230 operationId: watersGetById
[3a89adb]231 parameters:
232 - name: id
233 in: path
234 description: Item ID
235 required: true
236 schema:
[041e464]237 $ref: '#/components/schemas/itemId'
[3a89adb]238 responses:
239 '200':
240 description: OK
241 content:
242 application/json:
243 schema:
244 $ref: '#/components/schemas/Water'
245 examples:
246 Water:
247 $ref: '#/components/examples/Water'
248 '404':
249 $ref: '#/components/responses/NotFound'
[13cbe66]250 '/waters/{water_id}/gauges':
251 get:
252 description: Returns all gauges of water waterId
253 tags:
254 - waters
255 summary: Find gauges of water waterId by gaugeId
256 operationId: watersGaugesGet
257 parameters:
258 - name: water_id
259 in: path
260 description: Water ID
261 required: true
262 schema:
263 $ref: '#/components/schemas/itemId'
264 - name: name
265 in: query
266 schema:
267 $ref: '#/components/schemas/itemName'
268 example: Missi
269 - name: manager
270 in: query
271 schema:
272 $ref: '#/components/schemas/username'
273 example: jane
274 - $ref: '#/components/parameters/orderBy'
275 - $ref: '#/components/parameters/offset'
276 - $ref: '#/components/parameters/limit'
277 responses:
278 '200':
279 description: OK
280 content:
281 application/json:
282 schema:
283 $ref: '#/components/schemas/Gauges'
284 examples:
285 Gauges:
286 $ref: '#/components/examples/Gauges'
287 application/geo+json:
288 schema:
289 $ref: '#/components/schemas/GaugesGeoJson'
290 examples:
291 Gauge:
292 $ref: '#/components/examples/GaugesGeoJson'
293 post:
294 description: Adds a new gauge for water waterId to the database
295 tags:
296 - waters
297 summary: Add a new water
298 operationId: watersGaugeCreate
299 parameters:
300 - name: water_id
301 in: path
302 description: Water ID
303 required: true
304 schema:
305 $ref: '#/components/schemas/itemId'
306 security:
307 - basicAuth: []
308 - apiKeyAuth: []
309 requestBody:
310 content:
311 application/json:
312 schema:
313 $ref: '#/components/schemas/GaugeCreation'
314 example:
315 name: New Orleans
316 location:
317 - 90.136111
318 - 29.934722
319 responses:
320 '201':
321 description: Gauge created
322 content:
323 application/json:
324 schema:
325 $ref: '#/components/schemas/Gauge'
326 examples:
327 Gauge:
328 $ref: '#/components/examples/Gauge'
329 application/geo+json:
330 schema:
331 $ref: '#/components/schemas/GaugeGeoJson'
332 examples:
333 Gauge:
334 $ref: '#/components/examples/GaugeGeoJson'
335 '400':
336 $ref: '#/components/responses/BadRequest'
337 '401':
338 $ref: '#/components/responses/Unauthorized'
339 '/waters/{water_id}/gauges/{gauge_id}':
340 get:
341 description: Returns the gauge identified by id
342 tags:
343 - waters
344 summary: Represents a gauge
345 operationId: watersGaugeGetById
346 parameters:
347 - name: water_id
348 in: path
349 description: Water ID
350 required: true
351 schema:
352 $ref: '#/components/schemas/itemId'
353 - name: gauge_id
354 in: path
355 description: Gauge ID
356 required: true
357 schema:
358 $ref: '#/components/schemas/itemId'
359 responses:
360 '200':
361 description: OK
362 content:
363 application/json:
364 schema:
365 $ref: '#/components/schemas/Gauge'
366 examples:
367 Gauge:
368 $ref: '#/components/examples/Gauge'
369 application/geo+json:
370 schema:
371 $ref: '#/components/schemas/GaugeGeoJson'
372 examples:
373 Gauge:
374 $ref: '#/components/examples/GaugeGeoJson'
375 '400':
376 $ref: '#/components/responses/BadRequest'
377 '404':
378 $ref: '#/components/responses/NotFound'
[1cd45dd]379 /devices:
[ec8d5d0]380 get:
381 description: Returns all devices of user
382 tags:
383 - devices
384 summary: Find devices by id
385 operationId: devicesGet
386 security:
387 - basicAuth: []
388 - apiKeyAuth: []
389 parameters:
390 - name: name
391 in: query
392 schema:
393 $ref: '#/components/schemas/itemName'
394 example: Love
395 - $ref: '#/components/parameters/orderBy'
396 - $ref: '#/components/parameters/offset'
397 - $ref: '#/components/parameters/limit'
398 responses:
399 '200':
400 description: OK
401 content:
402 application/json:
403 schema:
404 $ref: '#/components/schemas/devices'
405 examples:
406 Devices:
407 $ref: '#/components/examples/devices'
408 '404':
409 $ref: '#/components/responses/NotFound'
410 post:
411 description: Adds a new device to the database
412 tags:
413 - devices
414 summary: Add a new device
415 operationId: devicesCreate
416 security:
417 - basicAuth: []
418 - apiKeyAuth: []
419 requestBody:
420 content:
421 application/json:
422 schema:
423 $ref: '#/components/schemas/DeviceCreation'
424 example:
[1cd45dd]425 name: Lovely Boat
[ec8d5d0]426 sensorDepth: 2
427 responses:
428 '201':
429 description: Device created
430 content:
431 application/json:
432 schema:
433 $ref: '#/components/schemas/Device'
434 examples:
435 Device:
436 $ref: '#/components/examples/Device'
437 '400':
438 $ref: '#/components/responses/BadRequest'
439 '401':
440 $ref: '#/components/responses/Unauthorized'
441 '/devices/{id}':
442 get:
443 description: Returns the device identified by id
444 tags:
445 - devices
446 summary: Represents a device
447 operationId: devicesGetById
448 security:
449 - basicAuth: []
450 - apiKeyAuth: []
451 parameters:
452 - name: id
453 in: path
454 description: Item ID
455 required: true
456 schema:
457 $ref: '#/components/schemas/itemId'
458 responses:
459 '200':
460 description: OK
461 content:
462 application/json:
463 schema:
464 $ref: '#/components/schemas/Device'
465 examples:
466 Water:
467 $ref: '#/components/examples/Device'
468 '404':
469 $ref: '#/components/responses/NotFound'
[1cd45dd]470 delete:
471 description: Deletes given device and returns remaining devices of the user
472 tags:
473 - devices
474 summary: Deletes device
475 operationId: devicesDeviceDelete
476 security:
477 - basicAuth: []
478 - apiKeyAuth: []
479 parameters:
480 - name: id
481 in: path
482 description: Item id
483 required: true
484 schema:
485 $ref: '#/components/schemas/itemId'
486 example: 1
487 responses:
488 '200':
489 description: OK
490 content:
491 application/json:
492 schema:
493 $ref: '#/components/schemas/devices'
494 example:
495 Devices:
496 $ref: '#/components/examples/devices'
497 '400':
498 $ref: '#/components/responses/BadRequest'
499 '401':
500 $ref: '#/components/responses/Unauthorized'
501 '404':
502 $ref: '#/components/responses/NotFound'
[ec9e811]503 /logs:
504 get:
505 description: Returns all log metadata
506 tags:
507 - logs
508 summary: Find logs by id
509 operationId: logsGet
510 parameters:
511 - name: submitter
512 in: query
513 schema:
514 $ref: '#/components/schemas/username'
515 example: jane
516 - $ref: '#/components/parameters/orderBy'
517 - $ref: '#/components/parameters/offset'
518 - $ref: '#/components/parameters/limit'
519 responses:
520 '200':
521 description: OK
522 content:
523 application/json:
524 schema:
525 $ref: '#/components/schemas/logs'
526 examples:
527 Logs:
528 $ref: '#/components/examples/logs'
529 '404':
530 $ref: '#/components/responses/NotFound'
[ac11efe]531 post:
[ec9e811]532 description: Creates a new log from given meta data. The log entries itself, must be uploaded per /logs/{log_id}
[ac11efe]533 tags:
534 - logs
535 summary: Add a new log
536 operationId: logsLogCreate
537 security:
538 - basicAuth: []
539 - apiKeyAuth: []
540 requestBody:
541 content:
[ec9e811]542 application/json:
[ac11efe]543 schema:
[ec9e811]544 $ref: '#/components/schemas/LogCreation'
[ac11efe]545 responses:
546 '201':
547 description: Log created
548 content:
549 application/json:
550 schema:
551 $ref: '#/components/schemas/LogMetaData'
552 examples:
553 LogMetaData:
554 $ref: '#/components/examples/LogMetaData'
555 '400':
556 $ref: '#/components/responses/BadRequest'
557 '401':
558 $ref: '#/components/responses/Unauthorized'
559 '/logs/{log_id}':
560 get:
561 description: Returns the log identified by id
562 tags:
563 - logs
564 summary: Represents a log
565 operationId: logsLogGetById
566 parameters:
567 - name: log_id
568 in: path
569 description: Log ID
570 required: true
571 schema:
572 $ref: '#/components/schemas/itemId'
573 responses:
574 '200':
575 description: OK
576 content:
577 application/json:
578 schema:
579 $ref: '#/components/schemas/Log'
580 examples:
581 Log:
582 $ref: '#/components/examples/Log'
583 application/geo+json:
584 schema:
585 $ref: '#/components/schemas/LogGeoJson'
586 examples:
587 Log:
588 $ref: '#/components/examples/LogGeoJson'
589 '400':
590 $ref: '#/components/responses/BadRequest'
591 '404':
592 $ref: '#/components/responses/NotFound'
[ec9e811]593 post:
594 description: Adds log entries from uploaded file to current Log
595 tags:
596 - logs
597 summary: Add a new log entries
598 operationId: logsLogUpload
599 parameters:
600 - name: log_id
601 in: path
602 description: Log ID
603 required: true
604 schema:
605 $ref: '#/components/schemas/itemId'
606 security:
607 - basicAuth: []
608 - apiKeyAuth: []
609 requestBody:
610 content:
611 text/plain:
612 schema:
613 type: string
614 format: binary
615 responses:
616 '201':
617 description: Logs uploaded
618 content:
619 application/geo+json:
620 schema:
621 $ref: '#/components/schemas/LogGeoJson'
622 examples:
623 Log:
624 $ref: '#/components/examples/LogGeoJson'
625 application/json:
626 schema:
627 $ref: '#/components/schemas/Log'
628 examples:
629 Log:
630 $ref: '#/components/examples/Log'
631 '400':
632 $ref: '#/components/responses/BadRequest'
633 '401':
634 $ref: '#/components/responses/Unauthorized'
[ac11efe]635 delete:
636 description: Deletes given log and returns remaining logs of the gauge
637 tags:
638 - logs
639 summary: Deletes log
640 operationId: logsLogDelete
641 security:
642 - basicAuth: []
643 - apiKeyAuth: []
644 parameters:
645 - name: log_id
646 in: path
647 description: Log ID
648 required: true
649 schema:
650 $ref: '#/components/schemas/itemId'
651 responses:
652 '200':
653 description: OK
654 content:
655 application/json:
656 schema:
657 $ref: '#/components/schemas/logs'
658 example:
659 Devices:
660 $ref: '#/components/examples/logs'
661 '400':
662 $ref: '#/components/responses/BadRequest'
663 '401':
664 $ref: '#/components/responses/Unauthorized'
665 '404':
666 $ref: '#/components/responses/NotFound'
[3a89adb]667components:
668 securitySchemes:
669 basicAuth:
670 type: http
671 scheme: basic
672 x-basicInfoFunc: openapi_server.server_impl.security.Security.auth_basic
673 apiKeyAuth:
674 type: apiKey
675 in: header
676 name: X-API-KEY
677 x-apikeyInfoFunc: openapi_server.server_impl.security.Security.auth_api
678 schemas:
679 username:
680 title: Username
681 type: string
[be25db1]682 apiKey:
683 title: API Key
684 type: string
685 apiKeys:
686 title: Array of API keys
687 type: array
688 items:
689 $ref: '#/components/schemas/apiKey'
690 activationCode:
691 title: Activation code for a User
692 type: string
[041e464]693 itemId:
[3a89adb]694 title: Item ID
695 type: integer
696 format: int32
[041e464]697 itemName:
[3a89adb]698 title: Item Name
699 type: string
[ec9e811]700 itemBase:
701 title: 'Basic, generic item data'
702 type: object
703 properties:
704 label:
705 type: string
706 description: >-
707 A representative name, for the item, which could be understand by
708 the user. Mostly it should be the itemName
709 id:
710 $ref: '#/components/schemas/itemId'
711 url:
712 type: string
713 format: url
714 description: 'Url, where details of the object could be retrieved'
715 required:
716 - label
717 - id
[13cbe66]718 order:
719 title: order
720 enum:
721 - desc
722 - asc
723 type: string
724 default: asc
725 description: |
726 Sort order:
727 * `asc` - Ascending, from A to Z
728 * `desc` - Descending, from Z to A
729 example: asc
[be25db1]730 osmType:
[041e464]731 title: OSM type of item (N|W|R)
[3a89adb]732 type: string
[041e464]733 enum:
734 - Node
735 - Way
736 - Relation
[13cbe66]737 comment:
738 title: Comment of an item
739 type: string
740 point:
741 title: 'Point of type [longitude, latitude]'
742 type: array
743 maxItems: 2
744 minItems: 2
745 items:
746 type: number
747 geoJsonType:
748 title: Type of GeoJSON objects
749 type: string
750 enum:
751 - Feature
752 - Point
[72cc339]753 - LineString
[13cbe66]754 geoJsonPoint:
755 type: object
[72cc339]756 description: GeoJson geometry
[13cbe66]757 externalDocs:
758 url: 'http://geojson.org/geojson-spec.html#id2'
759 properties:
760 type:
761 type: string
762 coordinates:
763 $ref: '#/components/schemas/point'
[72cc339]764 geoJsonLineString:
765 type: object
766 description: GeoJson geometry
767 externalDocs:
768 url: 'http://geojson.org/geojson-spec.html#id3'
769 properties:
770 type:
771 type: string
772 coordinates:
773 type: array
774 items:
775 $ref: '#/components/schemas/point'
[ec8d5d0]776 sensorDepth:
777 type: number
[1cd45dd]778 title: Depth of sensor beneath water level in cm (positive means below water)
[ec8d5d0]779 minimum: 0
[be25db1]780 User:
781 title: User
782 type: object
783 properties:
784 username:
785 $ref: '#/components/schemas/username'
786 email:
787 type: string
788 firstName:
789 type: string
790 lastName:
791 type: string
792 activated:
793 type: boolean
794 apiKeys:
795 $ref: '#/components/schemas/apiKeys'
796 UserCreation:
797 title: User
798 type: object
799 properties:
800 username:
801 $ref: '#/components/schemas/username'
802 email:
803 type: string
804 firstName:
805 type: string
806 lastName:
807 type: string
808 password:
809 type: string
810 required:
811 - username
812 - email
813 - firstName
814 - lastName
815 - password
[3a89adb]816 Water:
817 title: Water
818 type: object
819 properties:
[be25db1]820 waterId:
[041e464]821 $ref: '#/components/schemas/itemId'
[3a89adb]822 name:
[041e464]823 $ref: '#/components/schemas/itemName'
[3a89adb]824 manager:
825 $ref: '#/components/schemas/username'
[be25db1]826 osmId:
[041e464]827 $ref: '#/components/schemas/itemId'
[be25db1]828 osmType:
829 $ref: '#/components/schemas/osmType'
[13cbe66]830 gauges:
831 $ref: '#/components/schemas/Gauges'
[72cc339]832 logs:
[ac11efe]833 $ref: '#/components/schemas/logs'
[3a89adb]834 required:
[be25db1]835 - waterId
[3a89adb]836 - name
837 WaterCreation:
[ec8d5d0]838 title: Water for Creation
[3a89adb]839 type: object
840 properties:
841 name:
[041e464]842 $ref: '#/components/schemas/itemName'
[be25db1]843 osmId:
[041e464]844 $ref: '#/components/schemas/itemId'
[be25db1]845 osmType:
846 $ref: '#/components/schemas/osmType'
[3a89adb]847 required:
848 - name
849 waters:
850 title: waters
851 type: array
852 items:
853 $ref: '#/components/schemas/Water'
[13cbe66]854 Gauge:
855 title: Gauge
856 type: object
857 properties:
858 gaugeId:
859 $ref: '#/components/schemas/itemId'
860 name:
861 $ref: '#/components/schemas/itemName'
862 manager:
863 $ref: '#/components/schemas/username'
864 location:
865 $ref: '#/components/schemas/point'
[72cc339]866 logs:
[ac11efe]867 $ref: '#/components/schemas/logs'
[13cbe66]868 comment:
869 $ref: '#/components/schemas/comment'
870 required:
871 - gaugeId
872 - name
873 - location
874 GaugeCreation:
875 title: Gauge for Creation
876 type: object
877 properties:
878 name:
879 $ref: '#/components/schemas/itemName'
880 location:
881 $ref: '#/components/schemas/point'
[ec9e811]882 water:
883 $ref: '#/components/schemas/itemBase'
[13cbe66]884 comment:
885 $ref: '#/components/schemas/comment'
886 required:
887 - name
888 - location
889 Gauges:
890 title: Gauges
891 type: array
892 items:
893 $ref: '#/components/schemas/Gauge'
894 GaugeGeoJson:
[72cc339]895 title: Gauge in GeoJson format
[13cbe66]896 type: object
897 properties:
898 type:
899 $ref: '#/components/schemas/geoJsonType'
900 geometry:
901 $ref: '#/components/schemas/geoJsonPoint'
902 properties:
903 type: object
904 properties:
905 name:
906 $ref: '#/components/schemas/itemName'
907 manager:
908 $ref: '#/components/schemas/username'
909 comment:
910 $ref: '#/components/schemas/comment'
911 required:
912 - name
913 required:
914 - type
915 - geometry
916 - properties
917 GaugesGeoJson:
918 title: Gauges in GeoJson format
919 type: array
920 items:
921 $ref: '#/components/schemas/GaugeGeoJson'
[ec8d5d0]922 Device:
923 title: Device
924 type: object
925 properties:
926 deviceId:
927 $ref: '#/components/schemas/itemId'
928 name:
929 $ref: '#/components/schemas/itemName'
930 sensorDepth:
931 $ref: '#/components/schemas/sensorDepth'
[ac11efe]932 logs:
933 $ref: '#/components/schemas/logs'
[ec8d5d0]934 comment:
[1cd45dd]935 $ref: '#/components/schemas/comment'
[ec8d5d0]936 required:
937 - deviceId
938 - name
939 - sensorDepth
940 DeviceCreation:
941 title: Device for Creation
942 type: object
943 properties:
944 name:
945 $ref: '#/components/schemas/itemName'
946 sensorDepth:
947 $ref: '#/components/schemas/sensorDepth'
948 comment:
[1cd45dd]949 $ref: '#/components/schemas/comment'
[ec8d5d0]950 required:
951 - name
952 - sensorDepth
953 devices:
954 title: Devices
955 type: array
956 items:
957 $ref: '#/components/schemas/Device'
[72cc339]958 GaugeLevel:
959 title: 'Absolute Level of the gauge, at the time of measuring'
960 type: number
961 format: float
962 LogEntry:
963 title: Measurement in a Log
964 type: object
965 properties:
966 datetime:
967 type: string
968 format: date-time
969 location:
970 $ref: '#/components/schemas/point'
971 waterDepth:
972 title: Measured water depth at current position
973 type: number
974 format: float
[ac11efe]975 required:
976 - datetime
977 - location
[72cc339]978 LogMetaData:
979 title: 'Metadata of a log, without log entries'
980 type: object
981 properties:
982 logId:
983 $ref: '#/components/schemas/itemId'
984 submitter:
[ac11efe]985 $ref: '#/components/schemas/username'
[72cc339]986 water:
[ec9e811]987 $ref: '#/components/schemas/itemBase'
[72cc339]988 device:
[ec9e811]989 $ref: '#/components/schemas/itemBase'
[72cc339]990 gauge:
[ec9e811]991 $ref: '#/components/schemas/itemBase'
[72cc339]992 gaugeLevel:
993 $ref: '#/components/schemas/GaugeLevel'
994 start:
[ac11efe]995 title: Date and Time of the first log entry in UTC timezone
[72cc339]996 type: string
997 format: date-time
998 end:
[ac11efe]999 title: Date and Time of the last log entry in UTC timezone
[72cc339]1000 type: string
1001 format: date-time
[306f18a]1002 processingState:
1003 $ref: '#/components/schemas/itemBase'
[72cc339]1004 entriesCount:
1005 title: Number of measurings in the log
1006 type: integer
1007 format: int64
1008 comment:
1009 $ref: '#/components/schemas/comment'
1010 required:
1011 - gaugeLevel
1012 - start
1013 - end
1014 - entriesCount
1015 Log:
1016 title: A collection of LogEntries
1017 type: object
1018 properties:
1019 metaData:
1020 $ref: '#/components/schemas/LogMetaData'
1021 entries:
1022 title: Log entries
1023 type: array
1024 items:
1025 $ref: '#/components/schemas/LogEntry'
1026 required:
1027 - metaData
1028 - entries
1029 LogCreation:
1030 title: Log for Creation
1031 type: object
1032 properties:
1033 water:
[ac11efe]1034 $ref: '#/components/schemas/itemId'
[72cc339]1035 device:
[ac11efe]1036 $ref: '#/components/schemas/itemId'
[72cc339]1037 gauge:
[ac11efe]1038 $ref: '#/components/schemas/itemId'
[72cc339]1039 gaugeLevel:
1040 $ref: '#/components/schemas/GaugeLevel'
1041 comment:
1042 $ref: '#/components/schemas/comment'
1043 required:
1044 - water
1045 - device
1046 - gauge
1047 - gaugeLevel
1048 logs:
1049 title: Logs
1050 type: array
1051 items:
[ac11efe]1052 $ref: '#/components/schemas/LogMetaData'
[72cc339]1053 LogGeoJson:
1054 title: Log in GeoJson format
1055 type: object
1056 properties:
1057 type:
1058 $ref: '#/components/schemas/geoJsonType'
1059 geometry:
1060 $ref: '#/components/schemas/geoJsonLineString'
1061 properties:
1062 type: object
1063 additionalProperties:
1064 type: object
1065 properties:
1066 name:
1067 type: string
1068 item:
1069 title: >-
1070 LogEntry as GeoJson property ordered in same order as geometry
1071 coordinates
1072 type: object
1073 properties:
1074 datetime:
1075 type: string
1076 format: date-time
1077 waterDepth:
1078 $ref: '#/components/schemas/itemName'
1079 comment:
1080 $ref: '#/components/schemas/comment'
1081 required:
1082 - datetime
1083 - waterDepth
1084 required:
1085 - type
1086 - geometry
1087 - properties
[3a89adb]1088 HttpError:
1089 title: HTTP Error Response Object
1090 type: object
1091 properties:
[1cd45dd]1092 type:
[72cc339]1093 type: string
[1cd45dd]1094 title:
[72cc339]1095 type: string
[1cd45dd]1096 detail:
[72cc339]1097 type: string
[1cd45dd]1098 instance:
[72cc339]1099 type: string
[3a89adb]1100 required:
[1cd45dd]1101 - type
1102 - title
1103 - detail
1104 - instance
[3a89adb]1105 parameters:
1106 orderBy:
[ec9e811]1107 name: order_by
[3a89adb]1108 in: query
1109 description: 'Order by field: name'
1110 schema:
1111 type: string
1112 default: name
[13cbe66]1113 example: name
[3a89adb]1114 order:
1115 name: order
1116 in: query
1117 description: Order
1118 schema:
1119 $ref: '#/components/schemas/order'
[be25db1]1120 example: ''
[3a89adb]1121 offset:
1122 name: offset
1123 in: query
1124 description: >-
1125 Skip over a number of elements by specifying an offset value for the
1126 query
1127 schema:
1128 type: integer
1129 format: int32
1130 default: 0
1131 example: 0
1132 limit:
1133 name: limit
1134 in: query
1135 description: Limit the number of elements on the response
1136 style: form
1137 explode: true
1138 schema:
1139 type: integer
1140 format: int32
1141 default: 10
1142 example: 10
1143 examples:
[be25db1]1144 User:
1145 value:
1146 username: jane
1147 email: jane@example.org
1148 firstName: Jane
1149 lastName: Doe
1150 activated: true
1151 apiKeys:
1152 - ApiKey4701
1153 UserCreation:
1154 value:
1155 username: richard
1156 email: richard@examle.org
1157 firstName: Richard
1158 lastName: Roe
1159 password: sdfl.1238_ASDkeil?
[3a89adb]1160 Water:
1161 value:
[be25db1]1162 waterId: 1
[3a89adb]1163 name: Mississippi
[be25db1]1164 osmId: 1756854
1165 osmType: R
[3a89adb]1166 summary: A water example object
1167 WaterCreation:
1168 value:
1169 name: Mississippi
[be25db1]1170 osmId: 1756854
[13cbe66]1171 osmType: Relation
[3a89adb]1172 summary: A water example object for creation of a water
1173 waters:
1174 value:
[be25db1]1175 - waterId: 1
[13cbe66]1176 name: Mississippi
[be25db1]1177 osmId: 1756854
[13cbe66]1178 osmType: Relation
[be25db1]1179 - waterId: 2
[13cbe66]1180 name: Bodensee
[3a89adb]1181 summary: A sample list with waters
[13cbe66]1182 Gauge:
1183 value:
1184 gaugeId: 1
1185 name: New Orleans
1186 manager: jane
1187 location:
1188 - 90.136111
1189 - 29.934722
1190 comment: Gauge for Mississippi in New Orleans
1191 Gauges:
1192 value:
1193 - gaugeId: 1
1194 name: New Orleans
1195 manager: jane
1196 location:
1197 - 90.136111
1198 - 29.934722
1199 summary: A sample list of gauges
1200 GaugeGeoJson:
1201 value:
1202 type: Feature
1203 geometry:
1204 type: Point
1205 coordinates:
1206 - 90.136111
[ec8d5d0]1207 - 29.934722
[13cbe66]1208 properties:
1209 name: New Orleans
1210 manager: jane
1211 comment: Gauge for Mississippi in New Orleans
1212 GaugesGeoJson:
1213 value:
1214 - type: Feature
1215 geometry:
1216 type: Point
1217 coordinates:
1218 - 90.136111
[ec8d5d0]1219 - 29.934722
[13cbe66]1220 properties:
1221 name: New Orleans
1222 manager: jane
1223 comment: Gauge for Mississippi in New Orleans
1224 summary: A sample list of gauges in GeoJson format
[ec8d5d0]1225 Device:
1226 value:
1227 deviceId: 1
1228 name: Lovely Boat
1229 sensorDepth: 0.2
1230 comment: Really a pleasure to measure
1231 summary: A sample device
1232 devices:
1233 value:
1234 - deviceId: 1
1235 name: Lovely Boat
1236 sensorDepth: 0.2
1237 comment: Really a pleasure to measure
[72cc339]1238 LogMetaData:
1239 value:
1240 logId: 1
1241 submitter:
1242 userId: 1
1243 name: Jane
1244 device:
1245 deviceId: 1
1246 name: Lovely Boat
1247 sensorDepth: 0.2
1248 gauge:
1249 gaugeId: 1
1250 name: New Orleans
1251 manager: jane
1252 location:
1253 - 90.136111
1254 - 29.934722
1255 gaugeLevel: 8
1256 start: 2017-07-21T10:32:28.000Z
1257 end: 2017-07-21T17:32:28.000Z
1258 entriesCount: 12600
1259 Log:
1260 value:
1261 metaData:
1262 logId: 1
1263 submitter:
1264 userId: 1
1265 name: Jane
1266 device:
1267 deviceId: 1
1268 name: Lovely Boat
1269 sensorDepth: 0.2
1270 gauge:
1271 gaugeId: 1
1272 name: New Orleans
1273 manager: jane
1274 location:
1275 - 90.136111
1276 - 29.934722
1277 gaugeLevel: 8
1278 start: 2017-07-21T10:32:28.000Z
1279 end: 2017-07-21T17:32:28.000Z
1280 entriesCount: 1
[ec9e811]1281 entries:
1282 - datetime: null
1283 location:
1284 - 90.136111
1285 - 29.934722
1286 waterDepth: 10
[72cc339]1287 LogGeoJson:
1288 value:
1289 type: Feature
1290 geometry:
1291 type: LineString
1292 coordinates:
1293 - - 90.136111
1294 - 29.934722
1295 - - 90.236111
1296 - 30.034722
1297 properties:
1298 prop0:
1299 datetime: 2017-07-21T10:32:28.000Z
1300 waterDepth: 10
1301 prop1:
1302 datetime: 2017-07-21T11:32:28.000Z
1303 waterDepth: 5
1304 logs:
1305 value:
1306 - logId: 1
1307 submitter:
1308 userId: 1
1309 name: Jane
1310 device:
1311 deviceId: 1
1312 name: Lovely Boat
1313 sensorDepth: 0.2
1314 gauge:
1315 gaugeId: 1
1316 name: New Orleans
1317 manager: jane
1318 location:
1319 - 90.136111
1320 - 29.934722
1321 gaugeLevel: 8
1322 start: 2017-07-21T10:32:28.000Z
1323 end: 2017-07-21T17:32:28.000Z
1324 entriesCount: 12600
[3a89adb]1325 HttpError:
1326 value:
[72cc339]1327 type: 'http://example.com/waters/not-found'
1328 title: Water 1 not found
1329 detail: There is no water with id 1 in database
1330 instance: 'http://example.net/waters/1'
[3a89adb]1331 responses:
1332 BadRequest:
1333 description: Bad Request (400)
1334 content:
[1cd45dd]1335 application/problem+json:
[3a89adb]1336 schema:
1337 $ref: '#/components/schemas/HttpError'
1338 examples:
1339 HttpError:
1340 $ref: '#/components/examples/HttpError'
1341 Unauthorized:
1342 description: Unauthorized (401) acces to resource
1343 content:
[1cd45dd]1344 application/problem+json:
[3a89adb]1345 schema:
1346 $ref: '#/components/schemas/HttpError'
1347 examples:
1348 HttpError:
1349 $ref: '#/components/examples/HttpError'
1350 NotFound:
1351 description: Water with given Id not found
1352 content:
[1cd45dd]1353 application/problem+json:
[3a89adb]1354 schema:
1355 $ref: '#/components/schemas/HttpError'
1356 examples:
1357 HttpError:
1358 $ref: '#/components/examples/HttpError'
1359tags:
1360 - name: waters
1361 description: >-
1362 A water is a river (like Mississippi, lake (Lake Ontario), or a sea (North
1363 Sea)
[be25db1]1364 - name: users
[13cbe66]1365 description: All actions used to manage users and api keys
[ec8d5d0]1366 - name: devices
1367 description: All actions used to manage devices of an user
[ac11efe]1368 - name: logs
[ec9e811]1369 description: 'All actions used to manage logs of an water, device, gauge or user'
Note: See TracBrowser for help on using the repository browser.