-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
562 lines (562 loc) · 14.3 KB
/
openapi.yaml
File metadata and controls
562 lines (562 loc) · 14.3 KB
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
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
openapi: 3.0.3
info:
title: LED Panel Control API
description: API for controlling AM03127 LED panels
version: 1.0.0
servers:
- url: http://localhost:80
description: Local development server
paths:
/page/{pageId}:
parameters:
- name: pageId
in: path
required: true
schema:
type: string
pattern: '^[A-Z]$'
description: Single uppercase letter (A-Z) identifying the page
get:
summary: Get a specific page
description: Retrieves the content and settings of a specific page by ID
responses:
'200':
description: Page found and returned
content:
application/json:
schema:
$ref: '#/components/schemas/Page'
'400':
description: Invalid page ID
content:
text/plain:
schema:
type: string
'404':
description: Page not found
content:
text/plain:
schema:
type: string
'500':
description: Internal server error
content:
text/plain:
schema:
type: string
post:
summary: Create or update a page
description: Creates a new page or updates an existing page with the specified ID
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Page'
responses:
'200':
description: Page created or updated successfully
'400':
description: Invalid page ID or request body
content:
text/plain:
schema:
type: string
'500':
description: Internal server error
content:
text/plain:
schema:
type: string
delete:
summary: Delete a page
description: Deletes a page with the specified ID
responses:
'200':
description: Page deleted successfully
'400':
description: Invalid page ID
content:
text/plain:
schema:
type: string
'500':
description: Internal server error
content:
text/plain:
schema:
type: string
/pages:
get:
summary: Get all pages
description: Retrieves all stored pages
responses:
'200':
description: List of pages
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Page'
'500':
description: Internal server error
content:
text/plain:
schema:
type: string
post:
summary: Create or update multiple pages
description: Creates or updates multiple pages at once
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Page'
responses:
'200':
description: Pages created or updated successfully
'400':
description: Invalid request body
content:
text/plain:
schema:
type: string
'500':
description: Internal server error
content:
text/plain:
schema:
type: string
/schedule/{scheduleId}:
parameters:
- name: scheduleId
in: path
required: true
schema:
type: string
pattern: '^[A-E]$'
description: Single uppercase letter (A-E) identifying the schedule
get:
summary: Get a specific schedule
description: Retrieves a specific schedule by ID
responses:
'200':
description: Schedule found and returned
content:
application/json:
schema:
$ref: '#/components/schemas/Schedule'
'400':
description: Invalid schedule ID
content:
text/plain:
schema:
type: string
'404':
description: Schedule not found
content:
text/plain:
schema:
type: string
'500':
description: Internal server error
content:
text/plain:
schema:
type: string
post:
summary: Create or update a schedule
description: Creates a new schedule or updates an existing schedule with the specified ID
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Schedule'
responses:
'200':
description: Schedule created or updated successfully
'400':
description: Invalid schedule ID or request body
content:
text/plain:
schema:
type: string
'500':
description: Internal server error
content:
text/plain:
schema:
type: string
delete:
summary: Delete a schedule
description: Deletes a schedule with the specified ID
responses:
'200':
description: Schedule deleted successfully
'400':
description: Invalid schedule ID
content:
text/plain:
schema:
type: string
'500':
description: Internal server error
content:
text/plain:
schema:
type: string
/schedules:
get:
summary: Get all schedules
description: Retrieves all stored schedules
responses:
'200':
description: List of schedules
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Schedule'
'500':
description: Internal server error
content:
text/plain:
schema:
type: string
post:
summary: Create or update multiple schedules
description: Creates or updates multiple schedules at once
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Schedule'
responses:
'200':
description: Schedules created or updated successfully
'400':
description: Invalid request body
content:
text/plain:
schema:
type: string
'500':
description: Internal server error
content:
text/plain:
schema:
type: string
/clock:
post:
summary: Set panel clock
description: Sets the internal clock of the LED panel
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DateTime'
responses:
'200':
description: Clock set successfully
'500':
description: Internal server error
content:
text/plain:
schema:
type: string
/reset:
post:
summary: Delete all content
description: Deletes all pages and schedules from the LED panel
responses:
'200':
description: All content deleted successfully
'500':
description: Internal server error
content:
text/plain:
schema:
type: string
/ota:
put:
summary: Over-the-air firmware update
description: Uploads a new firmware image for OTA update
requestBody:
required: true
content:
application/octet-stream:
schema:
type: string
format: binary
responses:
'200':
description: Update successful
content:
text/plain:
schema:
type: string
'400':
description: Bad request (wrong content type, invalid content length, or image too large)
content:
text/plain:
schema:
type: string
'500':
description: Internal server error
content:
text/plain:
schema:
type: string
components:
schemas:
Font:
type: string
enum:
- Normal
- Bold
- Narrow
- Large
- Long
description: Font style for text display
ColumnStart:
type: object
properties:
column:
type: integer
format: uint8
minimum: 0
maximum: 255
description: Starting column position (0-255)
required:
- column
description: Specifies the starting column for text
Clock:
type: string
enum:
- Date
- Time
description: Clock display format
Leading:
type: string
enum:
- block_move
- curtain_down
- curtain_up
- hold
- immediate
- pen_amplus
- pen_hello_world
- pen_welcome
- random
- scroll_down
- scroll_left
- scroll_right
- scroll_up
- snow
- twinkle
- vclose
- vopen
- xopen
description: Animation effect for page entry
Lagging:
type: string
enum:
- curtain_down
- curtain_up
- hold
- immediate
- scroll_down
- scroll_left
- scroll_right
- scroll_up
- vclose
- vopen
- xopen
description: Animation effect for page exit
WaitingModeAndSpeed:
type: string
enum:
- fastest_blinking
- fastest_normal
- fastest_song1
- fastest_song2
- fastest_song3
- middle_fast_blinking
- middle_fast_normal
- middle_fast_song1
- middle_fast_song2
- middle_fast_song3
- middle_slow_blinking
- middle_slow_normal
- middle_slow_song1
- middle_slow_song2
- middle_slow_song3
- slowest_blinking
- slowest_normal
- slowest_song1
- slowest_song2
- slowest_song3
description: Display mode and speed while waiting
Page:
type: object
properties:
line:
type: integer
format: uint8
default: 1
description: Line number (usually 1)
id:
type: string
pattern: '^[A-Z]$'
default: "A"
description: Page identifier (A-Z)
leading:
$ref: '#/components/schemas/Leading'
default: "immediate"
description: Animation effect for page entry
lagging:
$ref: '#/components/schemas/Lagging'
default: "hold"
description: Animation effect for page exit
waiting_mode_and_speed:
$ref: '#/components/schemas/WaitingModeAndSpeed'
default: "fastest_normal"
description: Display mode and speed while waiting
waiting_time:
type: integer
format: uint8
minimum: 0
maximum: 25
description: Waiting time between leading and lagging (0=0.5s to 25=25s)
message:
type: string
maxLength: 16
description: Text content displayed on the page
required:
- id
- message
Schedule:
type: object
properties:
id:
type: string
pattern: '^[A-E]$'
default: "A"
description: Schedule identifier (A-E)
from:
$ref: '#/components/schemas/ScheduleDateTime'
description: Start date and time
to:
$ref: '#/components/schemas/ScheduleDateTime'
description: End date and time
pages:
type: string
maxLength: 31
pattern: '^[A-Z]+$'
description: String of page IDs to display in sequence (e.g., "ABC")
required:
- id
- from
- to
- pages
DateTime:
type: object
properties:
year:
type: integer
format: uint8
minimum: 0
maximum: 99
description: Year (last two digits)
week:
type: integer
format: uint8
minimum: 1
maximum: 53
description: Week of year
month:
type: integer
format: uint8
minimum: 1
maximum: 12
description: Month
day:
type: integer
format: uint8
minimum: 1
maximum: 31
description: Day of month
hour:
type: integer
format: uint8
minimum: 0
maximum: 23
description: Hour (24-hour format)
minute:
type: integer
format: uint8
minimum: 0
maximum: 59
description: Minute
second:
type: integer
format: uint8
minimum: 0
maximum: 59
description: Second
required:
- year
- month
- day
- hour
- minute
- second
ScheduleDateTime:
type: object
properties:
year:
type: integer
format: uint8
minimum: 0
maximum: 99
description: Year (last two digits)
month:
type: integer
format: uint8
minimum: 1
maximum: 12
description: Month
day:
type: integer
format: uint8
minimum: 1
maximum: 31
description: Day of month
hour:
type: integer
format: uint8
minimum: 0
maximum: 23
description: Hour (24-hour format)
minute:
type: integer
format: uint8
minimum: 0
maximum: 59
description: Minute
required:
- year
- month
- day
- hour
- minute