source: src/mapservice/openapi.yaml@ a88607b

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

Celery background process for log parsing is now working

  • Property mode set to 100644
File size: 36.0 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 - $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'
190 '404':
191 $ref: '#/components/responses/NotFound'
192 post:
193 description: Adds a new water to the database
194 tags:
195 - waters
196 summary: Add a new water
197 operationId: watersCreate
198 security:
199 - basicAuth: []
200 - apiKeyAuth: []
201 requestBody:
202 content:
203 application/json:
204 schema:
205 $ref: '#/components/schemas/WaterCreation'
206 example:
207 name: Rhein
208 osmId: 1756854
209 osmType: Relation
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
230 operationId: watersGetById
231 parameters:
232 - name: id
233 in: path
234 description: Item ID
235 required: true
236 schema:
237 $ref: '#/components/schemas/itemId'
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'
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'
379 /devices:
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:
425 name: Lovely Boat
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'
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'
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'
531 post:
532 description: Creates a new log from given meta data. The log entries itself, must be uploaded per /logs/{log_id}
533 tags:
534 - logs
535 summary: Add a new log
536 operationId: logsLogCreate
537 security:
538 - basicAuth: []
539 - apiKeyAuth: []
540 requestBody:
541 content:
542 application/json:
543 schema:
544 $ref: '#/components/schemas/LogCreation'
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'
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/json:
620 schema:
621 $ref: '#/components/schemas/LogMetaData'
622 examples:
623 Log:
624 $ref: '#/components/examples/LogMetaData'
625 '400':
626 $ref: '#/components/responses/BadRequest'
627 '401':
628 $ref: '#/components/responses/Unauthorized'
629 delete:
630 description: Deletes given log and returns remaining logs of the gauge
631 tags:
632 - logs
633 summary: Deletes log
634 operationId: logsLogDelete
635 security:
636 - basicAuth: []
637 - apiKeyAuth: []
638 parameters:
639 - name: log_id
640 in: path
641 description: Log ID
642 required: true
643 schema:
644 $ref: '#/components/schemas/itemId'
645 responses:
646 '200':
647 description: OK
648 content:
649 application/json:
650 schema:
651 $ref: '#/components/schemas/logs'
652 example:
653 Devices:
654 $ref: '#/components/examples/logs'
655 '400':
656 $ref: '#/components/responses/BadRequest'
657 '401':
658 $ref: '#/components/responses/Unauthorized'
659 '404':
660 $ref: '#/components/responses/NotFound'
661components:
662 securitySchemes:
663 basicAuth:
664 type: http
665 scheme: basic
666 x-basicInfoFunc: openapi_server.server_impl.security.Security.auth_basic
667 apiKeyAuth:
668 type: apiKey
669 in: header
670 name: X-API-KEY
671 x-apikeyInfoFunc: openapi_server.server_impl.security.Security.auth_api
672 schemas:
673 username:
674 title: Username
675 type: string
676 apiKey:
677 title: API Key
678 type: string
679 apiKeys:
680 title: Array of API keys
681 type: array
682 items:
683 $ref: '#/components/schemas/apiKey'
684 activationCode:
685 title: Activation code for a User
686 type: string
687 itemId:
688 title: Item ID
689 type: integer
690 format: int32
691 itemName:
692 title: Item Name
693 type: string
694 itemBase:
695 title: 'Basic, generic item data'
696 type: object
697 properties:
698 label:
699 type: string
700 description: >-
701 A representative name, for the item, which could be understand by
702 the user. Mostly it should be the itemName
703 id:
704 $ref: '#/components/schemas/itemId'
705 url:
706 type: string
707 format: url
708 description: 'Url, where details of the object could be retrieved'
709 required:
710 - label
711 - id
712 order:
713 title: order
714 enum:
715 - desc
716 - asc
717 type: string
718 default: asc
719 description: |
720 Sort order:
721 * `asc` - Ascending, from A to Z
722 * `desc` - Descending, from Z to A
723 example: asc
724 osmType:
725 title: OSM type of item (N|W|R)
726 type: string
727 enum:
728 - Node
729 - Way
730 - Relation
731 comment:
732 title: Comment of an item
733 type: string
734 point:
735 title: 'Point of type [longitude, latitude]'
736 type: array
737 maxItems: 2
738 minItems: 2
739 items:
740 type: number
741 geoJsonType:
742 title: Type of GeoJSON objects
743 type: string
744 enum:
745 - Feature
746 - Point
747 - LineString
748 geoJsonPoint:
749 type: object
750 description: GeoJson geometry
751 externalDocs:
752 url: 'http://geojson.org/geojson-spec.html#id2'
753 properties:
754 type:
755 type: string
756 coordinates:
757 $ref: '#/components/schemas/point'
758 geoJsonLineString:
759 type: object
760 description: GeoJson geometry
761 externalDocs:
762 url: 'http://geojson.org/geojson-spec.html#id3'
763 properties:
764 type:
765 type: string
766 coordinates:
767 type: array
768 items:
769 $ref: '#/components/schemas/point'
770 sensorDepth:
771 type: number
772 title: Depth of sensor beneath water level in cm (positive means below water)
773 minimum: 0
774 User:
775 title: User
776 type: object
777 properties:
778 username:
779 $ref: '#/components/schemas/username'
780 email:
781 type: string
782 firstName:
783 type: string
784 lastName:
785 type: string
786 activated:
787 type: boolean
788 licenseAccepted:
789 type: boolean
790 apiKeys:
791 $ref: '#/components/schemas/apiKeys'
792 UserCreation:
793 title: User
794 type: object
795 properties:
796 username:
797 $ref: '#/components/schemas/username'
798 email:
799 type: string
800 firstName:
801 type: string
802 lastName:
803 type: string
804 password:
805 type: string
806 licenseAccepted:
807 type: boolean
808 required:
809 - username
810 - email
811 - firstName
812 - lastName
813 - password
814 - licenseAccepted
815 Water:
816 title: Water
817 type: object
818 properties:
819 waterId:
820 $ref: '#/components/schemas/itemId'
821 name:
822 $ref: '#/components/schemas/itemName'
823 manager:
824 $ref: '#/components/schemas/username'
825 osmId:
826 $ref: '#/components/schemas/itemId'
827 osmType:
828 $ref: '#/components/schemas/osmType'
829 gauges:
830 $ref: '#/components/schemas/Gauges'
831 logs:
832 $ref: '#/components/schemas/logs'
833 required:
834 - waterId
835 - name
836 WaterCreation:
837 title: Water for Creation
838 type: object
839 properties:
840 name:
841 $ref: '#/components/schemas/itemName'
842 osmId:
843 $ref: '#/components/schemas/itemId'
844 osmType:
845 $ref: '#/components/schemas/osmType'
846 required:
847 - name
848 waters:
849 title: waters
850 type: array
851 items:
852 $ref: '#/components/schemas/Water'
853 Gauge:
854 title: Gauge
855 type: object
856 properties:
857 gaugeId:
858 $ref: '#/components/schemas/itemId'
859 name:
860 $ref: '#/components/schemas/itemName'
861 manager:
862 $ref: '#/components/schemas/username'
863 location:
864 $ref: '#/components/schemas/point'
865 logs:
866 $ref: '#/components/schemas/logs'
867 comment:
868 $ref: '#/components/schemas/comment'
869 required:
870 - gaugeId
871 - name
872 - location
873 GaugeCreation:
874 title: Gauge for Creation
875 type: object
876 properties:
877 name:
878 $ref: '#/components/schemas/itemName'
879 location:
880 $ref: '#/components/schemas/point'
881 water:
882 $ref: '#/components/schemas/itemBase'
883 comment:
884 $ref: '#/components/schemas/comment'
885 required:
886 - name
887 - location
888 Gauges:
889 title: Gauges
890 type: array
891 items:
892 $ref: '#/components/schemas/Gauge'
893 GaugeGeoJson:
894 title: Gauge in GeoJson format
895 type: object
896 properties:
897 type:
898 $ref: '#/components/schemas/geoJsonType'
899 geometry:
900 $ref: '#/components/schemas/geoJsonPoint'
901 properties:
902 type: object
903 properties:
904 name:
905 $ref: '#/components/schemas/itemName'
906 manager:
907 $ref: '#/components/schemas/username'
908 comment:
909 $ref: '#/components/schemas/comment'
910 required:
911 - name
912 required:
913 - type
914 - geometry
915 - properties
916 GaugesGeoJson:
917 title: Gauges in GeoJson format
918 type: array
919 items:
920 $ref: '#/components/schemas/GaugeGeoJson'
921 Device:
922 title: Device
923 type: object
924 properties:
925 deviceId:
926 $ref: '#/components/schemas/itemId'
927 name:
928 $ref: '#/components/schemas/itemName'
929 sensorDepth:
930 $ref: '#/components/schemas/sensorDepth'
931 logs:
932 $ref: '#/components/schemas/logs'
933 comment:
934 $ref: '#/components/schemas/comment'
935 required:
936 - deviceId
937 - name
938 - sensorDepth
939 DeviceCreation:
940 title: Device for Creation
941 type: object
942 properties:
943 name:
944 $ref: '#/components/schemas/itemName'
945 sensorDepth:
946 $ref: '#/components/schemas/sensorDepth'
947 comment:
948 $ref: '#/components/schemas/comment'
949 required:
950 - name
951 - sensorDepth
952 devices:
953 title: Devices
954 type: array
955 items:
956 $ref: '#/components/schemas/Device'
957 GaugeLevel:
958 title: 'Absolute Level of the gauge, at the time of measuring'
959 type: number
960 format: float
961 LogEntry:
962 title: Measurement in a Log
963 type: object
964 properties:
965 datetime:
966 type: string
967 format: date-time
968 location:
969 $ref: '#/components/schemas/point'
970 waterDepth:
971 title: Measured water depth at current position
972 type: number
973 format: float
974 required:
975 - datetime
976 - location
977 LogMetaData:
978 title: 'Metadata of a log, without log entries'
979 type: object
980 properties:
981 logId:
982 $ref: '#/components/schemas/itemId'
983 submitter:
984 $ref: '#/components/schemas/username'
985 water:
986 $ref: '#/components/schemas/itemBase'
987 device:
988 $ref: '#/components/schemas/itemBase'
989 gauge:
990 $ref: '#/components/schemas/itemBase'
991 gaugeLevel:
992 $ref: '#/components/schemas/GaugeLevel'
993 start:
994 title: Date and Time of the first log entry in UTC timezone
995 type: string
996 format: date-time
997 end:
998 title: Date and Time of the last log entry in UTC timezone
999 type: string
1000 format: date-time
1001 processingState:
1002 $ref: '#/components/schemas/itemBase'
1003 entriesCount:
1004 title: Number of measurings in the log
1005 type: integer
1006 format: int64
1007 comment:
1008 $ref: '#/components/schemas/comment'
1009 required:
1010 - gaugeLevel
1011 - start
1012 - end
1013 - entriesCount
1014 Log:
1015 title: A collection of LogEntries
1016 type: object
1017 properties:
1018 metaData:
1019 $ref: '#/components/schemas/LogMetaData'
1020 entries:
1021 title: Log entries
1022 type: array
1023 items:
1024 $ref: '#/components/schemas/LogEntry'
1025 required:
1026 - metaData
1027 - entries
1028 LogCreation:
1029 title: Log for Creation
1030 type: object
1031 properties:
1032 water:
1033 $ref: '#/components/schemas/itemId'
1034 device:
1035 $ref: '#/components/schemas/itemId'
1036 gauge:
1037 $ref: '#/components/schemas/itemId'
1038 gaugeLevel:
1039 $ref: '#/components/schemas/GaugeLevel'
1040 comment:
1041 $ref: '#/components/schemas/comment'
1042 required:
1043 - water
1044 - device
1045 - gauge
1046 - gaugeLevel
1047 logs:
1048 title: Logs
1049 type: array
1050 items:
1051 $ref: '#/components/schemas/LogMetaData'
1052 LogGeoJson:
1053 title: Log in GeoJson format
1054 type: object
1055 properties:
1056 type:
1057 $ref: '#/components/schemas/geoJsonType'
1058 geometry:
1059 $ref: '#/components/schemas/geoJsonLineString'
1060 properties:
1061 type: object
1062 additionalProperties:
1063 type: object
1064 properties:
1065 name:
1066 type: string
1067 item:
1068 title: >-
1069 LogEntry as GeoJson property ordered in same order as geometry
1070 coordinates
1071 type: object
1072 properties:
1073 datetime:
1074 type: string
1075 format: date-time
1076 waterDepth:
1077 $ref: '#/components/schemas/itemName'
1078 comment:
1079 $ref: '#/components/schemas/comment'
1080 required:
1081 - datetime
1082 - waterDepth
1083 required:
1084 - type
1085 - geometry
1086 - properties
1087 HttpError:
1088 title: HTTP Error Response Object
1089 type: object
1090 properties:
1091 type:
1092 type: string
1093 title:
1094 type: string
1095 detail:
1096 type: string
1097 instance:
1098 type: string
1099 required:
1100 - type
1101 - title
1102 - detail
1103 - instance
1104 parameters:
1105 orderBy:
1106 name: order_by
1107 in: query
1108 description: 'Order by field: name'
1109 schema:
1110 type: string
1111 default: name
1112 example: name
1113 order:
1114 name: order
1115 in: query
1116 description: Order
1117 schema:
1118 $ref: '#/components/schemas/order'
1119 example: ''
1120 offset:
1121 name: offset
1122 in: query
1123 description: >-
1124 Skip over a number of elements by specifying an offset value for the
1125 query
1126 schema:
1127 type: integer
1128 format: int32
1129 default: 0
1130 example: 0
1131 limit:
1132 name: limit
1133 in: query
1134 description: Limit the number of elements on the response
1135 style: form
1136 explode: true
1137 schema:
1138 type: integer
1139 format: int32
1140 default: 10
1141 example: 10
1142 examples:
1143 User:
1144 value:
1145 username: jane
1146 email: jane@example.org
1147 firstName: Jane
1148 lastName: Doe
1149 activated: true
1150 apiKeys:
1151 - ApiKey4701
1152 UserCreation:
1153 value:
1154 username: richard
1155 email: richard@examle.org
1156 firstName: Richard
1157 lastName: Roe
1158 password: sdfl.1238_ASDkeil?
1159 licenseAccepted: true
1160 Water:
1161 value:
1162 waterId: 1
1163 name: Mississippi
1164 osmId: 1756854
1165 osmType: R
1166 summary: A water example object
1167 WaterCreation:
1168 value:
1169 name: Mississippi
1170 osmId: 1756854
1171 osmType: Relation
1172 summary: A water example object for creation of a water
1173 waters:
1174 value:
1175 - waterId: 1
1176 name: Mississippi
1177 osmId: 1756854
1178 osmType: Relation
1179 - waterId: 2
1180 name: Bodensee
1181 summary: A sample list with waters
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
1207 - 29.934722
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
1219 - 29.934722
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
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
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
1281 entries:
1282 - datetime: null
1283 location:
1284 - 90.136111
1285 - 29.934722
1286 waterDepth: 10
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
1325 HttpError:
1326 value:
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'
1331 responses:
1332 BadRequest:
1333 description: Bad Request (400)
1334 content:
1335 application/problem+json:
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:
1344 application/problem+json:
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:
1353 application/problem+json:
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)
1364 - name: users
1365 description: All actions used to manage users and api keys
1366 - name: devices
1367 description: All actions used to manage devices of an user
1368 - name: logs
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.