1 |
6b3c455c
|
hlavja
|
openapi: 3.0.1
|
2 |
|
|
info:
|
3 |
|
|
title: SensLog
|
4 |
|
|
description: 'ASWI semestral project of CodeBakers.'
|
5 |
|
|
version: 1.0.0
|
6 |
|
|
externalDocs:
|
7 |
|
|
description: Find out more about Swagger
|
8 |
|
|
url: http://swagger.io
|
9 |
|
|
servers:
|
10 |
f8b9a3a2
|
hlavja
|
- url: http://localhost:4200
|
11 |
|
|
|
12 |
6b3c455c
|
hlavja
|
tags:
|
13 |
|
|
- name: login
|
14 |
|
|
description: Login process
|
15 |
|
|
externalDocs:
|
16 |
|
|
description: Find out more
|
17 |
|
|
url: https://www.senslog.org/api/v1/
|
18 |
|
|
- name: group
|
19 |
|
|
description: Groups endpoints
|
20 |
1d6ec56f
|
hlavja
|
- name: data
|
21 |
|
|
description: Data endpoints
|
22 |
db9d0213
|
hlavja
|
- name: observation
|
23 |
|
|
description: Observations endpoints
|
24 |
1d6ec56f
|
hlavja
|
|
25 |
6b3c455c
|
hlavja
|
paths:
|
26 |
f8b9a3a2
|
hlavja
|
/senslog1/ControllerServlet:
|
27 |
6b3c455c
|
hlavja
|
post:
|
28 |
|
|
tags:
|
29 |
|
|
- login
|
30 |
|
|
summary: Authorize login
|
31 |
|
|
operationId: login
|
32 |
f8b9a3a2
|
hlavja
|
parameters:
|
33 |
6b3c455c
|
hlavja
|
- in: query
|
34 |
f8b9a3a2
|
hlavja
|
name: username
|
35 |
6b3c455c
|
hlavja
|
schema:
|
36 |
|
|
type: string
|
37 |
|
|
description: User login
|
38 |
|
|
- in: query
|
39 |
|
|
name: password
|
40 |
|
|
schema:
|
41 |
|
|
type: string
|
42 |
|
|
description: User password
|
43 |
|
|
responses:
|
44 |
|
|
200:
|
45 |
|
|
description: successful operation
|
46 |
|
|
content:
|
47 |
|
|
application/json:
|
48 |
|
|
schema:
|
49 |
f8b9a3a2
|
hlavja
|
$ref: '#/components/schemas/UserInfo'
|
50 |
|
|
|
51 |
|
|
/senslog1/GroupService:
|
52 |
6b3c455c
|
hlavja
|
get:
|
53 |
|
|
tags:
|
54 |
|
|
- group
|
55 |
|
|
summary: Get groups
|
56 |
|
|
operationId: getGroups
|
57 |
|
|
parameters:
|
58 |
|
|
- in: query
|
59 |
f8b9a3a2
|
hlavja
|
name: Operation
|
60 |
6b3c455c
|
hlavja
|
required: true
|
61 |
|
|
schema:
|
62 |
|
|
type: string
|
63 |
|
|
default: GetGroups
|
64 |
|
|
enum:
|
65 |
|
|
- GetGroups
|
66 |
|
|
- GetSuperGroups
|
67 |
|
|
- GetSubGroups
|
68 |
|
|
description: Group operation
|
69 |
|
|
- in: query
|
70 |
|
|
name: parent_group
|
71 |
|
|
schema:
|
72 |
|
|
type: integer
|
73 |
|
|
responses:
|
74 |
|
|
200:
|
75 |
|
|
description: successful operation
|
76 |
|
|
content:
|
77 |
|
|
application/json:
|
78 |
|
|
schema:
|
79 |
|
|
type: array
|
80 |
|
|
items:
|
81 |
|
|
$ref: '#/components/schemas/Group'
|
82 |
f8b9a3a2
|
hlavja
|
|
83 |
db9d0213
|
hlavja
|
/senslog1/SensorService?Operation=GetObservations:
|
84 |
|
|
get:
|
85 |
|
|
tags:
|
86 |
|
|
- observation
|
87 |
|
|
summary: Get observation
|
88 |
|
|
operationId: getObservation
|
89 |
|
|
parameters:
|
90 |
|
|
- in: query
|
91 |
|
|
name: unit_id
|
92 |
|
|
required: true
|
93 |
|
|
schema:
|
94 |
|
|
type: integer
|
95 |
|
|
- in: query
|
96 |
|
|
name: sensor_id
|
97 |
|
|
required: true
|
98 |
|
|
schema:
|
99 |
|
|
type: integer
|
100 |
|
|
- in: query
|
101 |
|
|
name: from
|
102 |
|
|
schema:
|
103 |
|
|
type: string
|
104 |
|
|
- in: query
|
105 |
|
|
name: to
|
106 |
|
|
schema:
|
107 |
|
|
type: string
|
108 |
|
|
responses:
|
109 |
|
|
200:
|
110 |
|
|
description: Get observation for unitId and sensorId
|
111 |
|
|
content:
|
112 |
|
|
application/json:
|
113 |
|
|
schema:
|
114 |
|
|
type: array
|
115 |
|
|
items:
|
116 |
|
|
$ref: '#/components/schemas/Observation'
|
117 |
|
|
|
118 |
1d6ec56f
|
hlavja
|
/senslog1/DataService?Operation=GetUnits:
|
119 |
|
|
get:
|
120 |
|
|
tags:
|
121 |
|
|
- data
|
122 |
|
|
summary: Get data
|
123 |
|
|
operationId: getData
|
124 |
|
|
responses:
|
125 |
|
|
200:
|
126 |
|
|
description: successful operation
|
127 |
|
|
content:
|
128 |
|
|
application/json:
|
129 |
|
|
schema:
|
130 |
|
|
type: array
|
131 |
|
|
items:
|
132 |
|
|
oneOf:
|
133 |
|
|
- type: object
|
134 |
|
|
properties:
|
135 |
|
|
drivers:
|
136 |
|
|
$ref: '#/components/schemas/Drivers'
|
137 |
|
|
generalInfo:
|
138 |
|
|
$ref: '#/components/schemas/GeneralInfo'
|
139 |
|
|
holder:
|
140 |
|
|
nullable: true
|
141 |
|
|
lastpos:
|
142 |
|
|
$ref: '#/components/schemas/Lastpos'
|
143 |
|
|
sensors:
|
144 |
|
|
type: array
|
145 |
|
|
items:
|
146 |
|
|
$ref: '#/components/schemas/Sensor'
|
147 |
|
|
unit:
|
148 |
|
|
$ref: '#/components/schemas/Unit'
|
149 |
|
|
|
150 |
6b3c455c
|
hlavja
|
components:
|
151 |
|
|
schemas:
|
152 |
f8b9a3a2
|
hlavja
|
UserInfo:
|
153 |
6b3c455c
|
hlavja
|
type: object
|
154 |
|
|
properties:
|
155 |
|
|
sessionid:
|
156 |
|
|
type: string
|
157 |
|
|
language:
|
158 |
|
|
type: string
|
159 |
|
|
audio:
|
160 |
|
|
type: boolean
|
161 |
1d6ec56f
|
hlavja
|
rights:
|
162 |
|
|
type: integer
|
163 |
f8b9a3a2
|
hlavja
|
|
164 |
6b3c455c
|
hlavja
|
Group:
|
165 |
|
|
type: object
|
166 |
|
|
properties:
|
167 |
|
|
id:
|
168 |
|
|
type: integer
|
169 |
|
|
parent_group_id:
|
170 |
|
|
type: integer
|
171 |
|
|
group_name:
|
172 |
|
|
type: string
|
173 |
|
|
has_children:
|
174 |
|
|
type: boolean
|
175 |
1d6ec56f
|
hlavja
|
|
176 |
|
|
Unit:
|
177 |
|
|
type: object
|
178 |
|
|
properties:
|
179 |
|
|
description:
|
180 |
|
|
type: string
|
181 |
|
|
holderId:
|
182 |
|
|
type: integer
|
183 |
|
|
unitId:
|
184 |
|
|
type: integer
|
185 |
|
|
|
186 |
|
|
Phenomenon:
|
187 |
|
|
type: object
|
188 |
|
|
properties:
|
189 |
|
|
phenomenonId:
|
190 |
|
|
type: string
|
191 |
|
|
phenomenonName:
|
192 |
|
|
type: string
|
193 |
|
|
unit:
|
194 |
|
|
type: string
|
195 |
|
|
|
196 |
|
|
Sensor:
|
197 |
|
|
type: object
|
198 |
|
|
properties:
|
199 |
|
|
firstObservationTime:
|
200 |
|
|
type: string
|
201 |
|
|
format: date-time
|
202 |
|
|
lastObservationTime:
|
203 |
|
|
type: string
|
204 |
|
|
format: date-time
|
205 |
|
|
phenomenon:
|
206 |
|
|
$ref: '#/components/schemas/Phenomenon'
|
207 |
|
|
sensorId:
|
208 |
|
|
type: integer
|
209 |
|
|
sensorName:
|
210 |
|
|
type: string
|
211 |
|
|
sensorType:
|
212 |
|
|
type: string
|
213 |
|
|
|
214 |
|
|
Position:
|
215 |
|
|
type: object
|
216 |
|
|
properties:
|
217 |
|
|
SRID:
|
218 |
|
|
type: string
|
219 |
|
|
gid:
|
220 |
|
|
type: integer
|
221 |
|
|
group_id:
|
222 |
|
|
type: integer
|
223 |
|
|
postgisGeomString:
|
224 |
|
|
type: string
|
225 |
|
|
postgisString:
|
226 |
|
|
type: string
|
227 |
|
|
speed:
|
228 |
|
|
type: integer
|
229 |
|
|
time_stamp:
|
230 |
|
|
type: string
|
231 |
|
|
format: date-time
|
232 |
|
|
unit_id:
|
233 |
|
|
type: integer
|
234 |
|
|
x:
|
235 |
|
|
type: number
|
236 |
|
|
y:
|
237 |
|
|
type: number
|
238 |
|
|
|
239 |
|
|
Attributes:
|
240 |
|
|
type: object
|
241 |
|
|
properties:
|
242 |
|
|
is_online:
|
243 |
|
|
type: boolean
|
244 |
|
|
is_moving:
|
245 |
|
|
type: boolean
|
246 |
|
|
#TODO
|
247 |
|
|
AlertEvents:
|
248 |
|
|
type: array
|
249 |
|
|
|
250 |
|
|
Lastpos:
|
251 |
|
|
type: object
|
252 |
|
|
properties:
|
253 |
|
|
alertEvents:
|
254 |
|
|
$ref: '#/components/schemas/AlertEvents'
|
255 |
|
|
attributes:
|
256 |
|
|
$ref: '#/components/schemas/Attributes'
|
257 |
|
|
position:
|
258 |
|
|
$ref: '#/components/schemas/Position'
|
259 |
|
|
#TODO
|
260 |
|
|
GeneralInfo:
|
261 |
|
|
type: array
|
262 |
|
|
#TODO
|
263 |
|
|
Drivers:
|
264 |
|
|
type: array
|
265 |
|
|
|
266 |
db9d0213
|
hlavja
|
Observation:
|
267 |
|
|
type: object
|
268 |
|
|
properties:
|
269 |
|
|
gid:
|
270 |
|
|
type: integer
|
271 |
|
|
time:
|
272 |
|
|
type: string
|
273 |
|
|
format: date-time
|
274 |
|
|
value:
|
275 |
|
|
type: number
|
276 |
|
|
|