-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathamplipi_api.yaml
12874 lines (12819 loc) Β· 416 KB
/
amplipi_api.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.2
info:
title: AmpliPi
description: | # The links in the description below are tested to work with redoc and may not be portable
This is the AmpliPi home audio system's control server.
# Configuration
This web interface allows you to control and configure your AmpliPi device.
At the moment the API is the only way to configure the AmpliPi.
If you set a password on the update page, you will need to provide a session token to any API requests. This token is available for viewing on the `Settings` -> `About` page. You can provide the token either as a query parameter called "?api-key=" or as a cookie named "amplipi-session". If there are no user passwords set, you can disregard this authentication scheme.
## Try it out!
__Using this web interface to test API commands:__
1. Go to an API request
1. Pick one of the examples
1. Edit it
1. Press the try button, it will send an API command/request to the AmpliPi
__Try getting the status:__
1. Go to [Status -> Get Status](#get-/api)
1. Click the Try button, you will see a response below with the full status/config of the AmpliPi controller
__Try changing a zone's name:__
1. Go to [Zone -> Update Zone](#patch-/api/zones/-zid-)
1. Next to **PATH PARAMETERS** click Zone 2 to fill in Zone 2's id
1. Under **REQUEST BODY** click Example and select "Change Name"
1. Edit the name to what you want to call the zone
1. Click the Try button, you will see a response below with the full status/config of the AmpliPi controller
__Try changing a group's name and zones:__
1. Go to [Group -> Update Group](#patch-/api/groups/-gid-)
1. Next to **PATH PARAMETERS** click Group 1 to fill in Group 1's id
1. Under **REQUEST BODY** click Example and select "Rezone Group"
1. Edit the name to what you want to call the group
1. Edit the zones that belong to the group
1. Click the Try button, you will see a response below with the full status/config of the AmpliPi controller
__Try creating a new group:__
1. Go to [Group -> Create Group](#post-/api/group)
1. Under **REQUEST BODY** click Example and select "Upstairs Group"
1. Edit the group name or zones array
1. Click the Try button, you will see a response below with the new group
__Here are some other things that you might want to change:__
- [Stream -> Create new stream](#post-/api/stream)
- [Preset -> Create preset](#post-/api/preset) (Have a look at the model to see what can be added here)
- [Source -> Set source](#patch-/api/sources/-sid-) (Try updating Source 1's name to "TV")
# More Info
Check out all of the different things you can do with this API:
- [Status](#tag--status)
- [Source](#tag--source)
- [Zone](#tag--zone)
- [Group](#tag--group)
- [Stream](#tag--stream)
- [Preset](#tag--preset)
# OpenAPI
This API is documented using the OpenAPI specification
version: '1.0'
contact:
email: [email protected]
name: Micronova
url: http://micro-nova.com
license:
name: GPL
url: https://github.com/micro-nova/AmpliPi/blob/main/COPYING
servers:
- url: ''
description: AmpliPi Controller
paths:
/debug:
get:
tags:
- status
summary: Debug
description: Returns debug status and configuration.
operationId: debug_debug_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/DebugResponse'
examples:
- debug: 'true'
apmHost: https://127.0.0.1:9345
version: 0.3.0
environment: development
- debug: null
apmHost: null
version: null
environment: null
/collected_stats/:
get:
summary: Get Collected Stats
description: Get the current contents of statcollector output file after filtering
out any empty stream data
operationId: get_collected_stats_collected_stats__get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
security:
- APIKeyCookie: []
- APIKeyQuery: []
post:
summary: Post Collected Stats
description: Send the contents of the statcollector output file to AmpliPi devs
operationId: post_collected_stats_collected_stats__post
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
security:
- APIKeyCookie: []
- APIKeyQuery: []
/collected_stats:
get:
summary: Get Collected Stats
description: Get the current contents of statcollector output file after filtering
out any empty stream data
operationId: get_collected_stats_collected_stats__get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
security:
- APIKeyCookie: []
- APIKeyQuery: []
post:
summary: Post Collected Stats
description: Send the contents of the statcollector output file to AmpliPi devs
operationId: post_collected_stats_collected_stats__post
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
security:
- APIKeyCookie: []
- APIKeyQuery: []
/api/:
get:
tags:
- status
summary: Get Status
description: Get the system status and configuration
operationId: get_status_api__get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
examples:
Status of Jason's AmpliPi:
value:
version: 1
groups:
- id: 100
mute: true
name: Upstairs
vol_delta: -39
vol_f: 0.51
zones:
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 11
- 16
- id: 102
mute: true
name: Outside
source_id: 1
vol_delta: -41
vol_f: 0.4909090909090909
zones:
- 9
- 10
- id: 103
mute: true
name: Offices
vol_delta: -54
vol_f: 0.33
zones:
- 0
- 7
- id: 104
mute: true
name: Downstairs
source_id: 1
vol_delta: -57
vol_f: 0.28500000000000003
zones:
- 12
- 13
- 14
- 15
- 17
- id: 105
mute: true
name: Main Unit
vol_delta: -39
vol_f: 0.51
zones:
- 0
- 1
- 2
- 3
- 4
- 5
- id: 106
mute: true
name: Expander 1 (HV)
vol_delta: -39
vol_f: 0.515
zones:
- 6
- 7
- 8
- 9
- 10
- 11
- id: 107
mute: true
name: Expander 2
vol_delta: -58
vol_f: 0.275
zones:
- 12
- 13
- 14
- 15
- 16
- 17
info:
config_file: house.json
fw:
- git_dirty: false
git_hash: de0f8eb
version: '1.6'
- git_dirty: false
git_hash: de0f8eb
version: '1.6'
- git_dirty: false
git_hash: de0f8eb
version: '1.6'
latest_release: 0.1.9
mock_ctrl: false
mock_streams: false
is_streamer: false
lms_mode: false
online: true
stream_types_available:
- fmradio
- internetradio
version: 0.1.9
presets:
- id: 10000
last_used: 1658242203
name: Mute All
state:
zones:
- id: 0
mute: true
- id: 1
mute: true
- id: 2
mute: true
- id: 3
mute: true
- id: 4
mute: true
- id: 5
mute: true
- id: 6
mute: true
- id: 7
mute: true
- id: 8
mute: true
- id: 9
mute: true
- id: 10
mute: true
- id: 11
mute: true
- id: 12
mute: true
- id: 13
mute: true
- id: 14
mute: true
- id: 15
mute: true
- id: 16
mute: true
- id: 17
mute: true
sources:
- id: 0
info:
img_url: static/imgs/disconnected.png
name: None
state: stopped
supported_cmds: []
input: ''
name: TV
- id: 1
info:
img_url: static/imgs/disconnected.png
name: None
state: stopped
supported_cmds: []
input: ''
name: Record Player
- id: 2
info:
album: Charleston Butterfly
artist: Parov Stelar
img_url: http://mediaserver-cont-sv5-2-v4v6.pandora.com/images/00/4c/b7/12/d64a4ffe82251fcc9c44555c/1080W_1080H.jpg
name: Blackmill Radio - pandora
state: playing
station: Blackmill Radio
supported_cmds:
- play
- pause
- next
- love
- ban
- shelve
- restart
track: Chambermaid Swing
input: stream=1006
name: Input 3
- id: 3
info:
album: Joshua Bell, Romance of the Violin
artist: Fryderyk Chopin
img_url: http://cont.p-cdn.us/images/e9/cc/f2/8e/890e4e5e9940c98ba864aaee/1080W_1080H.jpg
name: Classical - pandora
state: playing
station: Antonio Vivaldi Radio
supported_cmds:
- play
- pause
- next
- love
- ban
- shelve
- restart
track: Nocturne For Piano In C Sharp Minor, Kk Anh.ia/6
input: stream=1005
name: Input 4
streams:
- id: 1000
logo: https://somafm.com/img3/groovesalad-400.jpg
name: Groove Salad
type: internetradio
url: http://ice6.somafm.com/groovesalad-32-aac
- id: 1001
name: Jason's House
type: airplay
- id: 1002
name: Jasons House
type: spotify
- id: 1003
name: Jason's House
type: dlna
- id: 1004
name: Matt and Kim Radio
password: ''
station: '135242131387190035'
type: pandora
user: [email protected]
- id: 1005
name: Classical
password: ''
station: '134892486689565953'
type: pandora
user: [email protected]
- id: 1006
name: Blackmill Radio
password: ''
station: '91717963601693449'
type: pandora
user: [email protected]
- id: 1007
logo: http://www.beatlesradio.com/content/images/thumbs/0000587.gif
name: Beatles Radio
type: internetradio
url: http://www.beatlesradio.com:8000/stream/1/
zones:
- disabled: false
id: 0
mute: true
name: Software Office
source_id: 2
vol: -56
vol_f: 0.28
vol_max: -20
vol_min: -70
- disabled: false
id: 1
mute: true
name: Upstairs Living Room
source_id: 3
vol: -49
vol_f: 0.42
vol_max: -20
vol_min: -70
- disabled: false
id: 2
mute: true
name: Upstairs Dining
source_id: 0
vol: -66
vol_f: 0.08
vol_max: -20
vol_min: -70
- disabled: false
id: 3
mute: true
name: Upstairs Laundry
source_id: 0
vol: -66
vol_f: 0.08
vol_max: -20
vol_min: -70
- disabled: false
id: 4
mute: true
name: Upstairs Kitchen High
source_id: 0
vol: -45
vol_f: 0.5
vol_max: -20
vol_min: -70
- disabled: false
id: 5
mute: true
name: Upstairs Master Bath
source_id: 0
vol: -23
vol_f: 0.94
vol_max: -20
vol_min: -70
- disabled: false
id: 6
mute: true
name: Upstairs Kitchen Low HV
source_id: 0
vol: -66
vol_f: 0.1
vol_max: -30
vol_min: -70
- disabled: false
id: 7
mute: true
name: Hardware Office HV
source_id: 0
vol: -51
vol_f: 0.38
vol_max: -20
vol_min: -70
- disabled: false
id: 8
mute: true
name: Basement Workshop HV
source_id: 0
vol: -13
vol_f: 0.95
vol_max: -10
vol_min: -70
- disabled: false
id: 9
mute: true
name: Screened Room HV
source_id: 1
vol: -43
vol_f: 0.4909090909090909
vol_max: -15
vol_min: -70
- disabled: false
id: 10
mute: true
name: Upstairs Deck Living HV
source_id: 1
vol: -43
vol_f: 0.4909090909090909
vol_max: -15
vol_min: -70
- disabled: false
id: 11
mute: true
name: Upstairs Main Bedroom HV
source_id: 0
vol: -66
vol_f: 0.08
vol_max: -20
vol_min: -70
- disabled: false
id: 12
mute: true
name: Downstairs Living Room
source_id: 1
vol: -48
vol_f: 0.44
vol_max: -20
vol_min: -70
- disabled: false
id: 13
mute: true
name: Downstairs Dining
source_id: 1
vol: -48
vol_f: 0.44
vol_max: -20
vol_min: -70
- disabled: false
id: 14
mute: true
name: Downstairs Bath
source_id: 1
vol: -64
vol_f: 0.12
vol_max: -20
vol_min: -70
- disabled: false
id: 15
mute: true
name: Downstairs Laundry
source_id: 1
vol: -48
vol_f: 0.44
vol_max: -20
vol_min: -70
- disabled: false
id: 16
mute: true
name: Upstairs Main Bath
source_id: 0
vol: -66
vol_f: 0.1
vol_max: -30
vol_min: -70
- disabled: false
id: 17
mute: true
name: Downstairs Bedroom
source_id: 1
vol: -52
vol_f: 0.45
vol_max: -30
vol_min: -70
security:
- APIKeyCookie: []
- APIKeyQuery: []
/api:
get:
tags:
- status
summary: Get Status
description: Get the system status and configuration
operationId: get_status_api_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
examples:
Status of Jason's AmpliPi:
value:
version: 1
groups:
- id: 100
mute: true
name: Upstairs
vol_delta: -39
vol_f: 0.51
zones:
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 11
- 16
- id: 102
mute: true
name: Outside
source_id: 1
vol_delta: -41
vol_f: 0.4909090909090909
zones:
- 9
- 10
- id: 103
mute: true
name: Offices
vol_delta: -54
vol_f: 0.33
zones:
- 0
- 7
- id: 104
mute: true
name: Downstairs
source_id: 1
vol_delta: -57
vol_f: 0.28500000000000003
zones:
- 12
- 13
- 14
- 15
- 17
- id: 105
mute: true
name: Main Unit
vol_delta: -39
vol_f: 0.51
zones:
- 0
- 1
- 2
- 3
- 4
- 5
- id: 106
mute: true
name: Expander 1 (HV)
vol_delta: -39
vol_f: 0.515
zones:
- 6
- 7
- 8
- 9
- 10
- 11
- id: 107
mute: true
name: Expander 2
vol_delta: -58
vol_f: 0.275
zones:
- 12
- 13
- 14
- 15
- 16
- 17
info:
config_file: house.json
fw:
- git_dirty: false
git_hash: de0f8eb
version: '1.6'
- git_dirty: false
git_hash: de0f8eb
version: '1.6'
- git_dirty: false
git_hash: de0f8eb
version: '1.6'
latest_release: 0.1.9
mock_ctrl: false
mock_streams: false
is_streamer: false
lms_mode: false
online: true
stream_types_available:
- fmradio
- internetradio
version: 0.1.9
presets:
- id: 10000
last_used: 1658242203
name: Mute All
state:
zones:
- id: 0
mute: true
- id: 1
mute: true
- id: 2
mute: true
- id: 3
mute: true
- id: 4
mute: true
- id: 5
mute: true
- id: 6
mute: true
- id: 7
mute: true
- id: 8
mute: true
- id: 9
mute: true
- id: 10
mute: true
- id: 11
mute: true
- id: 12
mute: true
- id: 13
mute: true
- id: 14
mute: true
- id: 15
mute: true
- id: 16
mute: true
- id: 17
mute: true
sources:
- id: 0
info:
img_url: static/imgs/disconnected.png
name: None
state: stopped
supported_cmds: []
input: ''
name: TV
- id: 1
info:
img_url: static/imgs/disconnected.png
name: None
state: stopped
supported_cmds: []
input: ''
name: Record Player
- id: 2
info:
album: Charleston Butterfly
artist: Parov Stelar
img_url: http://mediaserver-cont-sv5-2-v4v6.pandora.com/images/00/4c/b7/12/d64a4ffe82251fcc9c44555c/1080W_1080H.jpg
name: Blackmill Radio - pandora
state: playing
station: Blackmill Radio
supported_cmds:
- play
- pause
- next
- love
- ban
- shelve
- restart
track: Chambermaid Swing
input: stream=1006
name: Input 3
- id: 3
info:
album: Joshua Bell, Romance of the Violin
artist: Fryderyk Chopin
img_url: http://cont.p-cdn.us/images/e9/cc/f2/8e/890e4e5e9940c98ba864aaee/1080W_1080H.jpg
name: Classical - pandora
state: playing
station: Antonio Vivaldi Radio
supported_cmds:
- play
- pause
- next
- love
- ban
- shelve
- restart
track: Nocturne For Piano In C Sharp Minor, Kk Anh.ia/6
input: stream=1005
name: Input 4
streams:
- id: 1000
logo: https://somafm.com/img3/groovesalad-400.jpg
name: Groove Salad
type: internetradio
url: http://ice6.somafm.com/groovesalad-32-aac
- id: 1001
name: Jason's House
type: airplay
- id: 1002
name: Jasons House
type: spotify
- id: 1003
name: Jason's House
type: dlna
- id: 1004
name: Matt and Kim Radio
password: ''
station: '135242131387190035'
type: pandora
user: [email protected]
- id: 1005
name: Classical
password: ''
station: '134892486689565953'
type: pandora
user: [email protected]
- id: 1006
name: Blackmill Radio
password: ''
station: '91717963601693449'
type: pandora
user: [email protected]
- id: 1007
logo: http://www.beatlesradio.com/content/images/thumbs/0000587.gif
name: Beatles Radio
type: internetradio
url: http://www.beatlesradio.com:8000/stream/1/
zones:
- disabled: false
id: 0
mute: true
name: Software Office
source_id: 2
vol: -56
vol_f: 0.28
vol_max: -20
vol_min: -70
- disabled: false
id: 1
mute: true
name: Upstairs Living Room
source_id: 3
vol: -49
vol_f: 0.42
vol_max: -20
vol_min: -70
- disabled: false
id: 2
mute: true
name: Upstairs Dining
source_id: 0
vol: -66
vol_f: 0.08
vol_max: -20
vol_min: -70
- disabled: false
id: 3
mute: true
name: Upstairs Laundry
source_id: 0
vol: -66
vol_f: 0.08
vol_max: -20
vol_min: -70
- disabled: false
id: 4
mute: true
name: Upstairs Kitchen High
source_id: 0
vol: -45
vol_f: 0.5
vol_max: -20
vol_min: -70
- disabled: false
id: 5
mute: true
name: Upstairs Master Bath
source_id: 0
vol: -23
vol_f: 0.94
vol_max: -20
vol_min: -70
- disabled: false
id: 6
mute: true
name: Upstairs Kitchen Low HV
source_id: 0
vol: -66
vol_f: 0.1
vol_max: -30
vol_min: -70
- disabled: false
id: 7
mute: true
name: Hardware Office HV
source_id: 0
vol: -51
vol_f: 0.38
vol_max: -20
vol_min: -70
- disabled: false
id: 8
mute: true
name: Basement Workshop HV
source_id: 0
vol: -13
vol_f: 0.95
vol_max: -10
vol_min: -70
- disabled: false
id: 9
mute: true
name: Screened Room HV
source_id: 1
vol: -43
vol_f: 0.4909090909090909
vol_max: -15
vol_min: -70
- disabled: false
id: 10
mute: true
name: Upstairs Deck Living HV
source_id: 1
vol: -43
vol_f: 0.4909090909090909
vol_max: -15
vol_min: -70
- disabled: false
id: 11
mute: true
name: Upstairs Main Bedroom HV
source_id: 0
vol: -66
vol_f: 0.08
vol_max: -20
vol_min: -70
- disabled: false
id: 12
mute: true
name: Downstairs Living Room
source_id: 1
vol: -48
vol_f: 0.44
vol_max: -20
vol_min: -70
- disabled: false
id: 13
mute: true
name: Downstairs Dining
source_id: 1
vol: -48
vol_f: 0.44
vol_max: -20
vol_min: -70
- disabled: false
id: 14
mute: true
name: Downstairs Bath
source_id: 1
vol: -64
vol_f: 0.12
vol_max: -20
vol_min: -70
- disabled: false
id: 15
mute: true
name: Downstairs Laundry
source_id: 1
vol: -48
vol_f: 0.44
vol_max: -20
vol_min: -70
- disabled: false
id: 16
mute: true
name: Upstairs Main Bath
source_id: 0
vol: -66
vol_f: 0.1
vol_max: -30
vol_min: -70
- disabled: false
id: 17
mute: true