compute
PUT /v1/compute/servers/{serverId}/firewall
Replace a server's firewall rules.
Hitelesítés
Küldjön egy API-kulcsot bearer tokenként. A kulcsnak rendelkeznie kell a(z) sites.restart jogosultsággal; az ezzel nem rendelkező kulcsok esetén a rendszer 403-as hibát ad vissza 404 helyett.
Ez a végpont nem fogad el szervezeti azonosítót. Az Ön kulcsa már azonosítja azt a szervezetet, amelyhez tartozik, és a válasz is erre vonatkozik.
Próbálja ki
Cserélje ki a hegyes zárójelek közötti részt a saját értékeivel, a kulcshelyőrzőt pedig a vezérlőpultján található kulccsal.
curl -X PUT https://api.zinndigital.com/v1/compute/servers/{serverId}/firewall \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "rules": <ComputeFirewallRule[]> }'Be van jelentkezve? A vezérlőpultban lévő API-konzol kitölti a valós szervezetazonosítóját és a saját kulcsát, és a kérést az éles API-n futtatja, hogy láthassa a tényleges választ. Nyissa meg ezt a végpontot az API konzolban
Részletek
⭐ **PUT, and the verb is the contract**: this replaces the entire rule set. The provider's write is atomic, and an add/remove surface layered over an atomic replace is how two people editing at once discard each other's rule with both requests reporting success. ⛔⛔ **This can lock the customer out of their own machine.** A set with no inbound SSH is applied exactly as asked and their next connection is refused. That is why `openComputeServerConsole` exists, and why a client should say so beside this control. Refused when more than one firewall is applied to the machine: the effective policy is their union, so editing one and reporting the result would be false in the dangerous direction. The whole rule set is audit-logged, not a count — when a customer reports being locked out, "12 rules were set" answers nothing. Requires `sites.restart`.
Paraméterek
| Név | Típus | Kötelező | Mi ez |
|---|---|---|---|
serverId (path) | Uuid | Igen | The server's id, as `listComputeServers` reports it. **Ours** (UUIDv7), minted when the order row was written — never the provider's own identifier for the machine. |
Kérés törzse
| Név | Típus | Kötelező | Mi ez |
|---|---|---|---|
rules | ComputeFirewallRule[] | Igen | — |
Válasz
| Név | Típus | Kötelező | Mi ez |
|---|---|---|---|
id | string | Igen | The provider's firewall id |
name | string | Igen | Its name at the provider |
attached | boolean | Igen | Whether a firewall resource is actually applied to this machine. |
rules | ComputeFirewallRule[] | Igen | — |
Hibák, amelyeket ez a végpont visszaadhattatlan
401 · 403 · 404 · 422 · 429 · 503