Skip to Content
CubyAPI-Referenz

API-Referenz

Cuby bietet eine REST-API für die programmgesteuerte Steuerung. Der Server läuft standardmäßig auf Port 3847.

Base URL

http://localhost:3847/api

Health

MethodEndpointBeschreibung
GET/api/healthHealth Check — gibt {status: "ok", timestamp} zurück

Konfiguration

MethodEndpointBeschreibung
GET/api/configAktuelle Konfiguration inkl. installierter Produkte, API-Key-Status, Operator-Modus und Version
POST/api/config/apikeyAPI Key speichern (UUID v4 Format erforderlich)
GET/api/config/autostartAutostart-Status abfragen
POST/api/config/autostartAutostart aktivieren/deaktivieren ({enabled: true/false})
POST/api/config/trialTrial-Lizenz erstellen (generiert UUID, registriert beim Marketplace)
GET/api/config/validate-apikeyAPI Key gegen Marketplace validieren

Marketplace

MethodEndpointBeschreibung
GET/api/marketplace/productsAlle verfügbaren Produkte mit Installationsstatus und Update-Info
GET/api/marketplace/coursesKurse aus dem Marketplace
GET/api/marketplace/videosAktuelle Videos

Installation

MethodEndpointBeschreibung
POST/api/installInstallation starten — Body: {products: [{productId, alias?}]}
POST/api/install/cancelAusstehende Installation abbrechen — Body: {instanceId}
GET/api/install/status?productId=XInstallationsfortschritt abfragen

Installations-Status

StatusBeschreibung
installingInstallation läuft
needs_configWartet auf Benutzerkonfiguration
installedErfolgreich installiert
failedInstallation fehlgeschlagen
updatingUpdate läuft

Produkte

MethodEndpointBeschreibung
GET/api/products/statusStatus aller laufenden Prozesse
GET/api/products/healthHealth-Check aller Produkte
POST/api/products/start-allAlle konfigurierten Plugins starten
GET/api/products/:id/statusStatus eines Produkts
GET/api/products/:id/healthHealth-Check eines Produkts
POST/api/products/:id/startProdukt starten
POST/api/products/:id/stopProdukt stoppen
POST/api/products/:id/restartProdukt neustarten
GET/api/products/:id/logs?limit=100In-Memory-Logs (Standard: 100 Zeilen)
GET/api/products/:id/logfile?lines=500Log-Datei (Standard: 500 Zeilen)
POST/api/products/:id/updateAuf neueste Version aktualisieren
DELETE/api/products/:id/uninstallProdukt deinstallieren
GET/api/products/:id/has-configPrüfen ob Konfigurationsdialog vorhanden
GET/api/products/:id/configAktuelle Plugin-Konfiguration
POST/api/products/:id/configureKonfiguration speichern und Deployment starten
GET/api/products/:id/config-component.jsReact-Konfigurationskomponente
GET/api/products/:id/has-detailPrüfen ob Detail-Komponente vorhanden
GET/api/products/:id/detail-component.jsReact-Detail-Komponente

Plugin-Routes

MethodEndpointBeschreibung
GET/POST/PUT/DELETE/api/plugins/:instanceId/*Weiterleitung an Plugin-registrierte Routes

ProcessCubes

MethodEndpointBeschreibung
GET/api/processcubesAlle registrierten ProcessCube®-Instanzen

Setup

MethodEndpointBeschreibung
POST/api/setup/completeSetup als abgeschlossen markieren

Echtzeit-Events (Socket.IO)

Cuby nutzt Socket.IO für Echtzeit-Kommunikation mit dem Frontend. Verbinden Sie sich mit dem Socket.IO-Server auf dem gleichen Port wie die REST-API.

EventRichtungBeschreibung
install:statusServer → ClientInstallationsfortschritt pro Produkt
products:statusServer → ClientStatus-Änderungen aller Produkte
product:logServer → ClientEinzelne Log-Zeilen eines Produkts
system:statusServer → ClientSystem-Setup-Fortschritt
subscribe:logsClient → ServerLog-Stream für ein Produkt abonnieren
unsubscribe:logsClient → ServerLog-Stream abbestellen

Beispiel

import { io } from "socket.io-client"; const socket = io("http://localhost:3847"); // Status-Updates empfangen socket.on("products:status", (data) => { console.log("Status update:", data); }); // Log-Stream abonnieren socket.emit("subscribe:logs", { instanceId: "processcube-engine" }); socket.on("product:log", (data) => { console.log("Log:", data); }); // Log-Stream abbestellen socket.emit("unsubscribe:logs", { instanceId: "processcube-engine" });