compute
PUT /v1/compute/servers/{serverId}/firewall
Replace a server's firewall rules.
אימות
שלחו מפתח API כאסימון נושא (bearer token). על המפתח לכלול את הרשאה sites.restart; מפתח שאינו כולל אותה יידחה בסטטוס 403, ולא 404.
נקודת קצה זו אינה דורשת מזהה ארגון. המפתח שלך כבר מזהה את הארגון שאליו הוא שייך, והתגובה מוגבלת אליו בלבד.
נסה זאת
החלף כל דבר בסוגריים זוויתיים בערכים משלך, ואת מציין מיקום המפתח במפתח מלוח הבקרה שלך.
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[]> }'מחובר? קונסולת ה-API בלוח הבקרה שלך מזינה את מזהה הארגון האמיתי שלך ואת המפתח שלך, ומריצה את הבקשה מול ה-API הפיזי כך שתוכל לראות את התגובה בפועל. פתח נקודת קצה זו במסוף ה-API
פרטים
⭐ **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`.
פרמטרים
| שם | סוג | נדרש | מה זה |
|---|---|---|---|
serverId (path) | Uuid | כן | 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. |
גוף הבקשה
| שם | סוג | נדרש | מה זה |
|---|---|---|---|
rules | ComputeFirewallRule[] | כן | — |
תשובה
| שם | סוג | נדרש | מה זה |
|---|---|---|---|
id | string | כן | The provider's firewall id |
name | string | כן | Its name at the provider |
attached | boolean | כן | Whether a firewall resource is actually applied to this machine. |
rules | ComputeFirewallRule[] | כן | — |
שגיאות שנקודה קצה זו עשויה להחזיר
401 · 403 · 404 · 422 · 429 · 503