-
Notifications
You must be signed in to change notification settings - Fork 2
/
openapi.yaml
12726 lines (12527 loc) · 433 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: Remote Two REST API
version: 0.26.3
contact:
name: API Support
url: 'https://github.com/unfoldedcircle/core-api/issues'
license:
name: Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
url: 'https://creativecommons.org/licenses/by-sa/4.0/'
description: "The Unfolded Circle Remote Two REST API allows to configure the remote and manage custom resource files.\nFurthermore, API-keys for the WebSocket & REST APIs can be created.\n\n## Overview\n\nThe Remote Two WebSockets Core-API allows you to interact with the Unfolded Circle remote-core application and take\nfull control of its features.\n\nThe focus of the Core-API is to provide all functionality for the UI application and the web-configurator. \nIt may also be used by other external systems and integration drivers, if specific configuration or interaction\nfeatures are required, which are not present in the Integration API.\n\n## Authentication\n\nAll API endpoints besides `/api/pub` are secured. Available authentication methods are Basic Auth for every request\nand cookie based session login with the `/api/pub/login` endpoint.\n\n## \U0001F6A7 Missing Features\n\n**This API is a preview version and does not yet contain all functionality.**\n\nThe following features will be continuously added (in no particular order):\n\n- Upload of custom certificate\n- Configuration import & export\n- Static network configuration\n\nPlease check the [core-api GitHub issues](https://github.com/unfoldedcircle/core-api/issues) for the current state. \n\n## API Versioning\n\nThe API is versioned according to [SemVer](https://semver.org/). \nThe initial public release will be `1.0.0` once it is considered stable enough with some initial integration\nimplementations and developer examples.\n\n**Any major version zero (`0.y.z`) is for initial development and may change at any time!** \nI.e. backward compatibility for minor releases is not yet established, anything MAY change at any time!\nWe try avoiding it, but it might still happen...\n"
externalDocs:
description: Find out more about the Remote Two
url: 'https://www.unfoldedcircle.com/'
servers:
- url: /api
- url: 'http://localhost:8080/api'
- url: 'https://localhost:8443/api'
- url: 'http://unfolded-simulator.local:8080/api'
- url: 'https://unfolded-simulator.local:8443/api'
security:
- basicAuth: []
- cookieAuth: []
tags:
- name: info
description: "\U0001F481 Public status information and health checks"
- name: auth
description: "\U0001F510 Session authentication"
- name: api-keys
description: "\U0001F511 API keys for authentication."
- name: external-token
description: "\U0001F48E Access token handling for external systems."
- name: resources
description: "\U0001F508 Media files handling, e.g. manage background images, icons or sound effects."
- name: integrations
description: "\U0001F9E9 Integration handling"
- name: entities
description: "\U0001F4FA Common handling of configured entities like sending commands and modifying editable properties. \nEntities are usually provided by integrations, except the special activity, macro and infrared-remote entities.\n"
- name: activities
description: "\U0001F39B️ Combine multiple entities into an activity with optional on- & off-sequences, physical button mappings and a\ncustom user interface.\n"
- name: macros
description: "\U0001F522 Macros execute a sequence of commands which is exposed as an entity command. Macros don't have a custom user\ninterface.\n"
- name: infrared
description: "\U0001F308 Infrared code set lookup, custom IR code management and IR emitter devices.\n"
- name: remotes
description: "\U0001F3AE Customizable user interface and button mappings for remote-entities\ncontrolling single IR- and the like devices.\n"
- name: profiles
description: "\U0001F464 User profile configuration with profiles, groups, pages"
- name: cfg
description: "\U0001F4DD Configuration settings"
- name: dock
description: "\U0001F6F0 Docking station management, discovery and infrared testing functions"
- name: system
description: "\U0001F477 System information and commands - **work in progress**"
paths:
/pub/version:
get:
tags:
- info
summary: Get version information about installed components.
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/VersionInfo'
security: []
/pub/status:
get:
tags:
- info
summary: Get status information about the system.
responses:
'200':
description: Successful operation
content:
application/json:
schema:
type: object
properties:
memory:
type: object
description: Memory status
properties:
total_memory:
type: integer
description: Amount of available RAM in KB
available_memory:
type: integer
description: Amount of available RAM in KB for (re)use
used_memory:
type: integer
description: Amount of used RAM in KB
total_swap:
type: integer
description: SWAP size in KB
used_swap:
type: integer
description: Free SWAP in KB
load_avg:
type: object
description: System load average
properties:
one:
type: number
description: Average load within one minute
five:
type: number
description: Average load within five minutes
fifteen:
type: number
description: Average load within fifteen minutes
filesystem:
type: object
description: Filesystem status
properties:
user_data:
type: object
properties:
available:
type: integer
description: Amount of available disk space in KB
used:
type: integer
description: Amount of used disk space in KB
security: []
/pub/health_check:
get:
tags:
- info
summary: Retrieve health check information about the system and running services.
responses:
'200':
description: Successful operation
content:
application/json:
schema:
type: object
properties:
db:
$ref: '#/components/schemas/HealthStatus'
ui:
$ref: '#/components/schemas/HealthStatus'
storage:
$ref: '#/components/schemas/HealthStatus'
'500':
$ref: '#/components/responses/Err500InternalServerError'
security: []
/pub/login:
post:
tags:
- auth
summary: Log in and create session.
description: |
A successful login returns a session authentication cookie which need to be submitted in subsequent requests.
The session ID is returned in a cookie named `id`.
operationId: login
requestBody:
required: true
description: A JSON object containing the username and password.
content:
application/json:
schema:
$ref: '#/components/schemas/LoginRequest'
security: []
responses:
'200':
description: Successfully authenticated.
headers:
Set-Cookie:
schema:
type: string
example: id=abcde12345; Path=/; HttpOnly
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
'400':
$ref: '#/components/responses/Err400BadRequest'
'401':
$ref: '#/components/responses/Err401Unauthorized'
'500':
$ref: '#/components/responses/Err500InternalServerError'
/pub/logout:
post:
tags:
- auth
summary: Log out from session.
description: |
The session is removed and the session cookie named `id` is cleared.
operationId: logout
parameters:
- name: id
in: cookie
description: Session cookie
schema:
type: string
security:
- cookieAuth: []
responses:
'200':
description: Successfully logged out.
headers:
Set-Cookie:
schema:
type: string
example: 'id=; HttpOnly; Path=/; Max-Age=0; Expires=Sat, 26 Jun 2021 12:05:09 GMT'
'500':
$ref: '#/components/responses/Err500InternalServerError'
/auth/api_keys:
head:
tags:
- api-keys
summary: Get total number of available API keys.
operationId: getApiKeyCount
parameters:
- $ref: '#/components/parameters/active'
responses:
'200':
description: Successful operation
headers:
Pagination-Count:
description: Total number of items.
schema:
type: integer
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
get:
tags:
- api-keys
summary: List available API keys.
description: |
This endpoint is only intended for a management UI and not for client access. The response contains a key
identifier in `key_id` which is required for further operations on the API key, like disabling or revoking it or
adding a description.
operationId: getApiKeys
parameters:
- $ref: '#/components/parameters/active'
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/limit'
responses:
'200':
description: Successful operation
headers:
Pagination-Count:
description: Total number of items.
schema:
type: integer
Pagination-Limit:
description: Number of returned items.
schema:
type: integer
Pagination-Page:
description: Current page number. 1-based.
schema:
type: integer
content:
application/json:
schema:
$ref: '#/components/schemas/ApiKeys'
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
'404':
$ref: '#/components/responses/Err404NotFound'
post:
tags:
- api-keys
summary: Create an API key for the Remote Two APIs.
description: |
The returned API key in `api_key` is only visible in this response. Afterwards it cannot be retrieved anymore!
The newly created API key is usually not yet enabled for use and must first be approved by the user on the remote.
The required scopes must be provided. They let you specify what exactly a client needs to access.
When the access token request is displayed to the remote user for approval, the requested scopes will be
displayed to them.
An error is returned if an API key already exists for the provided `name`. To issue a new API key for the same
name, the old token needs to be revoked first.
operationId: createApiKey
requestBody:
description: Client information requesting access
content:
application/json:
schema:
$ref: '#/components/schemas/ApiKeyRequest'
example:
name: My integration
scopes:
- admin
required: true
responses:
'201':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ApiKeyResponse'
'400':
$ref: '#/components/responses/Err400BadRequest'
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
'422':
$ref: '#/components/responses/Err422UnprocessableEntity'
delete:
tags:
- api-keys
summary: Delete all API keys.
description: |
This endpoint is only intended for a management UI and not for client access. The required `key_id` parameter is
returned in the `GET /auth/api_keys` response.
operationId: deleteAllApiKeys
responses:
'200':
$ref: '#/components/responses/SuccessMessage'
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
'/auth/api_keys/{apiKeyId}':
get:
tags:
- api-keys
summary: Get information about an API key.
description: |
The API key itself is non-retrievable. This function provides the access rights and validity of a defined API key.
This endpoint is only intended for a management UI and not for client access. The required `key_id` parameter is
returned in the `GET /auth/api_keys` response.
operationId: getApiKey
parameters:
- $ref: '#/components/parameters/api_key_id'
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ApiKey'
'400':
$ref: '#/components/responses/Err400BadRequest'
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
'404':
$ref: '#/components/responses/Err404NotFound'
patch:
tags:
- api-keys
summary: Update properties of an API key.
operationId: updateApiKey
description: |
Activate, deactivate, rename or set validity periods of an existing API key.
Note: access scopes cannot be changed. This requires to revoke the API key and request a new one.
This endpoint is only intended for a management UI and not for client access. The required `key_id` parameter is
returned in the `GET /auth/api_keys` response.
parameters:
- $ref: '#/components/parameters/api_key_id'
requestBody:
description: Properties to update in the existing token.
content:
application/json:
schema:
$ref: '#/components/schemas/ApiKeyUpdate'
required: true
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ApiKey'
'400':
$ref: '#/components/responses/Err400BadRequest'
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
'404':
$ref: '#/components/responses/Err404NotFound'
delete:
tags:
- api-keys
summary: Revoke an API key.
description: |
The API key will be deleted, no further access is possible.
This endpoint is only intended for a management UI and not for client access. The required `key_id` parameter is
returned in the `GET /auth/api_keys` response.
operationId: deleteApiKey
parameters:
- $ref: '#/components/parameters/api_key_id'
responses:
'200':
$ref: '#/components/responses/SuccessMessage'
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
'404':
$ref: '#/components/responses/Err404NotFound'
/auth/scopes:
get:
tags:
- api-keys
summary: Get available access scopes.
description: |
Access scopes are used to create tokens for the WebSocket API.
operationId: getAccessScopes
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Scopes'
/auth/external:
get:
tags:
- external-token
summary: Get registered external systems.
description: |
External systems are handled with the R2 integrations. Before an access token for such a system can be provided,
the corresponding system needs to be registered.
_TODO: reference to WebSocket API for integration registration._
If the expected system name is not returned by this call, any operations on that system name will fail:
`/auth/external/{system}`.
Therefore, it's advisable to either call this method first or react on the 404 error while providing or updating an
external system token, to inform the client user, that the integration is not available on the remote.
operationId: getExternalSystems
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ExternalSystems'
delete:
tags:
- external-token
summary: Remove all external access tokens.
description: |
Management operation to delete all external access tokens. Attention: this cannot be reverted!
operationId: deleteAllExternalAccessTokens
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
'/auth/external/{system}':
post:
tags:
- external-token
summary: Provide an access token of an external system.
description: |
An access token is usually required to connect to external systems like Home Assistant.
This method allows the external system to automatically provide the access token for the corresponding R2
integration instead of forcing the user to type it in. If the token name already exists for the given system,
error `422` is returned.
Use the put method to update an existing token.
The format of the access token depends on the external system and the involved R2 integration.
It could be a UUID, a JWT or any other representation required for the integration to communicate with the
external system.
The `system` parameter is determined by the registered R2 integration. Only registered system name identifiers are
valid, otherwise error `404` will be returned.
E.g. a "FooBar" integration might register the system identifier name "foobar".
Use the `GET /auth/external` method the retrieve the registered systems.
operationId: addExternalAccessToken
parameters:
- $ref: '#/components/parameters/system'
requestBody:
description: Access token that needs to be added to the remote
content:
application/json:
schema:
$ref: '#/components/schemas/ExternalAccessTokenRequest'
required: true
responses:
'201':
description: Successful operation returning the token identifier in the response.
content:
application/json:
schema:
type: object
properties:
token_id:
type: string
format: '^[a-zA-Z0-9\-_]+$'
minLength: 1
maxLength: 36
description: |
Unique token identifier, used for later token management through the external system or management ui.
If the token identifier has been provided in the request, then then same identifier is returned, otherwise a
UUID is generated.
required:
- token_it
'400':
$ref: '#/components/responses/Err400BadRequest'
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
'404':
$ref: '#/components/responses/Err404NotFound'
'422':
$ref: '#/components/responses/Err422UnprocessableEntity'
x-codegen-request-body-name: body
head:
tags:
- external-token
summary: Get total number of available tokens for an external system.
operationId: getExternalAccessTokenCount
parameters:
- $ref: '#/components/parameters/system'
responses:
'200':
description: Successful operation
headers:
Pagination-Count:
description: Total number of items.
schema:
type: integer
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
'404':
$ref: '#/components/responses/Err404NotFound'
get:
tags:
- external-token
summary: List available tokens for an external system.
operationId: getExternalAccessTokens
parameters:
- $ref: '#/components/parameters/system'
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/limit'
responses:
'200':
description: Successful operation
headers:
Pagination-Count:
description: Total number of items.
schema:
type: integer
Pagination-Limit:
description: Number of returned items.
schema:
type: integer
Pagination-Page:
description: Current page number. 1-based.
schema:
type: integer
content:
application/json:
schema:
$ref: '#/components/schemas/ExternalAccessTokens'
'400':
$ref: '#/components/responses/Err400BadRequest'
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
'404':
$ref: '#/components/responses/Err404NotFound'
delete:
tags:
- external-token
summary: Remove all access tokens of an external system.
operationId: deleteExternalAccessTokensBySystem
parameters:
- $ref: '#/components/parameters/system'
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
'404':
$ref: '#/components/responses/Err404NotFound'
'/auth/external/{system}/{tokenId}':
get:
tags:
- external-token
summary: Get external access token.
operationId: getExternalAccessToken
parameters:
- $ref: '#/components/parameters/system'
- $ref: '#/components/parameters/token_id'
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ExternalAccessToken'
'400':
$ref: '#/components/responses/Err400BadRequest'
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
'404':
$ref: '#/components/responses/Err404NotFound'
put:
tags:
- external-token
summary: Replace an existing access token of an external system.
description: |
This methods allows an already provided token of an external system to be updated. The token is identified by
the system name and the token identification.
operationId: replaceExternalAccessToken
parameters:
- $ref: '#/components/parameters/system'
- $ref: '#/components/parameters/token_id'
requestBody:
description: Access token to update
content:
application/json:
schema:
$ref: '#/components/schemas/ExternalAccessTokenRequest'
required: true
responses:
'200':
$ref: '#/components/responses/SuccessMessage'
'400':
$ref: '#/components/responses/Err400BadRequest'
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
'404':
$ref: '#/components/responses/Err404NotFound'
delete:
tags:
- external-token
summary: Remove an external access token.
description: |
No error is returned if the `tokenId` doesn't exist. `404` is only returned it the `system` is not found.
operationId: deleteExternalAccessToken
parameters:
- $ref: '#/components/parameters/system'
- $ref: '#/components/parameters/token_id'
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
'404':
$ref: '#/components/responses/Err404NotFound'
/resources:
get:
tags:
- resources
summary: Get supported media resource types.
operationId: getResourceTypes
responses:
'200':
description: Successful operation.
content:
application/json:
schema:
$ref: '#/components/schemas/SupportedResources'
example:
- type: Icon
name:
en: Icon
de: Icon
description:
en: User interface icons for entities and integrations. Icons must be of size 90x90 pixels and either in PNG or JPG format. Maximum size is 32 KB.
de: Icons für die Benutzeroberfläche von Objekten und Integrationen. Die Icons müssen 90x90 Pixel gross und im PNG oder JPG Format sein. Maximale Grösse ist 32 KB.
file_formats:
- png
- jpg
max_file_size: 32768
max_count: 100
image:
sizes:
- width: 90
height: 90
- type: TvChannelIcon
name:
en: TV channel icon
de: TV Sender Icon
description:
en: User interface icons for TV channels. Icons must be of size 90x90 pixels and either in PNG or JPG format. Maximum size is 32 KB.
de: TV Sender Icons für die Benutzeroberfläche. Die Icons müssen 90x90 Pixel gross und im PNG oder JPG Format sein. Maximale Grösse ist 32 KB.
file_formats:
- png
- jpg
max_file_size: 32768
max_count: 256
image:
sizes:
- width: 90
height: 90
- type: BackgroundImage
name:
en: Background image
de: Hintergrund Bild
description:
en: Background image for user interface profile pages. Images must be of size 275x480 pixels and either in PNG or JPG format. Maximum size is 1 MB.
de: Hintergrund Bild für Profil Seiten. Die Bilder müssen 275x480 Pixel gross und im PNG oder JPG Format sein. Maximale Grösse ist 1 MB.
file_formats:
- png
- jpg
max_file_size: 1048576
max_count: 30
image:
sizes:
- width: 275
height: 480
- type: Sound
name:
en: Sound effect
de: Klangeffekt
description:
en: User interface sound effects. Maximum size is 1 MB.
de: Klangeffekte für die Benutzeroberfläche. Maximale Grösse ist 1 MB.
file_formats:
- wav
max_file_size: 1048576
max_count: 50
sound:
bits:
- 8
- 16
channels:
- 1
- 2
sampling_rates:
- 11025
- 22050
- 44100
delete:
tags:
- resources
summary: Delete all resources.
operationId: deleteAllResources
parameters:
- $ref: '#/components/parameters/resource_type_query'
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
'/resources/{type}':
head:
tags:
- resources
summary: Get total number of available resources of a given type.
operationId: getResourceTypeItemsCount
parameters:
- $ref: '#/components/parameters/resource_type'
responses:
'200':
description: Successful operation
headers:
Pagination-Count:
description: Total number of items.
schema:
type: integer
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
'404':
$ref: '#/components/responses/Err404NotFound'
get:
tags:
- resources
summary: List available media resources of a given type.
operationId: getResourceTypeItems
parameters:
- $ref: '#/components/parameters/resource_type'
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/limit'
responses:
'200':
description: Successful operation
headers:
Pagination-Count:
description: Total number of items.
schema:
type: integer
Pagination-Limit:
description: Number of returned items.
schema:
type: integer
Pagination-Page:
description: Current page number. 1-based.
schema:
type: integer
content:
application/json:
schema:
$ref: '#/components/schemas/ResourceItems'
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
'404':
$ref: '#/components/responses/Err404NotFound'
post:
tags:
- resources
summary: Upload media resource files.
description: |
Upload one or more binary resource files as form-data. Files must conform to the given type according to the metadata
returned in `GET /api/resources`. E.g. an icon resource has other image size restrictions than a background image.
The file names are normalized (e.g. spaces replaced with underscores) and returned as resource identifiers.
Uploaded resources are verified, if they match expected formats. Status codes:
- `400`: resource doesn't confirm to the expected parameters.
- `422`: resource already exists with the same name. Already existing resource files are NOT overwritten.
- `507`: insufficient storage to save a new resource.
operationId: uploadFile
parameters:
- $ref: '#/components/parameters/resource_type'
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
file:
type: string
format: binary
responses:
'201':
description: Successful operation.
content:
application/json:
schema:
$ref: '#/components/schemas/ResourceItems'
'400':
$ref: '#/components/responses/Err400BadRequest'
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
'404':
$ref: '#/components/responses/Err404NotFound'
'422':
$ref: '#/components/responses/Err422UnprocessableEntity'
'507':
$ref: '#/components/responses/Err507InsufficientStorage'
delete:
tags:
- resources
summary: Delete all resources of a given type.
operationId: deleteResources
parameters:
- $ref: '#/components/parameters/resource_type'
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
'404':
$ref: '#/components/responses/Err404NotFound'
'/resources/{type}/{id}':
get:
tags:
- resources
summary: Download a media resource.
operationId: getResource
parameters:
- $ref: '#/components/parameters/resource_type'
- $ref: '#/components/parameters/resource_id'
responses:
'200':
description: A resource file
content:
image/png:
schema:
type: string
format: binary
image/jpg:
schema:
type: string
format: binary
audio/wav:
schema:
type: string
format: binary
application/octet-stream:
schema:
type: string
format: binary
'404':
$ref: '#/components/responses/Err404NotFound'
delete:
tags:
- resources
summary: Delete a media resource.
operationId: deleteResource
parameters:
- $ref: '#/components/parameters/resource_type'
- $ref: '#/components/parameters/resource_id'
responses:
'200':
$ref: '#/components/responses/SuccessMessage'
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
'404':
$ref: '#/components/responses/Err404NotFound'
/intg:
head:
tags:
- integrations
summary: Get total number of configured and external integrations.
operationId: getIntegrationStatusCount
responses:
'200':
description: Successful operation.
headers:
Pagination-Count:
description: Total number of items.
schema:
type: integer
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
get:
tags:
- integrations
summary: Get overview of configured and external integrations.
description: |
Retrieve an overview of the configured integrations and their current connection state and all external
integrations which are ready to be configured. This overview is meant for an integration management frontend like
the web-configurator to avoid calling multiple API endpoints to gather integration driver and instance data.
operationId: getIntegrationStatus
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/limit'
responses:
'200':
description: Successful operation.
headers:
Pagination-Count:
description: Total number of items.
schema:
type: integer
Pagination-Limit:
description: Number of returned items.
schema:
type: integer
Pagination-Page:
description: Current page number. 1-based.
schema:
type: integer
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/IntegrationStatus'
'400':
$ref: '#/components/responses/Err400BadRequest'
'401':
$ref: '#/components/responses/Err401Unauthorized'
'403':
$ref: '#/components/responses/Err403Forbidden'
/intg/discover:
get:
tags:
- integrations
summary: Get external integration driver discovery status.