source: src/mapservice/openapi.yaml@ 72cc339

debian/bullseye
Last change on this file since 72cc339 was 72cc339, checked in by Joachim Langenbach <joachim.langenbach@…>, 7 years ago

Added Log API (only to API, not implemented yet)

  • Property mode set to 100644
File size: 34.4 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'
[72cc339]379 post:
380 description: Adds a new log to the database
381 tags:
382 - waters
383 summary: Add a new log
384 operationId: watersCreateLog
385 parameters:
386 - name: water_id
387 in: path
388 description: Water ID
389 required: true
390 schema:
391 $ref: '#/components/schemas/itemId'
392 - name: gauge_id
393 in: path
394 description: Gauge ID
395 required: true
396 schema:
397 $ref: '#/components/schemas/itemId'
398 security:
399 - basicAuth: []
400 - apiKeyAuth: []
401 requestBody:
402 content:
403 multipart/form-data:
404 schema:
405 type: object
406 properties:
407 metaData:
408 $ref: '#/components/schemas/LogCreation'
409 file:
410 type: string
411 format: binary
412 responses:
413 '201':
414 description: Log created
415 content:
416 application/json:
417 schema:
418 $ref: '#/components/schemas/LogMetaData'
419 examples:
420 LogMetaData:
421 $ref: '#/components/examples/LogMetaData'
422 '400':
423 $ref: '#/components/responses/BadRequest'
424 '401':
425 $ref: '#/components/responses/Unauthorized'
426 '/waters/{water_id}/gauges/{gauge_id}/{log_id}':
427 get:
428 description: Returns the log identified by id
429 tags:
430 - waters
431 summary: Represents a log
432 operationId: watersLogGetById
433 parameters:
434 - name: water_id
435 in: path
436 description: Water ID
437 required: true
438 schema:
439 $ref: '#/components/schemas/itemId'
440 - name: gauge_id
441 in: path
442 description: Gauge ID
443 required: true
444 schema:
445 $ref: '#/components/schemas/itemId'
446 - name: log_id
447 in: path
448 description: Log ID
449 required: true
450 schema:
451 $ref: '#/components/schemas/itemId'
452 responses:
453 '200':
454 description: OK
455 content:
456 application/json:
457 schema:
458 $ref: '#/components/schemas/Log'
459 examples:
460 Log:
461 $ref: '#/components/examples/Log'
462 application/geo+json:
463 schema:
464 $ref: '#/components/schemas/LogGeoJson'
465 examples:
466 Log:
467 $ref: '#/components/examples/LogGeoJson'
468 '400':
469 $ref: '#/components/responses/BadRequest'
470 '404':
471 $ref: '#/components/responses/NotFound'
472 delete:
473 description: Deletes given log and returns remaining logs of the gauge
474 tags:
475 - waters
476 summary: Deletes log
477 operationId: watersLogDelete
478 security:
479 - basicAuth: []
480 - apiKeyAuth: []
481 parameters:
482 - name: water_id
483 in: path
484 description: Water ID
485 required: true
486 schema:
487 $ref: '#/components/schemas/itemId'
488 - name: gauge_id
489 in: path
490 description: Gauge ID
491 required: true
492 schema:
493 $ref: '#/components/schemas/itemId'
494 - name: log_id
495 in: path
496 description: Log ID
497 required: true
498 schema:
499 $ref: '#/components/schemas/itemId'
500 responses:
501 '200':
502 description: OK
503 content:
504 application/json:
505 schema:
506 $ref: '#/components/schemas/logs'
507 example:
508 Devices:
509 $ref: '#/components/examples/logs'
510 '400':
511 $ref: '#/components/responses/BadRequest'
512 '401':
513 $ref: '#/components/responses/Unauthorized'
514 '404':
515 $ref: '#/components/responses/NotFound'
[1cd45dd]516 /devices:
[ec8d5d0]517 get:
518 description: Returns all devices of user
519 tags:
520 - devices
521 summary: Find devices by id
522 operationId: devicesGet
523 security:
524 - basicAuth: []
525 - apiKeyAuth: []
526 parameters:
527 - name: name
528 in: query
529 schema:
530 $ref: '#/components/schemas/itemName'
531 example: Love
532 - $ref: '#/components/parameters/orderBy'
533 - $ref: '#/components/parameters/offset'
534 - $ref: '#/components/parameters/limit'
535 responses:
536 '200':
537 description: OK
538 content:
539 application/json:
540 schema:
541 $ref: '#/components/schemas/devices'
542 examples:
543 Devices:
544 $ref: '#/components/examples/devices'
545 '404':
546 $ref: '#/components/responses/NotFound'
547 post:
548 description: Adds a new device to the database
549 tags:
550 - devices
551 summary: Add a new device
552 operationId: devicesCreate
553 security:
554 - basicAuth: []
555 - apiKeyAuth: []
556 requestBody:
557 content:
558 application/json:
559 schema:
560 $ref: '#/components/schemas/DeviceCreation'
561 example:
[1cd45dd]562 name: Lovely Boat
[ec8d5d0]563 sensorDepth: 2
564 responses:
565 '201':
566 description: Device created
567 content:
568 application/json:
569 schema:
570 $ref: '#/components/schemas/Device'
571 examples:
572 Device:
573 $ref: '#/components/examples/Device'
574 '400':
575 $ref: '#/components/responses/BadRequest'
576 '401':
577 $ref: '#/components/responses/Unauthorized'
578 '/devices/{id}':
579 get:
580 description: Returns the device identified by id
581 tags:
582 - devices
583 summary: Represents a device
584 operationId: devicesGetById
585 security:
586 - basicAuth: []
587 - apiKeyAuth: []
588 parameters:
589 - name: id
590 in: path
591 description: Item ID
592 required: true
593 schema:
594 $ref: '#/components/schemas/itemId'
595 responses:
596 '200':
597 description: OK
598 content:
599 application/json:
600 schema:
601 $ref: '#/components/schemas/Device'
602 examples:
603 Water:
604 $ref: '#/components/examples/Device'
605 '404':
606 $ref: '#/components/responses/NotFound'
[1cd45dd]607 delete:
608 description: Deletes given device and returns remaining devices of the user
609 tags:
610 - devices
611 summary: Deletes device
612 operationId: devicesDeviceDelete
613 security:
614 - basicAuth: []
615 - apiKeyAuth: []
616 parameters:
617 - name: id
618 in: path
619 description: Item id
620 required: true
621 schema:
622 $ref: '#/components/schemas/itemId'
623 example: 1
624 responses:
625 '200':
626 description: OK
627 content:
628 application/json:
629 schema:
630 $ref: '#/components/schemas/devices'
631 example:
632 Devices:
633 $ref: '#/components/examples/devices'
634 '400':
635 $ref: '#/components/responses/BadRequest'
636 '401':
637 $ref: '#/components/responses/Unauthorized'
638 '404':
639 $ref: '#/components/responses/NotFound'
[3a89adb]640components:
641 securitySchemes:
642 basicAuth:
643 type: http
644 scheme: basic
645 x-basicInfoFunc: openapi_server.server_impl.security.Security.auth_basic
646 apiKeyAuth:
647 type: apiKey
648 in: header
649 name: X-API-KEY
650 x-apikeyInfoFunc: openapi_server.server_impl.security.Security.auth_api
651 schemas:
652 username:
653 title: Username
654 type: string
[be25db1]655 apiKey:
656 title: API Key
657 type: string
658 apiKeys:
659 title: Array of API keys
660 type: array
661 items:
662 $ref: '#/components/schemas/apiKey'
663 activationCode:
664 title: Activation code for a User
665 type: string
[041e464]666 itemId:
[3a89adb]667 title: Item ID
668 type: integer
669 format: int32
[041e464]670 itemName:
[3a89adb]671 title: Item Name
672 type: string
[13cbe66]673 order:
674 title: order
675 enum:
676 - desc
677 - asc
678 type: string
679 default: asc
680 description: |
681 Sort order:
682 * `asc` - Ascending, from A to Z
683 * `desc` - Descending, from Z to A
684 example: asc
[be25db1]685 osmType:
[041e464]686 title: OSM type of item (N|W|R)
[3a89adb]687 type: string
[041e464]688 enum:
689 - Node
690 - Way
691 - Relation
[13cbe66]692 comment:
693 title: Comment of an item
694 type: string
695 point:
696 title: 'Point of type [longitude, latitude]'
697 type: array
698 maxItems: 2
699 minItems: 2
700 items:
701 type: number
702 geoJsonType:
703 title: Type of GeoJSON objects
704 type: string
705 enum:
706 - Feature
707 - Point
[72cc339]708 - LineString
[13cbe66]709 geoJsonPoint:
710 type: object
[72cc339]711 description: GeoJson geometry
[13cbe66]712 externalDocs:
713 url: 'http://geojson.org/geojson-spec.html#id2'
714 properties:
715 type:
716 type: string
717 coordinates:
718 $ref: '#/components/schemas/point'
[72cc339]719 geoJsonLineString:
720 type: object
721 description: GeoJson geometry
722 externalDocs:
723 url: 'http://geojson.org/geojson-spec.html#id3'
724 properties:
725 type:
726 type: string
727 coordinates:
728 type: array
729 items:
730 $ref: '#/components/schemas/point'
[ec8d5d0]731 sensorDepth:
732 type: number
[1cd45dd]733 title: Depth of sensor beneath water level in cm (positive means below water)
[ec8d5d0]734 minimum: 0
[be25db1]735 User:
736 title: User
737 type: object
738 properties:
739 username:
740 $ref: '#/components/schemas/username'
741 email:
742 type: string
743 firstName:
744 type: string
745 lastName:
746 type: string
747 activated:
748 type: boolean
749 apiKeys:
750 $ref: '#/components/schemas/apiKeys'
751 UserCreation:
752 title: User
753 type: object
754 properties:
755 username:
756 $ref: '#/components/schemas/username'
757 email:
758 type: string
759 firstName:
760 type: string
761 lastName:
762 type: string
763 password:
764 type: string
765 required:
766 - username
767 - email
768 - firstName
769 - lastName
770 - password
[3a89adb]771 Water:
772 title: Water
773 type: object
774 properties:
[be25db1]775 waterId:
[041e464]776 $ref: '#/components/schemas/itemId'
[3a89adb]777 name:
[041e464]778 $ref: '#/components/schemas/itemName'
[3a89adb]779 manager:
780 $ref: '#/components/schemas/username'
[be25db1]781 osmId:
[041e464]782 $ref: '#/components/schemas/itemId'
[be25db1]783 osmType:
784 $ref: '#/components/schemas/osmType'
[13cbe66]785 gauges:
786 $ref: '#/components/schemas/Gauges'
[72cc339]787 logs:
788 $ref: '#/components/schemas/LogMetaData'
[3a89adb]789 required:
[be25db1]790 - waterId
[3a89adb]791 - name
792 WaterCreation:
[ec8d5d0]793 title: Water for Creation
[3a89adb]794 type: object
795 properties:
796 name:
[041e464]797 $ref: '#/components/schemas/itemName'
[be25db1]798 osmId:
[041e464]799 $ref: '#/components/schemas/itemId'
[be25db1]800 osmType:
801 $ref: '#/components/schemas/osmType'
[3a89adb]802 required:
803 - name
804 waters:
805 title: waters
806 type: array
807 items:
808 $ref: '#/components/schemas/Water'
[13cbe66]809 Gauge:
810 title: Gauge
811 type: object
812 properties:
813 gaugeId:
814 $ref: '#/components/schemas/itemId'
815 name:
816 $ref: '#/components/schemas/itemName'
817 manager:
818 $ref: '#/components/schemas/username'
819 location:
820 $ref: '#/components/schemas/point'
[72cc339]821 logs:
822 $ref: '#/components/schemas/LogMetaData'
[13cbe66]823 comment:
824 $ref: '#/components/schemas/comment'
825 required:
826 - gaugeId
827 - name
828 - location
829 GaugeCreation:
830 title: Gauge for Creation
831 type: object
832 properties:
833 name:
834 $ref: '#/components/schemas/itemName'
835 location:
836 $ref: '#/components/schemas/point'
837 comment:
838 $ref: '#/components/schemas/comment'
839 required:
840 - name
841 - location
842 Gauges:
843 title: Gauges
844 type: array
845 items:
846 $ref: '#/components/schemas/Gauge'
847 GaugeGeoJson:
[72cc339]848 title: Gauge in GeoJson format
[13cbe66]849 type: object
850 properties:
851 type:
852 $ref: '#/components/schemas/geoJsonType'
853 geometry:
854 $ref: '#/components/schemas/geoJsonPoint'
855 properties:
856 type: object
857 properties:
858 name:
859 $ref: '#/components/schemas/itemName'
860 manager:
861 $ref: '#/components/schemas/username'
862 comment:
863 $ref: '#/components/schemas/comment'
864 required:
865 - name
866 required:
867 - type
868 - geometry
869 - properties
870 GaugesGeoJson:
871 title: Gauges in GeoJson format
872 type: array
873 items:
874 $ref: '#/components/schemas/GaugeGeoJson'
[ec8d5d0]875 Device:
876 title: Device
877 type: object
878 properties:
879 deviceId:
880 $ref: '#/components/schemas/itemId'
881 name:
882 $ref: '#/components/schemas/itemName'
883 sensorDepth:
884 $ref: '#/components/schemas/sensorDepth'
885 comment:
[1cd45dd]886 $ref: '#/components/schemas/comment'
[ec8d5d0]887 required:
888 - deviceId
889 - name
890 - sensorDepth
891 DeviceCreation:
892 title: Device for Creation
893 type: object
894 properties:
895 name:
896 $ref: '#/components/schemas/itemName'
897 sensorDepth:
898 $ref: '#/components/schemas/sensorDepth'
899 comment:
[1cd45dd]900 $ref: '#/components/schemas/comment'
[ec8d5d0]901 required:
902 - name
903 - sensorDepth
904 devices:
905 title: Devices
906 type: array
907 items:
908 $ref: '#/components/schemas/Device'
[72cc339]909 GaugeLevel:
910 title: 'Absolute Level of the gauge, at the time of measuring'
911 type: number
912 format: float
913 LogEntry:
914 title: Measurement in a Log
915 type: object
916 properties:
917 datetime:
918 type: string
919 format: date-time
920 location:
921 $ref: '#/components/schemas/point'
922 waterDepth:
923 title: Measured water depth at current position
924 type: number
925 format: float
926 LogMetaData:
927 title: 'Metadata of a log, without log entries'
928 type: object
929 properties:
930 logId:
931 $ref: '#/components/schemas/itemId'
932 submitter:
933 $ref: '#/components/schemas/User'
934 water:
935 $ref: '#/components/schemas/itemId'
936 device:
937 $ref: '#/components/schemas/itemId'
938 gauge:
939 $ref: '#/components/schemas/itemId'
940 gaugeLevel:
941 $ref: '#/components/schemas/GaugeLevel'
942 start:
943 title: Date and Time of the first log entry
944 type: string
945 format: date-time
946 end:
947 title: Date and Time of the last log entry
948 type: string
949 format: date-time
950 entriesCount:
951 title: Number of measurings in the log
952 type: integer
953 format: int64
954 comment:
955 $ref: '#/components/schemas/comment'
956 required:
957 - gaugeLevel
958 - start
959 - end
960 - entriesCount
961 Log:
962 title: A collection of LogEntries
963 type: object
964 properties:
965 metaData:
966 $ref: '#/components/schemas/LogMetaData'
967 entries:
968 title: Log entries
969 type: array
970 items:
971 $ref: '#/components/schemas/LogEntry'
972 required:
973 - metaData
974 - entries
975 LogCreation:
976 title: Log for Creation
977 type: object
978 properties:
979 water:
980 $ref: '#/components/schemas/Water'
981 device:
982 $ref: '#/components/schemas/Device'
983 gauge:
984 $ref: '#/components/schemas/Gauge'
985 gaugeLevel:
986 $ref: '#/components/schemas/GaugeLevel'
987 comment:
988 $ref: '#/components/schemas/comment'
989 required:
990 - water
991 - device
992 - gauge
993 - gaugeLevel
994 logs:
995 title: Logs
996 type: array
997 items:
998 $ref: '#/components/schemas/Log'
999 LogGeoJson:
1000 title: Log in GeoJson format
1001 type: object
1002 properties:
1003 type:
1004 $ref: '#/components/schemas/geoJsonType'
1005 geometry:
1006 $ref: '#/components/schemas/geoJsonLineString'
1007 properties:
1008 type: object
1009 additionalProperties:
1010 type: object
1011 properties:
1012 name:
1013 type: string
1014 item:
1015 title: >-
1016 LogEntry as GeoJson property ordered in same order as geometry
1017 coordinates
1018 type: object
1019 properties:
1020 datetime:
1021 type: string
1022 format: date-time
1023 waterDepth:
1024 $ref: '#/components/schemas/itemName'
1025 comment:
1026 $ref: '#/components/schemas/comment'
1027 required:
1028 - datetime
1029 - waterDepth
1030 required:
1031 - type
1032 - geometry
1033 - properties
[3a89adb]1034 HttpError:
1035 title: HTTP Error Response Object
1036 type: object
1037 properties:
[1cd45dd]1038 type:
[72cc339]1039 type: string
[1cd45dd]1040 title:
[72cc339]1041 type: string
[1cd45dd]1042 detail:
[72cc339]1043 type: string
[1cd45dd]1044 instance:
[72cc339]1045 type: string
[3a89adb]1046 required:
[1cd45dd]1047 - type
1048 - title
1049 - detail
1050 - instance
[3a89adb]1051 parameters:
1052 orderBy:
1053 name: orderBy
1054 in: query
1055 description: 'Order by field: name'
1056 schema:
1057 type: string
1058 default: name
[13cbe66]1059 example: name
[3a89adb]1060 order:
1061 name: order
1062 in: query
1063 description: Order
1064 schema:
1065 $ref: '#/components/schemas/order'
[be25db1]1066 example: ''
[3a89adb]1067 offset:
1068 name: offset
1069 in: query
1070 description: >-
1071 Skip over a number of elements by specifying an offset value for the
1072 query
1073 schema:
1074 type: integer
1075 format: int32
1076 default: 0
1077 example: 0
1078 limit:
1079 name: limit
1080 in: query
1081 description: Limit the number of elements on the response
1082 style: form
1083 explode: true
1084 schema:
1085 type: integer
1086 format: int32
1087 default: 10
1088 example: 10
1089 examples:
[be25db1]1090 User:
1091 value:
1092 username: jane
1093 email: jane@example.org
1094 firstName: Jane
1095 lastName: Doe
1096 activated: true
1097 apiKeys:
1098 - ApiKey4701
1099 UserCreation:
1100 value:
1101 username: richard
1102 email: richard@examle.org
1103 firstName: Richard
1104 lastName: Roe
1105 password: sdfl.1238_ASDkeil?
[3a89adb]1106 Water:
1107 value:
[be25db1]1108 waterId: 1
[3a89adb]1109 name: Mississippi
[be25db1]1110 osmId: 1756854
1111 osmType: R
[3a89adb]1112 summary: A water example object
1113 WaterCreation:
1114 value:
1115 name: Mississippi
[be25db1]1116 osmId: 1756854
[13cbe66]1117 osmType: Relation
[3a89adb]1118 summary: A water example object for creation of a water
1119 waters:
1120 value:
[be25db1]1121 - waterId: 1
[13cbe66]1122 name: Mississippi
[be25db1]1123 osmId: 1756854
[13cbe66]1124 osmType: Relation
[be25db1]1125 - waterId: 2
[13cbe66]1126 name: Bodensee
[3a89adb]1127 summary: A sample list with waters
[13cbe66]1128 Gauge:
1129 value:
1130 gaugeId: 1
1131 name: New Orleans
1132 manager: jane
1133 location:
1134 - 90.136111
1135 - 29.934722
1136 comment: Gauge for Mississippi in New Orleans
1137 Gauges:
1138 value:
1139 - gaugeId: 1
1140 name: New Orleans
1141 manager: jane
1142 location:
1143 - 90.136111
1144 - 29.934722
1145 summary: A sample list of gauges
1146 GaugeGeoJson:
1147 value:
1148 type: Feature
1149 geometry:
1150 type: Point
1151 coordinates:
1152 - 90.136111
[ec8d5d0]1153 - 29.934722
[13cbe66]1154 properties:
1155 name: New Orleans
1156 manager: jane
1157 comment: Gauge for Mississippi in New Orleans
1158 GaugesGeoJson:
1159 value:
1160 - type: Feature
1161 geometry:
1162 type: Point
1163 coordinates:
1164 - 90.136111
[ec8d5d0]1165 - 29.934722
[13cbe66]1166 properties:
1167 name: New Orleans
1168 manager: jane
1169 comment: Gauge for Mississippi in New Orleans
1170 summary: A sample list of gauges in GeoJson format
[ec8d5d0]1171 Device:
1172 value:
1173 deviceId: 1
1174 name: Lovely Boat
1175 sensorDepth: 0.2
1176 comment: Really a pleasure to measure
1177 summary: A sample device
1178 devices:
1179 value:
1180 - deviceId: 1
1181 name: Lovely Boat
1182 sensorDepth: 0.2
1183 comment: Really a pleasure to measure
[72cc339]1184 LogMetaData:
1185 value:
1186 logId: 1
1187 submitter:
1188 userId: 1
1189 name: Jane
1190 device:
1191 deviceId: 1
1192 name: Lovely Boat
1193 sensorDepth: 0.2
1194 gauge:
1195 gaugeId: 1
1196 name: New Orleans
1197 manager: jane
1198 location:
1199 - 90.136111
1200 - 29.934722
1201 gaugeLevel: 8
1202 start: 2017-07-21T10:32:28.000Z
1203 end: 2017-07-21T17:32:28.000Z
1204 entriesCount: 12600
1205 Log:
1206 value:
1207 metaData:
1208 logId: 1
1209 submitter:
1210 userId: 1
1211 name: Jane
1212 device:
1213 deviceId: 1
1214 name: Lovely Boat
1215 sensorDepth: 0.2
1216 gauge:
1217 gaugeId: 1
1218 name: New Orleans
1219 manager: jane
1220 location:
1221 - 90.136111
1222 - 29.934722
1223 gaugeLevel: 8
1224 start: 2017-07-21T10:32:28.000Z
1225 end: 2017-07-21T17:32:28.000Z
1226 entriesCount: 1
1227 entries:
1228 - datetime: null
1229 location:
1230 - 90.136111
1231 - 29.934722
1232 waterDepth: 10
1233 LogGeoJson:
1234 value:
1235 type: Feature
1236 geometry:
1237 type: LineString
1238 coordinates:
1239 - - 90.136111
1240 - 29.934722
1241 - - 90.236111
1242 - 30.034722
1243 properties:
1244 prop0:
1245 datetime: 2017-07-21T10:32:28.000Z
1246 waterDepth: 10
1247 prop1:
1248 datetime: 2017-07-21T11:32:28.000Z
1249 waterDepth: 5
1250 logs:
1251 value:
1252 - logId: 1
1253 submitter:
1254 userId: 1
1255 name: Jane
1256 device:
1257 deviceId: 1
1258 name: Lovely Boat
1259 sensorDepth: 0.2
1260 gauge:
1261 gaugeId: 1
1262 name: New Orleans
1263 manager: jane
1264 location:
1265 - 90.136111
1266 - 29.934722
1267 gaugeLevel: 8
1268 start: 2017-07-21T10:32:28.000Z
1269 end: 2017-07-21T17:32:28.000Z
1270 entriesCount: 12600
[3a89adb]1271 HttpError:
1272 value:
[72cc339]1273 type: 'http://example.com/waters/not-found'
1274 title: Water 1 not found
1275 detail: There is no water with id 1 in database
1276 instance: 'http://example.net/waters/1'
[3a89adb]1277 responses:
1278 BadRequest:
1279 description: Bad Request (400)
1280 content:
[1cd45dd]1281 application/problem+json:
[3a89adb]1282 schema:
1283 $ref: '#/components/schemas/HttpError'
1284 examples:
1285 HttpError:
1286 $ref: '#/components/examples/HttpError'
1287 Unauthorized:
1288 description: Unauthorized (401) acces to resource
1289 content:
[1cd45dd]1290 application/problem+json:
[3a89adb]1291 schema:
1292 $ref: '#/components/schemas/HttpError'
1293 examples:
1294 HttpError:
1295 $ref: '#/components/examples/HttpError'
1296 NotFound:
1297 description: Water with given Id not found
1298 content:
[1cd45dd]1299 application/problem+json:
[3a89adb]1300 schema:
1301 $ref: '#/components/schemas/HttpError'
1302 examples:
1303 HttpError:
1304 $ref: '#/components/examples/HttpError'
1305tags:
1306 - name: waters
1307 description: >-
1308 A water is a river (like Mississippi, lake (Lake Ontario), or a sea (North
1309 Sea)
[be25db1]1310 - name: users
[13cbe66]1311 description: All actions used to manage users and api keys
[ec8d5d0]1312 - name: devices
1313 description: All actions used to manage devices of an user
Note: See TracBrowser for help on using the repository browser.