-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOpenAPI Definitions.yaml
365 lines (365 loc) · 10.1 KB
/
OpenAPI Definitions.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
openapi: 3.0.0
info:
title: FLUX-Coordinator
description: This is the API documentation for the REST API of the Flux-Coordinator project.
version: 0.0.2
license:
name: MIT
url: "https://github.com/Flux-Coordinator/flux-frontend/blob/master/LICENSE"
servers:
- url: https://flux-server-prod.herokuapp.com
description: Production Server
- url: https://flux-server-staging.herokuapp.com
description: Staging Server
- url: http://localhost:9000
description: Development Server
tags:
- name: projects
description: Everything that has to do with projects
- name: measurements
description: Everything that has to do with measurements
- name: auth
description: Authentication functionality
paths:
/projects:
get:
summary: Get a list with all the projects
description: Returns a list of all the available projects.
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Project'
tags:
- projects
post:
summary: Create a new project
description: Create a new project with the desired properties.
requestBody:
description: The parameters used to create a new project.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Project'
responses:
'201':
description: Project was created successfully. Payload contains the location of the new project.
tags:
- projects
/projects/{projectId}:
get:
summary: Get a single project
description: Return a single project
parameters:
- name: projectId
in: path
required: true
description: The database ID of the project you want to retrieve.
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Project'
'204':
description: Request was successful, but no project was found.
tags:
- projects
/projects/{projectId}/rooms:
get:
summary: Get all the rooms in the project
description: Get a list of all the available rooms in the corresponding project.
parameters:
- name: projectId
in: path
required: true
description: The database ID of the project you are referring to.
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Room'
'404':
description: Project not found
tags:
- projects
post:
summary: Create a new room
description: Create a new room inside an existing project.
parameters:
- name: projectId
in: path
required: true
description: The database ID of the project that should contain the room.
schema:
type: string
requestBody:
description: The parameters used to create the new room.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Room'
responses:
'200':
description: Room was created successfully
'404':
description: Project not found
tags:
- projects
/projects/{projectId}/rooms/{roomId}:
get:
summary: Get a single room in the project
description: Returns a single room with the ID corresponding to the roomId parameter.
parameters:
- name: projectId
in: path
required: true
description: The database ID of the project you are referring to.
schema:
type: string
- name: roomId
in: path
required: true
description: The database ID of the room to get.
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Room'
'204':
description: Project or Room not found
tags:
- projects
/measurements/{measurementId}:
get:
summary: Get a single measurement
description: Return a single measurement with the ID corresponding to the measurementId paramter.
parameters:
- name: measurementId
in: path
required: true
description: The database ID of the measurement to get.
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/MeasurementReadings'
'204':
description: Measurement not found.
'400':
description: Failed retrieving the measurement.s
tags:
- measurements
/measurements/active/{measurementId}:
put:
summary: Place a new measurement as the active measurement.
description: Set a new measurement as the currently active measurement. There can only be one active measurement.
parameters:
- name: measurementId
in: path
required: true
description: The database ID of the measurement to set as active.
schema:
type: string
responses:
'200':
description: OK
tags:
- measurements
/measurements/active:
delete:
summary: Remove the currently active measurement
description: Removes the currently active measurement from the active state. There will be no more currently active measurement, until it is set again.
responses:
'200':
description: OK
tags:
- measurements
/measurements/active/readings:
post:
summary: Add a reading to the active measurement
description: Add new readings the currently active measurement.
requestBody:
description: The new readings that should get added to the measurement.
required: true
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Reading'
responses:
'200':
description: OK
tags:
- measurements
/measurements:
post:
summary: Create a new measurement
description: Create a new measurement with the desired properties.
requestBody:
description: The parameters used to create a new measurement.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MeasurementMetadata'
responses:
'200':
description: Measurement was created successfully.
tags:
- measurements
/auth/login:
get:
summary: Log user into the system
description: The user is logged into the system
parameters:
- name: username
in: query
description: The username that should be logged in
required: true
schema:
type: string
- name: password
in: query
description: The password of the username trying to log in
required: true
schema:
type: string
responses:
'200':
description: Logged in successfully.
tags:
- auth
/auth/logout:
get:
summary: Log out the current user logged in the user session
description: The user that's logged in, is stored in the session of the browser, which is sent to the server. The server-side session must be deleted to log out the user.
responses:
'200':
description: Logged out successfully.
tags:
- auth
components:
schemas:
Project:
type: object
properties:
projectId:
type: string
name:
type: string
description:
type: string
rooms:
type: array
items:
$ref: '#/components/schemas/Room'
Room:
type: object
properties:
roomId:
type: string
name:
type: string
description:
type: string
floorPlan:
type: string
width:
type: number
length:
type: number
measurements:
type: array
items:
$ref: '#/components/schemas/MeasurementMetadata'
MeasurementMetadata:
type: object
properties:
measurementId:
type: string
name:
type: string
description:
type: string
creator:
type: string
startDate:
type: string
format: date-time
endDate:
type: string
format: date-time
state:
type: string
enum: [done, running, ready]
offset:
type: number
factor:
type: number
MeasurementReadings:
type: object
properties:
measurementId:
type: string
anchorPositions:
type: array
items:
$ref: '#/components/schemas/AnchorPosition'
readings:
type: array
items:
$ref: '#/components/schemas/Reading'
AnchorPosition:
type: object
properties:
anchorId:
type: string
name:
type: string
xPosition:
type: number
yPosition:
type: number
zPosition:
type: number
Reading:
type: object
properties:
readingId:
type: string
luxValue:
type: number
xPosition:
type: number
yPosition:
type: number
zPosition:
type: number
timestamp:
type: string
format: date-time