source: src/mapservice/openapi.yaml@ f5feba5

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

Implemented Log retrieving on the webservice

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