Firewall-Regel hinzufügen
Fügt eine neue Firewall-Regel zu einem VPS hinzu.
Anfrage
POST /api/v1/vps/{id}/firewall
Erforderlicher Scope: vps:manage
Pfadparameter
| Parameter |
Typ |
Beschreibung |
id |
string |
Die VPS-ID |
Header
| Header |
Erforderlich |
Wert |
Authorization |
Ja |
Bearer DEIN_API_SCHLÜSSEL |
Content-Type |
Ja |
application/json |
Anfragekörper
| Feld |
Typ |
Erforderlich |
Beschreibung |
port |
string |
Ja |
Port oder Portbereich (z.B. 80, 8000:8100) |
proto |
string |
Ja |
Protokoll: tcp, udp oder both |
action |
string |
Ja |
allow oder deny |
source |
string |
Nein |
Quell-IP-Adresse (Standard: any) |
comment |
string |
Nein |
Optionaler Kommentar für die Regel |
{
"port": "8080",
"proto": "tcp",
"action": "allow",
"source": "any",
"comment": "Web-App"
}
Antwort
{
"data": {
"port": "8080",
"proto": "tcp",
"action": "allow",
"source": "any",
"success": true
}
}
Fehler
| Status |
Code |
Beschreibung |
| 400 |
INVALID_PORT |
Port muss ein nicht-leerer String sein |
| 400 |
INVALID_PROTO |
Protokoll muss tcp, udp oder both sein |
| 400 |
INVALID_ACTION |
Aktion muss allow oder deny sein |
| 400 |
INVALID_BODY |
Der Anfragekörper ist kein gültiges JSON |
| 404 |
NOT_FOUND |
VPS nicht gefunden oder kein Zugriff |
| 502 |
FIREWALL_ERROR |
Firewall-Operation auf dem Server fehlgeschlagen |
Beispiel
curl -X POST "https://site.quest/api/v1/vps/699cdea2ab57a244bb5273fd/firewall" \
-H "Authorization: Bearer DEIN_API_SCHLÜSSEL" \
-H "Content-Type: application/json" \
-d '{"port": "8080", "proto": "tcp", "action": "allow"}'
MCP
Firewall-Verwaltung ist auch über das manage_firewall MCP-Tool verfügbar.