forked from linux-automation/tacd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
1132 lines (1054 loc) · 27.1 KB
/
openapi.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
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
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: LXA TAC HTTP API
description: Control and view inputs and outputs of your LXA TAC
version: 0.1.0
paths:
/v1/tac/display/screen:
get:
summary: Get the name of the screen currently shown on the display
tags: [User Interface]
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Screen'
put:
summary: Set the screen to show on the display
tags: [User Interface]
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Screen'
responses:
'204':
description: The screen was set sucessfully
'400':
description: The value could not be parsed into a screen name
/v1/tac/display/alerts:
get:
summary: A list of currently pending alerts shown on the local UI
tags: [User Interface]
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Alerts'
/v1/tac/display/backlight/brightness:
get:
summary: Get the current backlight brightness (between 0.0, and 1.0)
tags: [User Interface]
responses:
'200':
content:
application/json:
schema:
type: number
put:
summary: Set the current backlight brightness (between 0.0 and 1.0)
tags: [User Interface]
requestBody:
content:
application/json:
schema:
type: number
responses:
'204':
description: The display brightness was set sucessfully
'400':
description: The value could not be parsed as a number
/v1/tac/display/buttons:
put:
summary: Simulate a button press/release on the device
tags: [User Interface]
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ButtonEvent'
responses:
'204':
description: The button event will be simulated
'400':
description: The value could not be parsed as button event
/v1/tac/display/content:
get:
summary: The current screen content rendered into a PNG
tags: [User Interface]
responses:
'200':
content:
image/png:
/v1/tac/display/locator:
get:
summary: Get the current locator status
tags: [User Interface]
responses:
'200':
content:
application/json:
schema:
type: boolean
put:
summary: Set the current locator status
tags: [User Interface]
requestBody:
content:
application/json:
schema:
type: boolean
responses:
'204':
description: The locator status was set sucessfully
'400':
description: The value could not be parsed into a boolean
/v1/tac/display/show_help:
get:
summary: Display a help menu on the local screen
tags: [User Interface]
responses:
'200':
content:
application/json:
schema:
type: boolean
put:
summary: Display a help menu on the local screen
tags: [User Interface]
requestBody:
content:
application/json:
schema:
type: boolean
responses:
'204':
description: Help will be shown or hidden as requested
'400':
description: The request could not be parsed as boolean
/v1/tac/led/{led}/pattern:
parameters:
- name: led
description: The name of the respective LED
required: true
schema:
type: string
enum:
- out_0
- out_1
- dut_pwr
- eth_dut
- eth_lab
- status
get:
summary: Get the current blink pattern of the LED
tags: [User Interface]
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/BlinkPattern'
/v1/tac/led/{led}/color:
parameters:
- name: led
description: The name of the respective LED
required: true
schema:
type: string
enum:
- status
get:
summary: Get the current RGB color of the LED
tags: [User Interface]
responses:
'200':
content:
application/json:
schema:
type: array
items:
type: number
minItems: 3
maxItems: 3
/v1/dut/powered:
get:
summary: Get the current power switch state
tags: [DUT Power]
responses:
'200':
description: The DUT power can either be "On" or in a couple of off states.
content:
application/json:
schema:
$ref: '#/components/schemas/DutPwrStatus'
put:
summary: Try to set the power switch state
description: >
While the request will return immediately with a successful response, this does not mean
that the switch is actually on at this or a later point in time.
You will always have to check with e.g. a GET request if you really want to know, as an
error state could always take precedence.
tags: [DUT Power]
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DutPwrRequest'
responses:
'204':
description: The request was set
'400':
description: The value could not be parsed into a a power switch request
/v1/usb/host/{port}/powered:
parameters:
- name: port
description: The name of the respective port on the hub
required: true
schema:
type: string
enum:
- port1
- port2
- port3
get:
summary: Get the power status for an USB host port
tags: [USB Host]
responses:
'200':
content:
application/json:
schema:
type: boolean
put:
summary: Set the power status for an USB host port
tags: [USB Host]
requestBody:
content:
application/json:
schema:
type: boolean
responses:
'204':
description: A power on/off was requested
'400':
description: The value could not be parsed as boolean
/v1/usb/host/{port}/device:
parameters:
- name: port
description: The name of the respective port on the hub
required: true
schema:
type: string
enum:
- port1
- port2
- port3
get:
summary: Get the device connected to the respective USB port
tags: [USB Host]
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/UsbDevice'
/v1/usb/host/overload:
get:
summary: Get the name of the currently overloaded port (if any)
tags: [USB Host]
responses:
'200':
content:
application/json:
schema:
type: string
enum:
- Total
- Port1
- Port2
- Port3
/v1/tac/temperatures/soc:
get:
summary: Get the current temperature inside the SoC
tags: [System]
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Measurement'
/v1/tac/temperatures/warning:
get:
summary: Get the current temperature warning state
tags: [System]
responses:
'200':
content:
application/json:
schema:
type: string
enum:
- Okay
- SocHigh
- SocCritical
/v1/tac/info/uname:
get:
summary: Get the information commonly accessed via "uname"
tags: [System]
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Uname'
/v1/tac/info/bootloader:
get:
summary: Get the information passed through from the bootloader
tags: [System]
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Barebox'
/v1/tac/info/tacd/version:
get:
summary: Get the tacd version string
tags: [System]
responses:
'200':
content:
application/json:
schema:
type: string
/v1/tac/setup_mode:
get:
summary: Check if the TAC has completed the set up or is still in setup mode
tags: [System]
responses:
'200':
content:
application/json:
schema:
type: boolean
put:
summary: Leave setup mode by writing false
tags: [System]
requestBody:
content:
application/json:
schema:
type: boolean
responses:
'204':
description: Setup mode left (when false was sent)
'400':
description: The request could not be parsed as boolean
/v1/labgrid/{file}:
parameters:
- name: file
description: The name of the file to read/write
required: true
schema:
type: string
enum:
- configuration
- environment
- userconfig
get:
summary: Get the current content of a labgrid config file
tags: [System]
responses:
'200':
content:
text/plain:
schema:
type: string
put:
summary: Set a new content for the labgrid config file
tags: [System]
requestBody:
content:
text/plain:
schema:
type: string
responses:
'204':
description: New config set
/v1/tac/ssh/authorized_keys:
get:
summary: Get the current content of roots authorized_keys file
tags: [System]
responses:
'200':
content:
text/plain:
schema:
type: string
'403':
description: The device is not in setup mode
put:
summary: Set a new content for roots authorized_keys file
tags: [System]
requestBody:
content:
text/plain:
schema:
type: string
responses:
'204':
description: New ssh keys set
'403':
description: The device is not in setup mode
/v1/iobus/server/info:
get:
summary: Get (cached) info from the local IOBus server
tags: [IOBus]
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/IOBusServerInfo'
/v1/iobus/server/nodes:
get:
summary: Get the list of connected nodes
tags: [IOBus]
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/IOBusServerNodes'
/v1/output/{out_n}/asserted:
parameters:
- name: out_n
description: The name of the output, that shall be asserted
required: true
schema:
type: string
enum:
- out_0
- out_1
get:
summary: Get the current asserted/deasserted status of the output
tags: [Input/Output]
responses:
'200':
content:
application/json:
schema:
type: boolean
put:
summary: Set the asserted/deasserted status of the output
tags: [Input/Output]
requestBody:
content:
application/json:
schema:
type: boolean
responses:
'204':
description: The output was set to asserted/deasserted state
'400':
description: The value could not be parsed as boolean
/v1/uart/{rx_tx}/enabled:
parameters:
- name: rx_tx
description: The direction to get status for/modify
required: true
schema:
type: string
enum:
- rx
- tx
get:
summary: Check if the selected direction is activated
tags: [Input/Output, UART]
responses:
'200':
content:
application/json:
schema:
type: boolean
put:
summary: Activate/Deactivate the direction
tags: [Input/Output, UART]
requestBody:
content:
application/json:
schema:
type: boolean
responses:
'204':
description: The direction was enabled/disabled
'400':
description: The value could not be parsed as boolean
/v1/uart/powered:
get:
summary: Check if the power supply on the DUT UART connector is turned on
tags: [Input/Output, UART]
responses:
'200':
content:
application/json:
schema:
type: boolean
put:
summary: Turn the power supply on the DUT UART connector on/off
tags: [Input/Output, UART]
requestBody:
content:
application/json:
schema:
type: boolean
responses:
'204':
description: The UART supply was turned on/off
'400':
description: The value could not be parsed as boolean
/v1/iobus/powered:
get:
summary: Check if the IOBus power supply is turned on
tags: [Input/Output, IOBus]
responses:
'200':
content:
application/json:
schema:
type: boolean
put:
summary: Turn the IOBus supply on/off
tags: [Input/Output, IOBus]
requestBody:
content:
application/json:
schema:
type: boolean
responses:
'204':
description: The IOBus supply was turned on/off
'400':
description: The value could not be parsed as boolean
/v1/iobus/feedback/fault:
get:
summary: Check if the IOBus supply is in an error state
tags: [Input/Output, IOBus]
responses:
'200':
content:
application/json:
schema:
type: boolean
/v1/usb/host/{port}/feedback/current:
parameters:
- name: port
description: The port to get measurements for
required: true
schema:
type: string
enum:
- total
- port1
- port2
- port3
get:
summary: Get the current consumed by devices on this port
tags: [Input/Output, USB Host]
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Measurement'
/v1/output/{out_n}/feedback/voltage:
parameters:
- name: out_n
description: The output to get voltage feedback for
required: true
schema:
type: string
enum:
- out_0
- out_1
get:
summary: Get the voltage between the two OUT_N pins
tags: [Input/Output]
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Measurement'
/v1/iobus/feedback/current:
get:
summary: Get the current consumed by devices on the IOBus
tags: [Input/Output, IOBus]
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Measurement'
/v1/iobus/feedback/voltage:
get:
summary: Get the voltage of the IOBus power supply
description: A voltage dip indicates a fault on the bus
tags: [Input/Output, IOBus]
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Measurement'
/v1/dut/feedback/current:
get:
summary: Get the current consumed by the DUT
tags: [Input/Output, DUT Power]
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Measurement'
/v1/dut/feedback/voltage:
get:
summary: Get the voltage applied to the DUT
tags: [Input/Output, DUT Power]
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Measurement'
/v1/tac/service/{service}/action:
parameters:
- name: service
description: The service to perform the action on
required: true
schema:
type: string
enum:
- network-manager
- labgrid-exporter
- lxa-iobus
put:
summary: Perform an action on a systemd service
tags: [System]
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceAction'
responses:
'204':
description: The service was asked to perform the action
'400':
description: The value could not be parsed as action
/v1/tac/service/{service}/status:
parameters:
- name: service
description: The service to get the status for
required: true
schema:
type: string
enum:
- network-manager
- labgrid-exporter
- lxa-iobus
get:
summary: Get the status of a systemd service
tags: [System]
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceStatus'
/v1/tac/reboot:
put:
summary: Reboot the TAC
tags: [System]
requestBody:
content:
application/json:
schema:
type: boolean
responses:
'204':
description: If the body was true the TAC will soon reboot
'400':
description: The value could not be parsed as boolean
/v1/tac/time/now:
get:
summary: Get the current time on the TAC as milliseconds since the Unix Epoch
tags: [System]
responses:
'200':
content:
application/json:
schema:
type: number
/v1/tac/update/operation:
get:
summary: Get the currently running system update operation
tags: [Updating]
responses:
'200':
content:
application/json:
schema:
type: string
/v1/tac/update/progress:
get:
summary: Get the progress report of the running update operation
tags: [Updating]
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RaucProgress'
/v1/tac/update/slots:
get:
summary: Get the progress report of the running update operation
tags: [Updating]
responses:
'200':
content:
application/json:
schema:
type: object
/v1/tac/update/last_error:
get:
summary: Get the last error reported by the update system
tags: [Updating]
responses:
'200':
content:
application/json:
schema:
type: string
/v1/tac/update/install:
put:
summary: Request the installation of a RAUC bundle from an URL
tags: [Updating]
requestBody:
content:
application/json:
schema:
type: string
responses:
'204':
description: The value was parsed as string and will be tried
'400':
description: The value could not be parsed as string
/v1/tac/update/channels:
get:
summary: Get a list of update channels and available updates
tags: [Updating]
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateChannels'
/v1/tac/update/channels/reload:
put:
summary: Request an update of the channels list and update availability
tags: [Updating]
requestBody:
content:
application/json:
schema:
type: boolean
responses:
'204':
description: An update was requested (if true was sent)
'400':
description: The value could not be parsed as boolean
/v1/tac/update/should_reboot:
get:
summary: Should the system be rebooted as there is a new bundle in the other slot?
tags: [Updating]
responses:
'200':
content:
application/json:
schema:
type: boolean
/v1/tac/network/hostname:
get:
summary: Get the systems hostname
tags: [Network]
responses:
'200':
content:
application/json:
schema:
type: string
/v1/tac/network/tac-bridge:
get:
summary: Get the IPv4 addresses associated with the tac-bridge interface
tags: [Network]
responses:
'200':
content:
application/json:
schema:
type: array
items:
type: string
/v1/tac/network/interface/{if}:
parameters:
- name: if
description: The name of the interface to query
required: true
schema:
type: string
enum:
- dut
- uplink
get:
summary: Get the link status of the respective interface
tags: [Network]
responses:
'200':
content:
application/json:
schema:
type: object
properties:
speed:
type: number
carrier:
type: boolean
components:
schemas:
Screen:
type: string
enum:
- DutPower
- Usb
- DigOut
- System
- IoBus
- Uart
Alerts:
type: array
items:
type: string
enum:
- ScreenSaver
- Locator
- RebootConfirm
- UpdateAvailable
- UpdateInstallation
- Help
- Setup
ButtonEvent:
type: object
properties:
type: object
properties:
dir:
type: string
enum:
- Press
- Release
btn:
type: string
enum:
- Upper
- Lower
dur:
type: string
enum:
- Short
- Long
BlinkPattern:
type: object
properties:
repetitions:
type: integer
steps:
type: array
items:
type: array
oneOf:
- type: number
- type: object
properties:
secs:
type: integer
nanos:
type: integer
minItems: 2
maxItems: 2
DutPwrStatus:
type: string
enum:
- On
- Off
- OffFloating
- Changing
- InvertedPolarity
- OverCurrent
- OverVoltage
- RealtimeViolation
DutPwrRequest:
type: string
enum:
- On
- Off
- OffFloating
UsbDevice:
type: object
properties:
id_product:
type: string
id_vendor:
type: string
manufacturer:
type: string
product:
type: string
Measurement:
type: object
properties:
ts:
type: number
value:
type: number
Uname:
type: object
properties:
sysname:
type: string