compute

PUT /v1/compute/servers/{serverId}/firewall

Replace a server's firewall rules.

Wszystkie punkty końcowe compute

Uwierzytelnianie

Wyślij klucz API jako token bearer. Klucz musi posiadać uprawnienie sites.restart; klucz bez niego jest odrzucany z kodem 403, a nie 404.

Ten punkt końcowy nie wymaga identyfikatora organizacji. Twój klucz już identyfikuje organizację, do której należy, a odpowiedź jest do niej ograniczona.

Wypróbuj

Zastąp wszystko w nawiasach ostrych własnymi wartościami, a zastępczy znacznik klucza kluczem ze swojego pulpitu nawigacyjnego.

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[]> }'

Zalogowany? Konsola API w Twoim panelu uzupełnia rzeczywiste identyfikator organizacji oraz Twój własny klucz i wykonuje żądanie względem aktywnego API, dzięki czemu możesz zobaczyć rzeczywistą odpowiedź. Otwórz ten punkt końcowy w konsoli API

Szczegóły

⭐ **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`.

Parametry

NazwaTypWymaganeCo to jest
serverId (path)UuidTakThe 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.

Treść żądania

NazwaTypWymaganeCo to jest
rulesComputeFirewallRule[]Tak

Odpowiedź

NazwaTypWymaganeCo to jest
idstringTakThe provider's firewall id
namestringTakIts name at the provider
attachedbooleanTakWhether a firewall resource is actually applied to this machine.
rulesComputeFirewallRule[]Tak

Błędy, które ten punkt końcowy może zwrócić

401 · 403 · 404 · 422 · 429 · 503