Alle API-Routen finden sich unter der Basis-Route <BASE_URL>/api.
Sie können sich sich hier den Insomnia-Workspace disco-io_0.0.4_insomnia_2024-03-04.yaml herunterladen.
/api/appGET /api/app
Gibt den App-State und einige zusätzliche Infos zur App zurück.
Keine URL-Parameter.
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request GET \
--url http://127.0.0.1:8487/api/app
GET /api/app/config
Gibt die App-Konfiguration zurück.
Keine URL-Parameter.
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request GET \
--url http://127.0.0.1:8487/api/app
POST /api/app/import
App-Konfiguration importieren.
Im Gegensatz zum Aufruf
POST/api/app/updatewird die vorhandene App-Konfiguration komplett überschrieben.
Keine URL-Parameter.
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
400 |
Bad Request |
curl --request POST \
--url http://127.0.0.1:8487/api/app/import \
--header 'Content-Type: application/json' \
--data '{
"logs": {
"level": 4,
"file": {
"enabled": true,
"maxFiles": 10,
"name": "disco-io.log"
},
"singleline": false,
"syslog": {
"address": "127.0.0.1",
"enabled": false,
"facility": 16,
"newline": true,
"port": 514
}
}
}'
POST /api/app/update
App-Konfiguration aktualisieren.
Im Gegensatz zum Aufruf
POST/api/app/importwerden die Daten mite der vorhandenen App-Konfiguration zusammengeführt.
Keine URL-Parameter.
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
400 |
Bad Request |
curl --request POST \
--url http://127.0.0.1:8487/api/app/update \
--header 'Content-Type: application/json' \
--data '{
"logs": {
"singleline": true
}
}'
/api/backupPOST /api/backup
Gibt ein Backup-Archiv zurück.
Keine URL-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request POST --url http://127.0.0.1:8487/api/backup -OJ
/api/licenseGET /api/license
Gibt die derzeit verwendete Lizenz zurück.
Keine URL-Parameter.
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
422 |
Fehler |
curl --request GET \
--url http://127.0.0.1:8487/api/license
POST /api/license
App lizenzieren.
Keine URL-Parameter.
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request POST \
--url http://127.0.0.1:8487/api/license \
--header 'Content-Type: application/json' \
--data '{
"licensee": "LICENSEE",
"online": false,
"serial": "SERIAL"
}'
POST /api/license/update
App-Lizenz aktualisieren.
Keine URL-Parameter.
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request POST \
--url http://127.0.0.1:8487/api/license/update \
--header 'Content-Type: application/json' \
--data '{
"licensee": "LICENSEE",
"online": true,
"serial": "SERIAL"
"version": "v0.0.4"
}'
/api/logsGET /api/logs
Gibt eine Liste der verfügbaren Log-Files zurück.
Keine URL-Parameter.
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
403 |
File-Logging nicht aktiviert |
curl --request GET \
--url http://127.0.0.1:8487/api/logs
GET /api/logs/{filename}
Gibt das Log-File mit dem Name {filename} zurück.
| Name | Beschreibung |
|---|---|
filename |
Filename |
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
403 |
File-Logging nicht aktiviert |
curl --request GET \
--url http://127.0.0.1:8487/api/logs/FILENAME
/api/paramsGET /api/params
Gibt eine Liste der Parameter der Instanz zurück.
Keine URL-Parameter.
| Name | Beschreibung |
|---|---|
ids |
Parameter-IDs |
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request GET \
--url http://127.0.0.1:8487/api/params
POST /api/params
Actions auf Parameter anwenden.
Keine URL-Parameter.
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request POST \
--url http://127.0.0.1:8487/api/params \
--header 'Content-Type: application/json' \
--data '[
{
"id": "BOOLEAN",
"type": "BOOLEAN_TOGGLE"
},
{
"id": "STRING",
"type": "UPDATE",
"args": {
"val": "Updated string"
}
}
]'
GET /api/params/configs
Gibt die Parameter-Configs zurück.
Keine URL-Parameter.
| Name | Beschreibung |
|---|---|
ids |
Parameter-IDs |
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request GET \
--url http://127.0.0.1:8487/api/params/configs
POST /api/params/create
Parameter erzeugen.
Keine URL-Parameter.
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request POST \
--url http://127.0.0.1:8487/api/params/create \
--header 'Content-Type: application/json' \
--data '[
{
"label": "BOOLEAN_CREATE",
"props": {
"defaultVal": false
},
"type": "Boolean"
}
]'
Im Gegensatz zum Aufruf
POST/api/params/importwerden die IDs der erzeugten Parameter von der App festgelegt.
POST /api/params/delete
Parameter löschen.
Keine URL-Parameter.
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request POST \
--url http://127.0.0.1:8487/api/params/delete \
--header 'Content-Type: application/json' \
--data '[
"ID_TO_DELETE"
]'
POST /api/params/import
Parameter importieren.
Keine URL-Parameter.
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request POST \
--url http://127.0.0.1:8487/api/params/import \
--header 'Content-Type: application/json' \
--data '{
"data": [
{
"id": "BOOLEAN_IMPORT",
"props": {
"defaultVal": true
},
"type": "Boolean"
},
{
"id": "NUMBER_IMPORT",
"props": {
"defaultVal": 0
},
"type": "Number"
},
{
"id": "SELECTOR_IMPORT",
"props": {
"defaultIndex": 0,
"items": [
"item_0",
"item_1",
"item_2"
]
},
"type": "Selector"
},
{
"id": "STRING_IMPORT",
"props": {
"defaultVal": "I am a imported string param"
},
"type": "String"
}
],
"mode": "upsert"
}'
Im Gegensatz zum Aufruf
POST/api/params/createwerden die IDs der erzeugten Parameter durch die Import-Daten festgelegt.
POST /api/params/update
Parameter-Configs aktualisieren.
Keine URL-Parameter.
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request GET \
--url http://127.0.0.1:8487/api/params/BOOLEAN
GET /api/params/{id}
Gibt den Parameter mit der ID id zurück.
| Name | Beschreibung |
|---|---|
id |
Parameter-ID |
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request GET \
--url http://127.0.0.1:8487/api/params/BOOLEAN
POST /api/params/{id}
Wendet eine Action auf den Parameter mit der ID id an.
| Name | Beschreibung |
|---|---|
id |
Parameter-ID |
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request POST \
--url http://127.0.0.1:8487/api/params/BOOLEAN \
--header 'Content-Type: application/json' \
--data '{
"type": "BOOLEAN_TOGGLE"
}'
GET /api/params/{id}/config
Gibt die Config des Parameters mit der ID id zurück.
| Name | Beschreibung |
|---|---|
id |
Parameter-ID |
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request GET \
--url http://127.0.0.1:8487/api/params/BOOLEAN/config
POST /api/params/{id}/delete
Den Parameter mit der ID id löschen.
| Name | Beschreibung |
|---|---|
id |
Parameter-ID |
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request POST \
--url http://127.0.0.1:8487/api/params/2ZIGe8Z8Jjjy/delete
POST /api/params/{id}/update
Die Config des Parameters mit der ID id aktualisieren.
| Name | Beschreibung |
|---|---|
id |
Parameter-ID |
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request POST \
--url http://127.0.0.1:8487/api/params/BOOLEAN/update \
--header 'Content-Type: application/json' \
--data '{
"props": {
"defaultVal": true
},
"type": "Boolean"
}'
/api/pluginsGET /api/plugins
Gibt eine Liste der Plugins der Instanz zurück.
Keine URL-Parameter.
| Name | Beschreibung |
|---|---|
active |
Wenn false werden aktive Plugins nicht gelistet, Default ist true |
compact |
Wenn true kompakte Return-Values, Default ist false |
ids |
Parameter-IDs |
ignored |
Wenn false werden ignorierte Plugins nicht gelistet, Default ist true |
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request GET \
--url http://127.0.0.1:8487/api/plugins
GET /api/plugins/configs
Gibt die Plugin-Configs zurück.
Keine URL-Parameter.
| Name | Beschreibung |
|---|---|
ids |
Parameter-IDs |
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request GET \
--url http://127.0.0.1:8487/api/plugins/configs
POST /api/plugins/delete
Plugins löschen.
Keine URL-Parameter.
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request POST \
--url http://127.0.0.1:8487/api/plugins/delete \
--header 'Content-Type: application/json' \
--data '[
{
"id": "MQTT",
"version": "1.2.0"
}
]'
POST /api/plugins/import
Plugin-Configs importieren.
Keine URL-Parameter.
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request POST \
--url http://127.0.0.1:8487/api/plugins/import \
--header 'Content-Type: application/json' \
--data '{
"data": [
{
"disabled": 4,
"id": "MQTT",
"settings": {
"brokerUrl": "mqtt://192.168.178.20:1883",
"clientId": "disco-io",
"connectedClients": []
}
}
],
"mode": "upsert"
}'
POST /api/plugins/import-archives
Plugin-Archives importieren. Der Body ist multipart/form-data und für jedes Archiv sollte eine files-Feld hinzugefügt werden.
Keine URL-Parameter.
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request POST \
--url http://127.0.0.1:8487/api/plugins/import-archives \
--header 'Content-Type: multipart/form-data' \
--form files=@/PATH/TO/PLUGIN_1.zip \
--form files=@/PATH/TO/PLUGIN_2.zip
POST /api/plugins/update
Plugin-Configs aktualisieren.
Keine URL-Parameter.
Keine Query-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
curl --request POST \
--url http://127.0.0.1:8487/api/plugins/update \
--header 'Content-Type: application/json' \
--data '[
{
"id": "MQTT",
"disabled": true
}
]'
/api/reinitPOST /api/reinit
disco-io-Instanz re-initialisieren.
Keine URL-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
400 |
Bad Request |
curl --request POST \
--url http://127.0.0.1:8487/api/reinit
/api/restorePOST /api/restore
Backup-Archiv wiederherstellen.
Keine URL-Parameter.
| Code | Beschreibung |
|---|---|
200 |
Erfolgreiche Antwort |
400 |
Bad Request |
curl --request POST \
--url http://127.0.0.1:8487/api/restore \
--header 'Content-Type: multipart/form-data' \
--form file=@/PFAD_ZUM_ARCHIV
/api/stop