source: src/mapservice/openapi.yaml@ 667b844

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

Logs upload is now working

Signed-off-by: Joachim Langenbach <joachim.langenbach@…>

  • 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/geo+json:
620 schema:
621 $ref: '#/components/schemas/LogGeoJson'
622 examples:
623 Log:
624 $ref: '#/components/examples/LogGeoJson'
625 application/json:
626 schema:
627 $ref: '#/components/schemas/Log'
628 examples:
629 Log:
630 $ref: '#/components/examples/Log'
631 '400':
632 $ref: '#/components/responses/BadRequest'
633 '401':
634 $ref: '#/components/responses/Unauthorized'
635 delete:
636 description: Deletes given log and returns remaining logs of the gauge
637 tags:
638 - logs
639 summary: Deletes log
640 operationId: logsLogDelete
641 security:
642 - basicAuth: []
643 - apiKeyAuth: []
644 parameters:
645 - name: log_id
646 in: path
647 description: Log ID
648 required: true
649 schema:
650 $ref: '#/components/schemas/itemId'
651 responses:
652 '200':
653 description: OK
654 content:
655 application/json:
656 schema:
657 $ref: '#/components/schemas/logs'
658 example:
659 Devices:
660 $ref: '#/components/examples/logs'
661 '400':
662 $ref: '#/components/responses/BadRequest'
663 '401':
664 $ref: '#/components/responses/Unauthorized'
665 '404':
666 $ref: '#/components/responses/NotFound'
667components:
668 securitySchemes:
669 basicAuth:
670 type: http
671 scheme: basic
672 x-basicInfoFunc: openapi_server.server_impl.security.Security.auth_basic
673 apiKeyAuth:
674 type: apiKey
675 in: header
676 name: X-API-KEY
677 x-apikeyInfoFunc: openapi_server.server_impl.security.Security.auth_api
678 schemas:
679 username:
680 title: Username
681 type: string
682 apiKey:
683 title: API Key
684 type: string
685 apiKeys:
686 title: Array of API keys
687 type: array
688 items:
689 $ref: '#/components/schemas/apiKey'
690 activationCode:
691 title: Activation code for a User
692 type: string
693 itemId:
694 title: Item ID
695 type: integer
696 format: int32
697 itemName:
698 title: Item Name
699 type: string
700 itemBase:
701 title: 'Basic, generic item data'
702 type: object
703 properties:
704 label:
705 type: string
706 description: >-
707 A representative name, for the item, which could be understand by
708 the user. Mostly it should be the itemName
709 id:
710 $ref: '#/components/schemas/itemId'
711 url:
712 type: string
713 format: url
714 description: 'Url, where details of the object could be retrieved'
715 required:
716 - label
717 - id
718 order:
719 title: order
720 enum:
721 - desc
722 - asc
723 type: string
724 default: asc
725 description: |
726 Sort order:
727 * `asc` - Ascending, from A to Z
728 * `desc` - Descending, from Z to A
729 example: asc
730 osmType:
731 title: OSM type of item (N|W|R)
732 type: string
733 enum:
734 - Node
735 - Way
736 - Relation
737 comment:
738 title: Comment of an item
739 type: string
740 point:
741 title: 'Point of type [longitude, latitude]'
742 type: array
743 maxItems: 2
744 minItems: 2
745 items:
746 type: number
747 geoJsonType:
748 title: Type of GeoJSON objects
749 type: string
750 enum:
751 - Feature
752 - Point
753 - LineString
754 geoJsonPoint:
755 type: object
756 description: GeoJson geometry
757 externalDocs:
758 url: 'http://geojson.org/geojson-spec.html#id2'
759 properties:
760 type:
761 type: string
762 coordinates:
763 $ref: '#/components/schemas/point'
764 geoJsonLineString:
765 type: object
766 description: GeoJson geometry
767 externalDocs:
768 url: 'http://geojson.org/geojson-spec.html#id3'
769 properties:
770 type:
771 type: string
772 coordinates:
773 type: array
774 items:
775 $ref: '#/components/schemas/point'
776 sensorDepth:
777 type: number
778 title: Depth of sensor beneath water level in cm (positive means below water)
779 minimum: 0
780 User:
781 title: User
782 type: object
783 properties:
784 username:
785 $ref: '#/components/schemas/username'
786 email:
787 type: string
788 firstName:
789 type: string
790 lastName:
791 type: string
792 activated:
793 type: boolean
794 apiKeys:
795 $ref: '#/components/schemas/apiKeys'
796 UserCreation:
797 title: User
798 type: object
799 properties:
800 username:
801 $ref: '#/components/schemas/username'
802 email:
803 type: string
804 firstName:
805 type: string
806 lastName:
807 type: string
808 password:
809 type: string
810 required:
811 - username
812 - email
813 - firstName
814 - lastName
815 - password
816 Water:
817 title: Water
818 type: object
819 properties:
820 waterId:
821 $ref: '#/components/schemas/itemId'
822 name:
823 $ref: '#/components/schemas/itemName'
824 manager:
825 $ref: '#/components/schemas/username'
826 osmId:
827 $ref: '#/components/schemas/itemId'
828 osmType:
829 $ref: '#/components/schemas/osmType'
830 gauges:
831 $ref: '#/components/schemas/Gauges'
832 logs:
833 $ref: '#/components/schemas/logs'
834 required:
835 - waterId
836 - name
837 WaterCreation:
838 title: Water for Creation
839 type: object
840 properties:
841 name:
842 $ref: '#/components/schemas/itemName'
843 osmId:
844 $ref: '#/components/schemas/itemId'
845 osmType:
846 $ref: '#/components/schemas/osmType'
847 required:
848 - name
849 waters:
850 title: waters
851 type: array
852 items:
853 $ref: '#/components/schemas/Water'
854 Gauge:
855 title: Gauge
856 type: object
857 properties:
858 gaugeId:
859 $ref: '#/components/schemas/itemId'
860 name:
861 $ref: '#/components/schemas/itemName'
862 manager:
863 $ref: '#/components/schemas/username'
864 location:
865 $ref: '#/components/schemas/point'
866 logs:
867 $ref: '#/components/schemas/logs'
868 comment:
869 $ref: '#/components/schemas/comment'
870 required:
871 - gaugeId
872 - name
873 - location
874 GaugeCreation:
875 title: Gauge for Creation
876 type: object
877 properties:
878 name:
879 $ref: '#/components/schemas/itemName'
880 location:
881 $ref: '#/components/schemas/point'
882 water:
883 $ref: '#/components/schemas/itemBase'
884 comment:
885 $ref: '#/components/schemas/comment'
886 required:
887 - name
888 - location
889 Gauges:
890 title: Gauges
891 type: array
892 items:
893 $ref: '#/components/schemas/Gauge'
894 GaugeGeoJson:
895 title: Gauge in GeoJson format
896 type: object
897 properties:
898 type:
899 $ref: '#/components/schemas/geoJsonType'
900 geometry:
901 $ref: '#/components/schemas/geoJsonPoint'
902 properties:
903 type: object
904 properties:
905 name:
906 $ref: '#/components/schemas/itemName'
907 manager:
908 $ref: '#/components/schemas/username'
909 comment:
910 $ref: '#/components/schemas/comment'
911 required:
912 - name
913 required:
914 - type
915 - geometry
916 - properties
917 GaugesGeoJson:
918 title: Gauges in GeoJson format
919 type: array
920 items:
921 $ref: '#/components/schemas/GaugeGeoJson'
922 Device:
923 title: Device
924 type: object
925 properties:
926 deviceId:
927 $ref: '#/components/schemas/itemId'
928 name:
929 $ref: '#/components/schemas/itemName'
930 sensorDepth:
931 $ref: '#/components/schemas/sensorDepth'
932 logs:
933 $ref: '#/components/schemas/logs'
934 comment:
935 $ref: '#/components/schemas/comment'
936 required:
937 - deviceId
938 - name
939 - sensorDepth
940 DeviceCreation:
941 title: Device for Creation
942 type: object
943 properties:
944 name:
945 $ref: '#/components/schemas/itemName'
946 sensorDepth:
947 $ref: '#/components/schemas/sensorDepth'
948 comment:
949 $ref: '#/components/schemas/comment'
950 required:
951 - name
952 - sensorDepth
953 devices:
954 title: Devices
955 type: array
956 items:
957 $ref: '#/components/schemas/Device'
958 GaugeLevel:
959 title: 'Absolute Level of the gauge, at the time of measuring'
960 type: number
961 format: float
962 LogEntry:
963 title: Measurement in a Log
964 type: object
965 properties:
966 datetime:
967 type: string
968 format: date-time
969 location:
970 $ref: '#/components/schemas/point'
971 waterDepth:
972 title: Measured water depth at current position
973 type: number
974 format: float
975 required:
976 - datetime
977 - location
978 LogMetaData:
979 title: 'Metadata of a log, without log entries'
980 type: object
981 properties:
982 logId:
983 $ref: '#/components/schemas/itemId'
984 submitter:
985 $ref: '#/components/schemas/username'
986 water:
987 $ref: '#/components/schemas/itemBase'
988 device:
989 $ref: '#/components/schemas/itemBase'
990 gauge:
991 $ref: '#/components/schemas/itemBase'
992 gaugeLevel:
993 $ref: '#/components/schemas/GaugeLevel'
994 start:
995 title: Date and Time of the first log entry in UTC timezone
996 type: string
997 format: date-time
998 end:
999 title: Date and Time of the last log entry in UTC timezone
1000 type: string
1001 format: date-time
1002 entriesCount:
1003 title: Number of measurings in the log
1004 type: integer
1005 format: int64
1006 comment:
1007 $ref: '#/components/schemas/comment'
1008 required:
1009 - gaugeLevel
1010 - start
1011 - end
1012 - entriesCount
1013 Log:
1014 title: A collection of LogEntries
1015 type: object
1016 properties:
1017 metaData:
1018 $ref: '#/components/schemas/LogMetaData'
1019 entries:
1020 title: Log entries
1021 type: array
1022 items:
1023 $ref: '#/components/schemas/LogEntry'
1024 required:
1025 - metaData
1026 - entries
1027 LogCreation:
1028 title: Log for Creation
1029 type: object
1030 properties:
1031 water:
1032 $ref: '#/components/schemas/itemId'
1033 device:
1034 $ref: '#/components/schemas/itemId'
1035 gauge:
1036 $ref: '#/components/schemas/itemId'
1037 gaugeLevel:
1038 $ref: '#/components/schemas/GaugeLevel'
1039 comment:
1040 $ref: '#/components/schemas/comment'
1041 required:
1042 - water
1043 - device
1044 - gauge
1045 - gaugeLevel
1046 logs:
1047 title: Logs
1048 type: array
1049 items:
1050 $ref: '#/components/schemas/LogMetaData'
1051 LogGeoJson:
1052 title: Log in GeoJson format
1053 type: object
1054 properties:
1055 type:
1056 $ref: '#/components/schemas/geoJsonType'
1057 geometry:
1058 $ref: '#/components/schemas/geoJsonLineString'
1059 properties:
1060 type: object
1061 additionalProperties:
1062 type: object
1063 properties:
1064 name:
1065 type: string
1066 item:
1067 title: >-
1068 LogEntry as GeoJson property ordered in same order as geometry
1069 coordinates
1070 type: object
1071 properties:
1072 datetime:
1073 type: string
1074 format: date-time
1075 waterDepth:
1076 $ref: '#/components/schemas/itemName'
1077 comment:
1078 $ref: '#/components/schemas/comment'
1079 required:
1080 - datetime
1081 - waterDepth
1082 required:
1083 - type
1084 - geometry
1085 - properties
1086 HttpError:
1087 title: HTTP Error Response Object
1088 type: object
1089 properties:
1090 type:
1091 type: string
1092 title:
1093 type: string
1094 detail:
1095 type: string
1096 instance:
1097 type: string
1098 required:
1099 - type
1100 - title
1101 - detail
1102 - instance
1103 parameters:
1104 orderBy:
1105 name: order_by
1106 in: query
1107 description: 'Order by field: name'
1108 schema:
1109 type: string
1110 default: name
1111 example: name
1112 order:
1113 name: order
1114 in: query
1115 description: Order
1116 schema:
1117 $ref: '#/components/schemas/order'
1118 example: ''
1119 offset:
1120 name: offset
1121 in: query
1122 description: >-
1123 Skip over a number of elements by specifying an offset value for the
1124 query
1125 schema:
1126 type: integer
1127 format: int32
1128 default: 0
1129 example: 0
1130 limit:
1131 name: limit
1132 in: query
1133 description: Limit the number of elements on the response
1134 style: form
1135 explode: true
1136 schema:
1137 type: integer
1138 format: int32
1139 default: 10
1140 example: 10
1141 examples:
1142 User:
1143 value:
1144 username: jane
1145 email: jane@example.org
1146 firstName: Jane
1147 lastName: Doe
1148 activated: true
1149 apiKeys:
1150 - ApiKey4701
1151 UserCreation:
1152 value:
1153 username: richard
1154 email: richard@examle.org
1155 firstName: Richard
1156 lastName: Roe
1157 password: sdfl.1238_ASDkeil?
1158 Water:
1159 value:
1160 waterId: 1
1161 name: Mississippi
1162 osmId: 1756854
1163 osmType: R
1164 summary: A water example object
1165 WaterCreation:
1166 value:
1167 name: Mississippi
1168 osmId: 1756854
1169 osmType: Relation
1170 summary: A water example object for creation of a water
1171 waters:
1172 value:
1173 - waterId: 1
1174 name: Mississippi
1175 osmId: 1756854
1176 osmType: Relation
1177 - waterId: 2
1178 name: Bodensee
1179 summary: A sample list with waters
1180 Gauge:
1181 value:
1182 gaugeId: 1
1183 name: New Orleans
1184 manager: jane
1185 location:
1186 - 90.136111
1187 - 29.934722
1188 comment: Gauge for Mississippi in New Orleans
1189 Gauges:
1190 value:
1191 - gaugeId: 1
1192 name: New Orleans
1193 manager: jane
1194 location:
1195 - 90.136111
1196 - 29.934722
1197 summary: A sample list of gauges
1198 GaugeGeoJson:
1199 value:
1200 type: Feature
1201 geometry:
1202 type: Point
1203 coordinates:
1204 - 90.136111
1205 - 29.934722
1206 properties:
1207 name: New Orleans
1208 manager: jane
1209 comment: Gauge for Mississippi in New Orleans
1210 GaugesGeoJson:
1211 value:
1212 - type: Feature
1213 geometry:
1214 type: Point
1215 coordinates:
1216 - 90.136111
1217 - 29.934722
1218 properties:
1219 name: New Orleans
1220 manager: jane
1221 comment: Gauge for Mississippi in New Orleans
1222 summary: A sample list of gauges in GeoJson format
1223 Device:
1224 value:
1225 deviceId: 1
1226 name: Lovely Boat
1227 sensorDepth: 0.2
1228 comment: Really a pleasure to measure
1229 summary: A sample device
1230 devices:
1231 value:
1232 - deviceId: 1
1233 name: Lovely Boat
1234 sensorDepth: 0.2
1235 comment: Really a pleasure to measure
1236 LogMetaData:
1237 value:
1238 logId: 1
1239 submitter:
1240 userId: 1
1241 name: Jane
1242 device:
1243 deviceId: 1
1244 name: Lovely Boat
1245 sensorDepth: 0.2
1246 gauge:
1247 gaugeId: 1
1248 name: New Orleans
1249 manager: jane
1250 location:
1251 - 90.136111
1252 - 29.934722
1253 gaugeLevel: 8
1254 start: 2017-07-21T10:32:28.000Z
1255 end: 2017-07-21T17:32:28.000Z
1256 entriesCount: 12600
1257 Log:
1258 value:
1259 metaData:
1260 logId: 1
1261 submitter:
1262 userId: 1
1263 name: Jane
1264 device:
1265 deviceId: 1
1266 name: Lovely Boat
1267 sensorDepth: 0.2
1268 gauge:
1269 gaugeId: 1
1270 name: New Orleans
1271 manager: jane
1272 location:
1273 - 90.136111
1274 - 29.934722
1275 gaugeLevel: 8
1276 start: 2017-07-21T10:32:28.000Z
1277 end: 2017-07-21T17:32:28.000Z
1278 entriesCount: 1
1279 entries:
1280 - datetime: null
1281 location:
1282 - 90.136111
1283 - 29.934722
1284 waterDepth: 10
1285 LogGeoJson:
1286 value:
1287 type: Feature
1288 geometry:
1289 type: LineString
1290 coordinates:
1291 - - 90.136111
1292 - 29.934722
1293 - - 90.236111
1294 - 30.034722
1295 properties:
1296 prop0:
1297 datetime: 2017-07-21T10:32:28.000Z
1298 waterDepth: 10
1299 prop1:
1300 datetime: 2017-07-21T11:32:28.000Z
1301 waterDepth: 5
1302 logs:
1303 value:
1304 - logId: 1
1305 submitter:
1306 userId: 1
1307 name: Jane
1308 device:
1309 deviceId: 1
1310 name: Lovely Boat
1311 sensorDepth: 0.2
1312 gauge:
1313 gaugeId: 1
1314 name: New Orleans
1315 manager: jane
1316 location:
1317 - 90.136111
1318 - 29.934722
1319 gaugeLevel: 8
1320 start: 2017-07-21T10:32:28.000Z
1321 end: 2017-07-21T17:32:28.000Z
1322 entriesCount: 12600
1323 HttpError:
1324 value:
1325 type: 'http://example.com/waters/not-found'
1326 title: Water 1 not found
1327 detail: There is no water with id 1 in database
1328 instance: 'http://example.net/waters/1'
1329 responses:
1330 BadRequest:
1331 description: Bad Request (400)
1332 content:
1333 application/problem+json:
1334 schema:
1335 $ref: '#/components/schemas/HttpError'
1336 examples:
1337 HttpError:
1338 $ref: '#/components/examples/HttpError'
1339 Unauthorized:
1340 description: Unauthorized (401) acces to resource
1341 content:
1342 application/problem+json:
1343 schema:
1344 $ref: '#/components/schemas/HttpError'
1345 examples:
1346 HttpError:
1347 $ref: '#/components/examples/HttpError'
1348 NotFound:
1349 description: Water with given Id not found
1350 content:
1351 application/problem+json:
1352 schema:
1353 $ref: '#/components/schemas/HttpError'
1354 examples:
1355 HttpError:
1356 $ref: '#/components/examples/HttpError'
1357tags:
1358 - name: waters
1359 description: >-
1360 A water is a river (like Mississippi, lake (Lake Ontario), or a sea (North
1361 Sea)
1362 - name: users
1363 description: All actions used to manage users and api keys
1364 - name: devices
1365 description: All actions used to manage devices of an user
1366 - name: logs
1367 description: 'All actions used to manage logs of an water, device, gauge or user'
Note: See TracBrowser for help on using the repository browser.