source: src/mapservice/openapi.yaml@ bd0cb38

debian/bullseye
Last change on this file since bd0cb38 was bd0cb38, checked in by Joachim Langenbach <joachim.langenbach@…>, 7 years ago
  • Added license activated to User object and database table
  • Registering a user is now working
  • Property mode set to 100644
File size: 36.2 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'
[ec9e811]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'
[ac11efe]531 post:
[ec9e811]532 description: Creates a new log from given meta data. The log entries itself, must be uploaded per /logs/{log_id}
[ac11efe]533 tags:
534 - logs
535 summary: Add a new log
536 operationId: logsLogCreate
537 security:
538 - basicAuth: []
539 - apiKeyAuth: []
540 requestBody:
541 content:
[ec9e811]542 application/json:
[ac11efe]543 schema:
[ec9e811]544 $ref: '#/components/schemas/LogCreation'
[ac11efe]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'
[ec9e811]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'
[ac11efe]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'
[3a89adb]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
[be25db1]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
[041e464]693 itemId:
[3a89adb]694 title: Item ID
695 type: integer
696 format: int32
[041e464]697 itemName:
[3a89adb]698 title: Item Name
699 type: string
[ec9e811]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
[13cbe66]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
[be25db1]730 osmType:
[041e464]731 title: OSM type of item (N|W|R)
[3a89adb]732 type: string
[041e464]733 enum:
734 - Node
735 - Way
736 - Relation
[13cbe66]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
[72cc339]753 - LineString
[13cbe66]754 geoJsonPoint:
755 type: object
[72cc339]756 description: GeoJson geometry
[13cbe66]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'
[72cc339]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'
[ec8d5d0]776 sensorDepth:
777 type: number
[1cd45dd]778 title: Depth of sensor beneath water level in cm (positive means below water)
[ec8d5d0]779 minimum: 0
[be25db1]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
[bd0cb38]794 licenseAccepted:
795 type: boolean
[be25db1]796 apiKeys:
797 $ref: '#/components/schemas/apiKeys'
798 UserCreation:
799 title: User
800 type: object
801 properties:
802 username:
803 $ref: '#/components/schemas/username'
804 email:
805 type: string
806 firstName:
807 type: string
808 lastName:
809 type: string
810 password:
811 type: string
[bd0cb38]812 licenseAccepted:
813 type: boolean
[be25db1]814 required:
815 - username
816 - email
817 - firstName
818 - lastName
819 - password
[bd0cb38]820 - licenseAccepted
[3a89adb]821 Water:
822 title: Water
823 type: object
824 properties:
[be25db1]825 waterId:
[041e464]826 $ref: '#/components/schemas/itemId'
[3a89adb]827 name:
[041e464]828 $ref: '#/components/schemas/itemName'
[3a89adb]829 manager:
830 $ref: '#/components/schemas/username'
[be25db1]831 osmId:
[041e464]832 $ref: '#/components/schemas/itemId'
[be25db1]833 osmType:
834 $ref: '#/components/schemas/osmType'
[13cbe66]835 gauges:
836 $ref: '#/components/schemas/Gauges'
[72cc339]837 logs:
[ac11efe]838 $ref: '#/components/schemas/logs'
[3a89adb]839 required:
[be25db1]840 - waterId
[3a89adb]841 - name
842 WaterCreation:
[ec8d5d0]843 title: Water for Creation
[3a89adb]844 type: object
845 properties:
846 name:
[041e464]847 $ref: '#/components/schemas/itemName'
[be25db1]848 osmId:
[041e464]849 $ref: '#/components/schemas/itemId'
[be25db1]850 osmType:
851 $ref: '#/components/schemas/osmType'
[3a89adb]852 required:
853 - name
854 waters:
855 title: waters
856 type: array
857 items:
858 $ref: '#/components/schemas/Water'
[13cbe66]859 Gauge:
860 title: Gauge
861 type: object
862 properties:
863 gaugeId:
864 $ref: '#/components/schemas/itemId'
865 name:
866 $ref: '#/components/schemas/itemName'
867 manager:
868 $ref: '#/components/schemas/username'
869 location:
870 $ref: '#/components/schemas/point'
[72cc339]871 logs:
[ac11efe]872 $ref: '#/components/schemas/logs'
[13cbe66]873 comment:
874 $ref: '#/components/schemas/comment'
875 required:
876 - gaugeId
877 - name
878 - location
879 GaugeCreation:
880 title: Gauge for Creation
881 type: object
882 properties:
883 name:
884 $ref: '#/components/schemas/itemName'
885 location:
886 $ref: '#/components/schemas/point'
[ec9e811]887 water:
888 $ref: '#/components/schemas/itemBase'
[13cbe66]889 comment:
890 $ref: '#/components/schemas/comment'
891 required:
892 - name
893 - location
894 Gauges:
895 title: Gauges
896 type: array
897 items:
898 $ref: '#/components/schemas/Gauge'
899 GaugeGeoJson:
[72cc339]900 title: Gauge in GeoJson format
[13cbe66]901 type: object
902 properties:
903 type:
904 $ref: '#/components/schemas/geoJsonType'
905 geometry:
906 $ref: '#/components/schemas/geoJsonPoint'
907 properties:
908 type: object
909 properties:
910 name:
911 $ref: '#/components/schemas/itemName'
912 manager:
913 $ref: '#/components/schemas/username'
914 comment:
915 $ref: '#/components/schemas/comment'
916 required:
917 - name
918 required:
919 - type
920 - geometry
921 - properties
922 GaugesGeoJson:
923 title: Gauges in GeoJson format
924 type: array
925 items:
926 $ref: '#/components/schemas/GaugeGeoJson'
[ec8d5d0]927 Device:
928 title: Device
929 type: object
930 properties:
931 deviceId:
932 $ref: '#/components/schemas/itemId'
933 name:
934 $ref: '#/components/schemas/itemName'
935 sensorDepth:
936 $ref: '#/components/schemas/sensorDepth'
[ac11efe]937 logs:
938 $ref: '#/components/schemas/logs'
[ec8d5d0]939 comment:
[1cd45dd]940 $ref: '#/components/schemas/comment'
[ec8d5d0]941 required:
942 - deviceId
943 - name
944 - sensorDepth
945 DeviceCreation:
946 title: Device for Creation
947 type: object
948 properties:
949 name:
950 $ref: '#/components/schemas/itemName'
951 sensorDepth:
952 $ref: '#/components/schemas/sensorDepth'
953 comment:
[1cd45dd]954 $ref: '#/components/schemas/comment'
[ec8d5d0]955 required:
956 - name
957 - sensorDepth
958 devices:
959 title: Devices
960 type: array
961 items:
962 $ref: '#/components/schemas/Device'
[72cc339]963 GaugeLevel:
964 title: 'Absolute Level of the gauge, at the time of measuring'
965 type: number
966 format: float
967 LogEntry:
968 title: Measurement in a Log
969 type: object
970 properties:
971 datetime:
972 type: string
973 format: date-time
974 location:
975 $ref: '#/components/schemas/point'
976 waterDepth:
977 title: Measured water depth at current position
978 type: number
979 format: float
[ac11efe]980 required:
981 - datetime
982 - location
[72cc339]983 LogMetaData:
984 title: 'Metadata of a log, without log entries'
985 type: object
986 properties:
987 logId:
988 $ref: '#/components/schemas/itemId'
989 submitter:
[ac11efe]990 $ref: '#/components/schemas/username'
[72cc339]991 water:
[ec9e811]992 $ref: '#/components/schemas/itemBase'
[72cc339]993 device:
[ec9e811]994 $ref: '#/components/schemas/itemBase'
[72cc339]995 gauge:
[ec9e811]996 $ref: '#/components/schemas/itemBase'
[72cc339]997 gaugeLevel:
998 $ref: '#/components/schemas/GaugeLevel'
999 start:
[ac11efe]1000 title: Date and Time of the first log entry in UTC timezone
[72cc339]1001 type: string
1002 format: date-time
1003 end:
[ac11efe]1004 title: Date and Time of the last log entry in UTC timezone
[72cc339]1005 type: string
1006 format: date-time
[306f18a]1007 processingState:
1008 $ref: '#/components/schemas/itemBase'
[72cc339]1009 entriesCount:
1010 title: Number of measurings in the log
1011 type: integer
1012 format: int64
1013 comment:
1014 $ref: '#/components/schemas/comment'
1015 required:
1016 - gaugeLevel
1017 - start
1018 - end
1019 - entriesCount
1020 Log:
1021 title: A collection of LogEntries
1022 type: object
1023 properties:
1024 metaData:
1025 $ref: '#/components/schemas/LogMetaData'
1026 entries:
1027 title: Log entries
1028 type: array
1029 items:
1030 $ref: '#/components/schemas/LogEntry'
1031 required:
1032 - metaData
1033 - entries
1034 LogCreation:
1035 title: Log for Creation
1036 type: object
1037 properties:
1038 water:
[ac11efe]1039 $ref: '#/components/schemas/itemId'
[72cc339]1040 device:
[ac11efe]1041 $ref: '#/components/schemas/itemId'
[72cc339]1042 gauge:
[ac11efe]1043 $ref: '#/components/schemas/itemId'
[72cc339]1044 gaugeLevel:
1045 $ref: '#/components/schemas/GaugeLevel'
1046 comment:
1047 $ref: '#/components/schemas/comment'
1048 required:
1049 - water
1050 - device
1051 - gauge
1052 - gaugeLevel
1053 logs:
1054 title: Logs
1055 type: array
1056 items:
[ac11efe]1057 $ref: '#/components/schemas/LogMetaData'
[72cc339]1058 LogGeoJson:
1059 title: Log in GeoJson format
1060 type: object
1061 properties:
1062 type:
1063 $ref: '#/components/schemas/geoJsonType'
1064 geometry:
1065 $ref: '#/components/schemas/geoJsonLineString'
1066 properties:
1067 type: object
1068 additionalProperties:
1069 type: object
1070 properties:
1071 name:
1072 type: string
1073 item:
1074 title: >-
1075 LogEntry as GeoJson property ordered in same order as geometry
1076 coordinates
1077 type: object
1078 properties:
1079 datetime:
1080 type: string
1081 format: date-time
1082 waterDepth:
1083 $ref: '#/components/schemas/itemName'
1084 comment:
1085 $ref: '#/components/schemas/comment'
1086 required:
1087 - datetime
1088 - waterDepth
1089 required:
1090 - type
1091 - geometry
1092 - properties
[3a89adb]1093 HttpError:
1094 title: HTTP Error Response Object
1095 type: object
1096 properties:
[1cd45dd]1097 type:
[72cc339]1098 type: string
[1cd45dd]1099 title:
[72cc339]1100 type: string
[1cd45dd]1101 detail:
[72cc339]1102 type: string
[1cd45dd]1103 instance:
[72cc339]1104 type: string
[3a89adb]1105 required:
[1cd45dd]1106 - type
1107 - title
1108 - detail
1109 - instance
[3a89adb]1110 parameters:
1111 orderBy:
[ec9e811]1112 name: order_by
[3a89adb]1113 in: query
1114 description: 'Order by field: name'
1115 schema:
1116 type: string
1117 default: name
[13cbe66]1118 example: name
[3a89adb]1119 order:
1120 name: order
1121 in: query
1122 description: Order
1123 schema:
1124 $ref: '#/components/schemas/order'
[be25db1]1125 example: ''
[3a89adb]1126 offset:
1127 name: offset
1128 in: query
1129 description: >-
1130 Skip over a number of elements by specifying an offset value for the
1131 query
1132 schema:
1133 type: integer
1134 format: int32
1135 default: 0
1136 example: 0
1137 limit:
1138 name: limit
1139 in: query
1140 description: Limit the number of elements on the response
1141 style: form
1142 explode: true
1143 schema:
1144 type: integer
1145 format: int32
1146 default: 10
1147 example: 10
1148 examples:
[be25db1]1149 User:
1150 value:
1151 username: jane
1152 email: jane@example.org
1153 firstName: Jane
1154 lastName: Doe
1155 activated: true
1156 apiKeys:
1157 - ApiKey4701
1158 UserCreation:
1159 value:
1160 username: richard
1161 email: richard@examle.org
1162 firstName: Richard
1163 lastName: Roe
1164 password: sdfl.1238_ASDkeil?
[bd0cb38]1165 licenseAccepted: true
[3a89adb]1166 Water:
1167 value:
[be25db1]1168 waterId: 1
[3a89adb]1169 name: Mississippi
[be25db1]1170 osmId: 1756854
1171 osmType: R
[3a89adb]1172 summary: A water example object
1173 WaterCreation:
1174 value:
1175 name: Mississippi
[be25db1]1176 osmId: 1756854
[13cbe66]1177 osmType: Relation
[3a89adb]1178 summary: A water example object for creation of a water
1179 waters:
1180 value:
[be25db1]1181 - waterId: 1
[13cbe66]1182 name: Mississippi
[be25db1]1183 osmId: 1756854
[13cbe66]1184 osmType: Relation
[be25db1]1185 - waterId: 2
[13cbe66]1186 name: Bodensee
[3a89adb]1187 summary: A sample list with waters
[13cbe66]1188 Gauge:
1189 value:
1190 gaugeId: 1
1191 name: New Orleans
1192 manager: jane
1193 location:
1194 - 90.136111
1195 - 29.934722
1196 comment: Gauge for Mississippi in New Orleans
1197 Gauges:
1198 value:
1199 - gaugeId: 1
1200 name: New Orleans
1201 manager: jane
1202 location:
1203 - 90.136111
1204 - 29.934722
1205 summary: A sample list of gauges
1206 GaugeGeoJson:
1207 value:
1208 type: Feature
1209 geometry:
1210 type: Point
1211 coordinates:
1212 - 90.136111
[ec8d5d0]1213 - 29.934722
[13cbe66]1214 properties:
1215 name: New Orleans
1216 manager: jane
1217 comment: Gauge for Mississippi in New Orleans
1218 GaugesGeoJson:
1219 value:
1220 - type: Feature
1221 geometry:
1222 type: Point
1223 coordinates:
1224 - 90.136111
[ec8d5d0]1225 - 29.934722
[13cbe66]1226 properties:
1227 name: New Orleans
1228 manager: jane
1229 comment: Gauge for Mississippi in New Orleans
1230 summary: A sample list of gauges in GeoJson format
[ec8d5d0]1231 Device:
1232 value:
1233 deviceId: 1
1234 name: Lovely Boat
1235 sensorDepth: 0.2
1236 comment: Really a pleasure to measure
1237 summary: A sample device
1238 devices:
1239 value:
1240 - deviceId: 1
1241 name: Lovely Boat
1242 sensorDepth: 0.2
1243 comment: Really a pleasure to measure
[72cc339]1244 LogMetaData:
1245 value:
1246 logId: 1
1247 submitter:
1248 userId: 1
1249 name: Jane
1250 device:
1251 deviceId: 1
1252 name: Lovely Boat
1253 sensorDepth: 0.2
1254 gauge:
1255 gaugeId: 1
1256 name: New Orleans
1257 manager: jane
1258 location:
1259 - 90.136111
1260 - 29.934722
1261 gaugeLevel: 8
1262 start: 2017-07-21T10:32:28.000Z
1263 end: 2017-07-21T17:32:28.000Z
1264 entriesCount: 12600
1265 Log:
1266 value:
1267 metaData:
1268 logId: 1
1269 submitter:
1270 userId: 1
1271 name: Jane
1272 device:
1273 deviceId: 1
1274 name: Lovely Boat
1275 sensorDepth: 0.2
1276 gauge:
1277 gaugeId: 1
1278 name: New Orleans
1279 manager: jane
1280 location:
1281 - 90.136111
1282 - 29.934722
1283 gaugeLevel: 8
1284 start: 2017-07-21T10:32:28.000Z
1285 end: 2017-07-21T17:32:28.000Z
1286 entriesCount: 1
[ec9e811]1287 entries:
1288 - datetime: null
1289 location:
1290 - 90.136111
1291 - 29.934722
1292 waterDepth: 10
[72cc339]1293 LogGeoJson:
1294 value:
1295 type: Feature
1296 geometry:
1297 type: LineString
1298 coordinates:
1299 - - 90.136111
1300 - 29.934722
1301 - - 90.236111
1302 - 30.034722
1303 properties:
1304 prop0:
1305 datetime: 2017-07-21T10:32:28.000Z
1306 waterDepth: 10
1307 prop1:
1308 datetime: 2017-07-21T11:32:28.000Z
1309 waterDepth: 5
1310 logs:
1311 value:
1312 - logId: 1
1313 submitter:
1314 userId: 1
1315 name: Jane
1316 device:
1317 deviceId: 1
1318 name: Lovely Boat
1319 sensorDepth: 0.2
1320 gauge:
1321 gaugeId: 1
1322 name: New Orleans
1323 manager: jane
1324 location:
1325 - 90.136111
1326 - 29.934722
1327 gaugeLevel: 8
1328 start: 2017-07-21T10:32:28.000Z
1329 end: 2017-07-21T17:32:28.000Z
1330 entriesCount: 12600
[3a89adb]1331 HttpError:
1332 value:
[72cc339]1333 type: 'http://example.com/waters/not-found'
1334 title: Water 1 not found
1335 detail: There is no water with id 1 in database
1336 instance: 'http://example.net/waters/1'
[3a89adb]1337 responses:
1338 BadRequest:
1339 description: Bad Request (400)
1340 content:
[1cd45dd]1341 application/problem+json:
[3a89adb]1342 schema:
1343 $ref: '#/components/schemas/HttpError'
1344 examples:
1345 HttpError:
1346 $ref: '#/components/examples/HttpError'
1347 Unauthorized:
1348 description: Unauthorized (401) acces to resource
1349 content:
[1cd45dd]1350 application/problem+json:
[3a89adb]1351 schema:
1352 $ref: '#/components/schemas/HttpError'
1353 examples:
1354 HttpError:
1355 $ref: '#/components/examples/HttpError'
1356 NotFound:
1357 description: Water with given Id not found
1358 content:
[1cd45dd]1359 application/problem+json:
[3a89adb]1360 schema:
1361 $ref: '#/components/schemas/HttpError'
1362 examples:
1363 HttpError:
1364 $ref: '#/components/examples/HttpError'
1365tags:
1366 - name: waters
1367 description: >-
1368 A water is a river (like Mississippi, lake (Lake Ontario), or a sea (North
1369 Sea)
[be25db1]1370 - name: users
[13cbe66]1371 description: All actions used to manage users and api keys
[ec8d5d0]1372 - name: devices
1373 description: All actions used to manage devices of an user
[ac11efe]1374 - name: logs
[ec9e811]1375 description: 'All actions used to manage logs of an water, device, gauge or user'
Note: See TracBrowser for help on using the repository browser.