{ "openapi": "3.0.3", "info": { "title": "ProxDeploy API", "version": "0.3.0", "description": "REST-API von ProxDeploy – dieselbe für Web-GUI und CLI. Fehler: `{ fehler: { code, nachricht, hinweis?, felder? } }`." }, "servers": [ { "url": "/api/v1" } ], "security": [ { "token": [] } ], "components": { "securitySchemes": { "token": { "type": "http", "scheme": "bearer", "description": "API-Token (pd_…)" } }, "schemas": { "FehlerAntwort": { "type": "object", "properties": { "fehler": { "type": "object", "properties": { "code": { "type": "string" }, "nachricht": { "type": "string" }, "hinweis": { "type": "string" }, "felder": { "type": "object", "additionalProperties": { "type": "string" } } }, "required": [ "code", "nachricht" ] } }, "required": [ "fehler" ] }, "Ich": { "type": "object", "properties": { "benutzername": { "type": "string" }, "anzeigename": { "type": "string" }, "rolle": { "type": "string", "enum": [ "ADMIN", "OPERATOR" ] }, "rechte": { "type": "array", "items": { "type": "string" } }, "version": { "type": "string" } }, "required": [ "benutzername", "anzeigename", "rolle", "rechte", "version" ] }, "TokenAnmeldung": { "type": "object", "properties": { "benutzername": { "type": "string" }, "passwort": { "type": "string" }, "name": { "type": "string" }, "tage": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "benutzername", "passwort", "name" ] }, "NeuesToken": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "praefix": { "type": "string" }, "token": { "type": "string" }, "erstelltAm": { "type": "string", "description": "ISO 8601" }, "ablaufAm": { "nullable": true, "type": "string", "description": "ISO 8601" } }, "required": [ "id", "name", "praefix", "token", "erstelltAm", "ablaufAm" ] }, "Server": { "type": "object", "properties": { "name": { "type": "string" }, "titel": { "type": "string" }, "url": { "type": "string" }, "erreichbar": { "nullable": true, "type": "boolean" }, "pveVersion": { "nullable": true, "type": "string" }, "geprueftAm": { "nullable": true, "type": "string", "description": "ISO 8601" }, "sshAktiv": { "type": "boolean" }, "letzterTest": { "nullable": true, "type": "object", "properties": { "cluster": { "nullable": true, "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ] }, "knoten": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "online": { "type": "boolean" }, "speicherBelegt": { "nullable": true, "type": "number" }, "speicherGesamt": { "nullable": true, "type": "number" } }, "required": [ "name", "online", "speicherBelegt", "speicherGesamt" ] } } }, "required": [ "cluster", "knoten" ] } }, "required": [ "name", "titel", "url", "erreichbar", "pveVersion", "geprueftAm", "sshAktiv", "letzterTest" ] }, "Distribution": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "familie": { "type": "string" }, "aktiv": { "type": "boolean" }, "vm": { "type": "boolean" }, "lxc": { "type": "boolean" } }, "required": [ "id", "name", "familie", "aktiv", "vm", "lxc" ] }, "ProfilVariable": { "type": "object", "properties": { "name": { "type": "string" }, "label": { "type": "string" }, "type": { "type": "string", "enum": [ "string", "number", "boolean", "select" ] }, "required": { "type": "boolean" }, "default": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "type": "boolean" } ] }, "options": { "type": "array", "items": { "type": "string" } }, "help": { "type": "string" } }, "required": [ "name", "label", "type", "required" ] }, "Profil": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "beschreibung": { "nullable": true, "type": "string" }, "familien": { "type": "array", "items": { "type": "string" } }, "herkunft": { "type": "string", "enum": [ "KATALOG", "EIGEN" ] }, "aktiv": { "type": "boolean" }, "definition": { "type": "object", "properties": { "variables": { "type": "array", "items": { "$ref": "#/components/schemas/ProfilVariable" } } } } }, "required": [ "id", "name", "beschreibung", "familien", "herkunft", "aktiv", "definition" ] }, "Vorlage": { "type": "object", "properties": { "name": { "type": "string" }, "titel": { "type": "string" }, "beschreibung": { "nullable": true, "type": "string" } }, "required": [ "name", "titel", "beschreibung" ] }, "Template": { "type": "object", "properties": { "vmid": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "name": { "type": "string" }, "knoten": { "type": "string" }, "distributionId": { "nullable": true, "type": "string" }, "gebautAm": { "nullable": true, "type": "string", "description": "ISO 8601" }, "profile": { "type": "array", "items": { "type": "string" } } }, "required": [ "vmid", "name", "knoten", "distributionId", "gebautAm", "profile" ] }, "AusrollAnfrage": { "type": "object", "properties": { "typ": { "type": "string", "enum": [ "vm", "lxc" ] }, "server": { "type": "string", "minLength": 1 }, "knoten": { "type": "string" }, "distribution": { "type": "string", "minLength": 1 }, "name": { "type": "string", "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$" }, "vmid": { "type": "integer", "minimum": 100, "maximum": 999999999 }, "tags": { "default": [], "maxItems": 10, "type": "array", "items": { "type": "string", "pattern": "^[a-z0-9_+.-]+$" } }, "cores": { "default": 2, "type": "integer", "minimum": 1, "maximum": 128 }, "speicherMb": { "default": 2048, "type": "integer", "minimum": 256, "maximum": 1048576 }, "diskGb": { "default": 20, "type": "integer", "minimum": 1, "maximum": 65536 }, "storage": { "type": "string", "minLength": 1 }, "swapMb": { "default": 512, "type": "integer", "minimum": 0, "maximum": 1048576 }, "unprivilegiert": { "default": true, "type": "boolean" }, "features": { "default": { "nesting": false, "keyctl": false }, "type": "object", "properties": { "nesting": { "default": false, "type": "boolean" }, "keyctl": { "default": false, "type": "boolean" } } }, "netz": { "type": "object", "properties": { "bridge": { "type": "string", "minLength": 1, "pattern": "^[A-Za-z0-9_.-]+$" }, "vlan": { "type": "integer", "minimum": 1, "maximum": 4094 }, "modus": { "default": "dhcp", "type": "string", "enum": [ "dhcp", "statisch" ] }, "ip": { "type": "string", "pattern": "^(\\d{1,3}\\.){3}\\d{1,3}\\/\\d{1,2}$" }, "gateway": { "type": "string", "pattern": "^(\\d{1,3}\\.){3}\\d{1,3}$" }, "dns": { "default": [], "maxItems": 3, "type": "array", "items": { "type": "string", "pattern": "^(\\d{1,3}\\.){3}\\d{1,3}$" } }, "suchdomain": { "type": "string", "pattern": "^[a-z0-9.-]*$" } }, "required": [ "bridge" ] }, "zugang": { "type": "object", "properties": { "benutzer": { "type": "string", "pattern": "^[a-z_][a-z0-9_-]{0,31}$" }, "sshSchluessel": { "minItems": 1, "type": "array", "items": { "type": "string", "pattern": "^(ssh-(ed25519|rsa|dss)|ecdsa-sha2-nistp(256|384|521)|sk-(ssh-ed25519|ecdsa-sha2-nistp256)@openssh\\.com) [A-Za-z0-9+/=]+( [^\\r\\n]*)?$" } } }, "required": [ "benutzer", "sshSchluessel" ] }, "profile": { "default": [ "base" ], "type": "array", "items": { "type": "string" } }, "variablen": { "default": {}, "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "type": "boolean" } ] } } }, "templateBauen": { "default": false, "type": "boolean" }, "startBeiBoot": { "default": true, "type": "boolean" }, "vorlage": { "type": "string" } }, "required": [ "typ", "server", "distribution", "name", "storage", "netz", "zugang" ] }, "TemplateBauAnfrage": { "type": "object", "properties": { "distribution": { "type": "string", "minLength": 1 }, "knoten": { "type": "string", "minLength": 1 }, "storage": { "type": "string", "minLength": 1 }, "bridge": { "default": "vmbr0", "type": "string", "minLength": 1 }, "vlan": { "type": "integer", "minimum": 1, "maximum": 4094 }, "profile": { "default": [], "type": "array", "items": { "type": "string" } } }, "required": [ "distribution", "knoten", "storage" ] }, "AuftragAngenommen": { "type": "object", "properties": { "id": { "type": "string" }, "kurzId": { "type": "string" } }, "required": [ "id", "kurzId" ] }, "Phase": { "type": "object", "properties": { "schluessel": { "type": "string" }, "titel": { "type": "string" }, "status": { "type": "string", "enum": [ "OFFEN", "LAEUFT", "ERLEDIGT", "FEHLER", "UEBERSPRUNGEN" ] }, "detail": { "nullable": true, "type": "string" }, "ursache": { "nullable": true, "type": "string" }, "hinweis": { "nullable": true, "type": "string" }, "gestartetAm": { "nullable": true, "type": "string", "description": "ISO 8601" }, "beendetAm": { "nullable": true, "type": "string", "description": "ISO 8601" } }, "required": [ "schluessel", "titel", "status", "detail", "ursache", "hinweis" ] }, "AuftragErgebnis": { "type": "object", "properties": { "vmid": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "knoten": { "type": "string" }, "ip": { "nullable": true, "type": "string" }, "ssh": { "nullable": true, "type": "string" }, "template": { "type": "string" } } }, "Abschluss": { "type": "object", "properties": { "ok": { "type": "boolean" }, "titel": { "type": "string" }, "dauer": { "nullable": true, "type": "string" }, "zeilen": { "type": "array", "items": { "minItems": 2, "maxItems": 2, "type": "array", "items": { "type": "string" } } } }, "required": [ "ok", "titel", "dauer", "zeilen" ] }, "Auftrag": { "type": "object", "properties": { "id": { "type": "string" }, "kurzId": { "type": "string" }, "art": { "type": "string", "enum": [ "AUSROLLEN", "TEMPLATE_BAUEN", "AUFRAEUMEN" ] }, "status": { "type": "string", "enum": [ "WARTEND", "LAEUFT", "ERFOLGREICH", "FEHLGESCHLAGEN", "ABGEBROCHEN", "AUFGERAEUMT" ] }, "kopf": { "type": "string" }, "server": { "type": "object", "properties": { "name": { "type": "string" }, "titel": { "type": "string" } }, "required": [ "name", "titel" ] }, "knoten": { "nullable": true, "type": "string" }, "gastTyp": { "nullable": true, "type": "string", "enum": [ "VM", "LXC" ] }, "vmid": { "nullable": true, "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "name": { "nullable": true, "type": "string" }, "distributionId": { "nullable": true, "type": "string" }, "profile": { "type": "array", "items": { "type": "string" } }, "ergebnis": { "nullable": true, "allOf": [ { "$ref": "#/components/schemas/AuftragErgebnis" } ] }, "fehler": { "nullable": true, "type": "object", "properties": { "phase": { "type": "string" }, "ursache": { "type": "string" }, "hinweis": { "type": "string" } }, "required": [ "ursache" ] }, "erstelltVon": { "type": "string" }, "erstelltAm": { "type": "string", "description": "ISO 8601" }, "gestartetAm": { "nullable": true, "type": "string", "description": "ISO 8601" }, "beendetAm": { "nullable": true, "type": "string", "description": "ISO 8601" }, "abschluss": { "nullable": true, "allOf": [ { "$ref": "#/components/schemas/Abschluss" } ] }, "phasen": { "type": "array", "items": { "$ref": "#/components/schemas/Phase" } } }, "required": [ "id", "kurzId", "art", "status", "kopf", "server", "knoten", "gastTyp", "vmid", "name", "distributionId", "profile", "ergebnis", "fehler", "erstelltVon", "erstelltAm", "gestartetAm", "beendetAm", "abschluss", "phasen" ] }, "LogZeile": { "type": "object", "properties": { "id": { "type": "string" }, "zeit": { "type": "string", "description": "ISO 8601" }, "stufe": { "type": "string" }, "phase": { "nullable": true, "type": "string" }, "nachricht": { "type": "string" } }, "required": [ "id", "zeit", "stufe", "phase", "nachricht" ] }, "GeplanterAufruf": { "type": "object", "properties": { "methode": { "type": "string" }, "pfad": { "type": "string" }, "parameter": { "type": "object" } }, "required": [ "methode", "pfad" ] }, "Plan": { "type": "object", "properties": { "kopf": { "type": "string" }, "phasen": { "type": "array", "items": { "$ref": "#/components/schemas/Phase" } }, "aufrufe": { "type": "array", "items": { "$ref": "#/components/schemas/GeplanterAufruf" } }, "skript": { "nullable": true, "type": "string" }, "cliBefehl": { "type": "string" }, "automatisch": { "type": "array", "items": { "type": "string" } }, "ok": { "type": "boolean" } }, "required": [ "kopf", "phasen", "aufrufe", "skript", "cliBefehl", "automatisch", "ok" ] } } }, "paths": { "/auth/token": { "post": { "operationId": "tokenAnmelden", "summary": "Benutzername und Passwort gegen ein API-Token tauschen (proxdeploy login)", "security": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokenAnmeldung" } } } }, "responses": { "201": { "description": "Token", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NeuesToken" } } } }, "default": { "description": "Fehler", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FehlerAntwort" } } } } } } }, "/ich": { "get": { "operationId": "ich", "summary": "Angemeldeter Benutzer, Rechte und Version", "responses": { "200": { "description": "Benutzer", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Ich" } } } }, "default": { "description": "Fehler", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FehlerAntwort" } } } } } } }, "/server": { "get": { "operationId": "serverListe", "summary": "Alle Proxmox-Server mit dem letzten Verbindungstest", "responses": { "200": { "description": "Server", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Server" } } } } }, "default": { "description": "Fehler", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FehlerAntwort" } } } } } } }, "/server/{name}/templates": { "get": { "operationId": "templatesListe", "summary": "ProxDeploy-Templates eines Servers", "parameters": [ { "name": "name", "in": "path", "required": true, "description": "Kurzname des Servers", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Templates", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Template" } } } } }, "default": { "description": "Fehler", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FehlerAntwort" } } } } } }, "post": { "operationId": "templateBauen", "summary": "Template bauen (Auftrag)", "parameters": [ { "name": "name", "in": "path", "required": true, "description": "Kurzname des Servers", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TemplateBauAnfrage" } } } }, "responses": { "202": { "description": "Auftrag angenommen", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuftragAngenommen" } } } }, "default": { "description": "Fehler", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FehlerAntwort" } } } } } } }, "/distributionen": { "get": { "operationId": "distributionenListe", "summary": "Aktive Distributionen", "parameters": [ { "name": "typ", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "vm", "lxc" ] } } ], "responses": { "200": { "description": "Distributionen", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Distribution" } } } } }, "default": { "description": "Fehler", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FehlerAntwort" } } } } } } }, "/profile": { "get": { "operationId": "profileListe", "summary": "Aktive Profile mit ihren Variablen", "responses": { "200": { "description": "Profile", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Profil" } } } } }, "default": { "description": "Fehler", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FehlerAntwort" } } } } } } }, "/vorlagen": { "get": { "operationId": "vorlagenListe", "summary": "Vorlagen (Presets)", "responses": { "200": { "description": "Vorlagen", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Vorlage" } } } } }, "default": { "description": "Fehler", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FehlerAntwort" } } } } } } }, "/auftraege": { "post": { "operationId": "ausrollen", "summary": "VM oder LXC ausrollen (Auftrag)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AusrollAnfrage" } } } }, "responses": { "202": { "description": "Auftrag angenommen", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuftragAngenommen" } } } }, "default": { "description": "Fehler", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FehlerAntwort" } } } } } } }, "/auftraege/plan": { "post": { "operationId": "ausrollenPlanen", "summary": "Dry-Run: Phasen und geplante Proxmox-Aufrufe, ohne etwas anzulegen", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AusrollAnfrage" } } } }, "responses": { "200": { "description": "Plan", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Plan" } } } }, "default": { "description": "Fehler", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FehlerAntwort" } } } } } } }, "/auftraege/{id}": { "get": { "operationId": "auftragHolen", "summary": "Stand eines Auftrags mit allen Phasen", "parameters": [ { "name": "id", "in": "path", "required": true, "description": "ID oder Kurz-ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Auftrag", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Auftrag" } } } }, "default": { "description": "Fehler", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FehlerAntwort" } } } } } } }, "/auftraege/{id}/log": { "get": { "operationId": "auftragLog", "summary": "Detail-Log ab einer Zeilen-ID", "parameters": [ { "name": "id", "in": "path", "required": true, "description": "ID oder Kurz-ID", "schema": { "type": "string" } }, { "name": "ab", "in": "query", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Zeilen", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/LogZeile" } } } } }, "default": { "description": "Fehler", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FehlerAntwort" } } } } } } }, "/auftraege/{id}/ereignisse": { "get": { "operationId": "auftragEreignisse", "summary": "Server-Sent Events: `stand` (Auftrag), `log` (LogZeile[], Event-ID = letzte Zeilen-ID), `ende`", "parameters": [ { "name": "id", "in": "path", "required": true, "description": "ID oder Kurz-ID", "schema": { "type": "string" } }, { "name": "Last-Event-ID", "in": "header", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Ereignisstrom", "content": { "text/event-stream": { "schema": { "type": "string" } } } }, "default": { "description": "Fehler", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FehlerAntwort" } } } } } } }, "/auftraege/{id}/abbrechen": { "post": { "operationId": "auftragAbbrechen", "summary": "Abbruch anfordern; der worker hält an der nächsten Phasengrenze an", "parameters": [ { "name": "id", "in": "path", "required": true, "description": "ID oder Kurz-ID", "schema": { "type": "string" } } ], "responses": { "202": { "description": "Abbruch angefordert" }, "default": { "description": "Fehler", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FehlerAntwort" } } } } } } } } }