source: src/mapservice/openapi.yaml@ acf8893

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

Added possibility to search for all waters, related to a user (where a user is a stakehodler)

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