compute

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

Replace a server's firewall rules.

Semua titik akhir compute

Pengesahan

Hantar kunci API sebagai token pembawa. Kunci tersebut mesti membawa kebenaran sites.restart; kunci yang tidak mempunyainya akan ditolak dengan 403, bukan 404.

Titik akhir ini tidak memerlukan id organisasi. Kunci anda telah mengenal pasti organisasi kepunyaannya, dan respons dis skopkan kepadanya.

Cuba

Gantikan apa sahaja di dalam kurungan sudut dengan nilai anda sendiri, dan pemegang tempat kunci dengan kunci dari papan pemuka anda.

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

Sudah log masuk? Konsol API dalam papan pemuka anda mengisi id organisasi sebenar dan kunci anda sendiri, serta menjalankan permintaan terhadap API langsung supaya anda boleh melihat respons sebenar. Buka penamat ini dalam konsol API

Butiran

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

Parameter

NamaJenisDiperlukanApakah ia
serverId (path)UuidYaThe 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.

Badan permintaan

NamaJenisDiperlukanApakah ia
rulesComputeFirewallRule[]Ya

Respons

NamaJenisDiperlukanApakah ia
idstringYaThe provider's firewall id
namestringYaIts name at the provider
attachedbooleanYaWhether a firewall resource is actually applied to this machine.
rulesComputeFirewallRule[]Ya

Ralat yang boleh dikembalikan oleh titik akhir ini

401 · 403 · 404 · 422 · 429 · 503