source: apis/mapservice.yaml@ de51c8c

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