Box API · Dashboard
Box and NIC firewall
Set Box-wide policy, override selected interfaces, inspect effective enforcement and rule counters.
Base URL: https://api.hubfly.space. Use a Dashboard bearer token authorized for the project. Replace :projectId in each path with the Dashboard project ID. JSON routes use Content-Type: application/json.
How to use these endpoints
- Read current Box and NIC policies before editing them.
- Set inbound and outbound modes and ordered rules; use the current generation when supplied to avoid overwriting another change.
- Read effective policy and counters to see the rule set actually applied to an interface.
- Reset counters only when starting a new observation period.
Read the effective Box firewall
curl "https://api.hubfly.space/api/v1/projects/$PROJECT_ID/boxes/$BOX_ID/firewall/effective" \
-H "Authorization: Bearer $HUBFLY_TOKEN"The response uses the standard Dashboard envelope: ok, data, and meta on success. On failure, use the returned error code and message to decide whether to correct the request or retry. The exact schema and response codes for each operation are below.
Endpoint reference
Dashboard endpoints (12)
These JSON routes are served by the Hubfly space Dashboard API and use Dashboard project authorization.
GETRead Box firewall countersDetails +/api/v1/projects/:projectId/boxes/:boxId/firewall/counters
Read traffic match counters for the Box-level policy to inspect applied rule activity.
Request parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
projectId | path | Yes | string | — |
boxId | path | Yes | string | — |
Responses
200— Successful responseResponse schema
{ "type": "object", "properties": { "ok": { "const": true, "type": "boolean" }, "data": { "type": "object", "properties": { "accountingGap": { "type": "boolean" }, "updatedAt": { "type": "string" }, "items": { "type": "array", "items": { "type": "object", "properties": { "ruleId": { "type": "string" }, "origin": { "type": "string" }, "direction": { "type": "string" }, "packets": { "type": "number" }, "bytes": { "type": "number" } }, "required": [ "origin", "direction", "packets", "bytes" ], "additionalProperties": false } } }, "required": [ "accountingGap", "items" ], "additionalProperties": false }, "meta": { "type": "object", "properties": { "requestId": { "type": "string" }, "timestamp": { "type": "string" } }, "required": [ "requestId", "timestamp" ], "additionalProperties": false } }, "required": [ "ok", "data", "meta" ], "additionalProperties": false }Example response
{ "ok": true, "data": { "accountingGap": true, "updatedAt": "string", "items": [ { "ruleId": "string", "origin": "string", "direction": "string", "packets": 0, "bytes": 0 } ] }, "meta": { "requestId": "string", "timestamp": "string" } }
POSTReset Box firewall countersDetails +/api/v1/projects/:projectId/boxes/:boxId/firewall/counters/reset
Clear Box-level firewall counters to start a new observation window.
Request parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
projectId | path | Yes | string | — |
boxId | path | Yes | string | — |
JSON request body
| Field | Type / allowed values | Required |
|---|
Complete request schema
{
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}Responses
200— Successful responseResponse schema
{ "type": "object", "properties": { "ok": { "const": true, "type": "boolean" }, "data": { "type": "object", "properties": { "operationId": { "type": "string" } }, "required": [ "operationId" ], "additionalProperties": false }, "meta": { "type": "object", "properties": { "requestId": { "type": "string" }, "timestamp": { "type": "string" } }, "required": [ "requestId", "timestamp" ], "additionalProperties": false } }, "required": [ "ok", "data", "meta" ], "additionalProperties": false }Example response
{ "ok": true, "data": { "operationId": "string" }, "meta": { "requestId": "string", "timestamp": "string" } }
DELETERemove Box firewall overrideDetails +/api/v1/projects/:projectId/boxes/:boxId/firewall/delete
Delete the managed Box firewall policy at the optional expected generation. Check effective policy afterward.
Request parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
projectId | path | Yes | string | — |
boxId | path | Yes | string | — |
generation | query | Yes | number | — |
Responses
200— Successful responseResponse schema
{ "type": "object", "properties": { "ok": { "const": true, "type": "boolean" }, "data": { "type": "object", "properties": { "operationId": { "type": "string" } }, "required": [ "operationId" ], "additionalProperties": false }, "meta": { "type": "object", "properties": { "requestId": { "type": "string" }, "timestamp": { "type": "string" } }, "required": [ "requestId", "timestamp" ], "additionalProperties": false } }, "required": [ "ok", "data", "meta" ], "additionalProperties": false }Example response
{ "ok": true, "data": { "operationId": "string" }, "meta": { "requestId": "string", "timestamp": "string" } }
GETRead effective Box firewallDetails +/api/v1/projects/:projectId/boxes/:boxId/firewall/effective
Read the effective enforced firewall, including applied generation and derived rules.
Request parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
projectId | path | Yes | string | — |
boxId | path | Yes | string | — |
Responses
200— Successful responseResponse schema
{ "type": "object", "properties": { "ok": { "const": true, "type": "boolean" }, "data": { "type": "array", "items": { "type": "object", "properties": { "nicId": { "type": "string" }, "ipv4": { "type": "string" }, "protected": { "type": "boolean" }, "inboundMode": { "type": "string" }, "outboundMode": { "type": "string" }, "systemRules": { "type": "array", "items": { "type": "string" } }, "rules": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "direction": { "type": "string", "enum": [ "inbound", "outbound" ] }, "protocol": { "type": "string", "enum": [ "tcp", "udp", "icmp", "any" ] }, "remoteCidrs": { "type": "array", "items": { "type": "string" } }, "portStart": { "type": "number" }, "portEnd": { "type": "number" }, "icmpType": { "type": "number" }, "icmpCode": { "type": "number" }, "description": { "type": "string" }, "enabled": { "type": "boolean" }, "origin": { "type": "string" } }, "required": [ "direction", "protocol", "remoteCidrs", "enabled", "origin" ], "additionalProperties": false } } }, "required": [ "nicId", "ipv4", "protected", "inboundMode", "outboundMode", "systemRules", "rules" ], "additionalProperties": false } }, "meta": { "type": "object", "properties": { "requestId": { "type": "string" }, "timestamp": { "type": "string" } }, "required": [ "requestId", "timestamp" ], "additionalProperties": false } }, "required": [ "ok", "data", "meta" ], "additionalProperties": false }Example response
{ "ok": true, "data": [ { "nicId": "string", "ipv4": "string", "protected": true, "inboundMode": "string", "outboundMode": "string", "systemRules": [ "string" ], "rules": [ { "id": "string", "direction": "inbound", "protocol": "tcp", "remoteCidrs": [ "string" ], "portStart": 0, "portEnd": 0, "icmpType": 0, "icmpCode": 0, "description": "string", "enabled": true, "origin": "string" } ] } ], "meta": { "requestId": "string", "timestamp": "string" } }
GETRead Box firewall policyDetails +/api/v1/projects/:projectId/boxes/:boxId/firewall
Read the Box-level configured policy, modes, ordered rules and generation before editing.
Request parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
projectId | path | Yes | string | — |
boxId | path | Yes | string | — |
Responses
200— Successful responseResponse schema
{ "type": "object", "properties": { "ok": { "const": true, "type": "boolean" }, "data": { "type": "object", "properties": { "supported": { "type": "boolean" }, "capabilities": { "type": "object", "properties": { "managed_firewall_v1": { "type": "boolean" }, "protocols": { "type": "array", "items": { "type": "string" } }, "rules_per_policy": { "type": "number" }, "cidrs_per_rule": { "type": "number" }, "compiled_clauses_per_host": { "type": "number" } }, "required": [], "additionalProperties": false }, "policy": { "type": "object", "properties": { "id": { "type": "string" }, "generation": { "type": "number" }, "observedGeneration": { "type": "number" }, "enabled": { "type": "boolean" }, "inboundMode": { "type": "string", "enum": [ "allowlist", "allow_all", "inherit" ] }, "outboundMode": { "type": "string", "enum": [ "allowlist", "allow_all", "inherit" ] }, "rules": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "direction": { "type": "string", "enum": [ "inbound", "outbound" ] }, "protocol": { "type": "string", "enum": [ "tcp", "udp", "icmp", "any" ] }, "remote_cidrs": { "type": "array", "items": { "type": "string" } }, "port_start": { "type": "number" }, "port_end": { "type": "number" }, "icmp_type": { "type": "number" }, "icmp_code": { "type": "number" }, "description": { "type": "string" }, "enabled": { "type": "boolean" } }, "required": [ "direction", "protocol", "remote_cidrs", "enabled" ], "additionalProperties": false } }, "status": { "type": "string" }, "lastErrorCode": { "type": "string", "nullable": true } }, "required": [ "id", "generation", "observedGeneration", "enabled", "inboundMode", "outboundMode", "rules", "status", "lastErrorCode" ], "additionalProperties": false, "nullable": true }, "effective": { "type": "array", "items": { "type": "object", "properties": { "nicId": { "type": "string" }, "ipv4": { "type": "string" }, "protected": { "type": "boolean" }, "inboundMode": { "type": "string" }, "outboundMode": { "type": "string" }, "systemRules": { "type": "array", "items": { "type": "string" } }, "rules": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "direction": { "type": "string", "enum": [ "inbound", "outbound" ] }, "protocol": { "type": "string", "enum": [ "tcp", "udp", "icmp", "any" ] }, "remoteCidrs": { "type": "array", "items": { "type": "string" } }, "portStart": { "type": "number" }, "portEnd": { "type": "number" }, "icmpType": { "type": "number" }, "icmpCode": { "type": "number" }, "description": { "type": "string" }, "enabled": { "type": "boolean" }, "origin": { "type": "string" } }, "required": [ "direction", "protocol", "remoteCidrs", "enabled", "origin" ], "additionalProperties": false } } }, "required": [ "nicId", "ipv4", "protected", "inboundMode", "outboundMode", "systemRules", "rules" ], "additionalProperties": false } }, "counters": { "type": "object", "properties": { "accountingGap": { "type": "boolean" }, "updatedAt": { "type": "string" }, "items": { "type": "array", "items": { "type": "object", "properties": { "ruleId": { "type": "string" }, "origin": { "type": "string" }, "direction": { "type": "string" }, "packets": { "type": "number" }, "bytes": { "type": "number" } }, "required": [ "origin", "direction", "packets", "bytes" ], "additionalProperties": false } } }, "required": [ "accountingGap", "items" ], "additionalProperties": false } }, "required": [ "supported", "capabilities", "policy", "effective", "counters" ], "additionalProperties": false }, "meta": { "type": "object", "properties": { "requestId": { "type": "string" }, "timestamp": { "type": "string" } }, "required": [ "requestId", "timestamp" ], "additionalProperties": false } }, "required": [ "ok", "data", "meta" ], "additionalProperties": false }Example response
{ "ok": true, "data": { "supported": true, "capabilities": { "managed_firewall_v1": true, "protocols": [ "string" ], "rules_per_policy": 0, "cidrs_per_rule": 0, "compiled_clauses_per_host": 0 }, "policy": { "id": "string", "generation": 0, "observedGeneration": 0, "enabled": true, "inboundMode": "allowlist", "outboundMode": "allowlist", "rules": [ { "id": "string", "direction": "inbound", "protocol": "tcp", "remote_cidrs": [ "string" ], "port_start": 0, "port_end": 0, "icmp_type": 0, "icmp_code": 0, "description": "string", "enabled": true } ], "status": "string", "lastErrorCode": "string" }, "effective": [ { "nicId": "string", "ipv4": "string", "protected": true, "inboundMode": "string", "outboundMode": "string", "systemRules": [ "string" ], "rules": [ { "id": "string", "direction": "inbound", "protocol": "tcp", "remoteCidrs": [ "string" ], "portStart": 0, "portEnd": 0, "icmpType": 0, "icmpCode": 0, "description": "string", "enabled": true, "origin": "string" } ] } ], "counters": { "accountingGap": true, "updatedAt": "string", "items": [ { "ruleId": "string", "origin": "string", "direction": "string", "packets": 0, "bytes": 0 } ] } }, "meta": { "requestId": "string", "timestamp": "string" } }
PUTUpdate Box firewall policyDetails +/api/v1/projects/:projectId/boxes/:boxId/firewall/update
Set enabled state, inbound and outbound modes and rules. Pass the current generation when available to avoid a stale write.
Request parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
projectId | path | Yes | string | — |
boxId | path | Yes | string | — |
JSON request body
| Field | Type / allowed values | Required |
|---|---|---|
generation | number | No |
enabled | boolean | Yes |
inboundMode | allowlist | allow_all | Yes |
outboundMode | allowlist | allow_all | Yes |
rules | object[] | Yes |
Complete request schema
{
"type": "object",
"properties": {
"generation": {
"type": "number"
},
"enabled": {
"type": "boolean"
},
"inboundMode": {
"type": "string",
"enum": [
"allowlist",
"allow_all"
]
},
"outboundMode": {
"type": "string",
"enum": [
"allowlist",
"allow_all"
]
},
"rules": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"direction": {
"type": "string",
"enum": [
"inbound",
"outbound"
]
},
"protocol": {
"type": "string",
"enum": [
"tcp",
"udp",
"icmp",
"any"
]
},
"remote_cidrs": {
"type": "array",
"items": {
"type": "string"
}
},
"port_start": {
"type": "number"
},
"port_end": {
"type": "number"
},
"icmp_type": {
"type": "number"
},
"icmp_code": {
"type": "number"
},
"description": {
"type": "string"
},
"enabled": {
"type": "boolean"
}
},
"required": [
"direction",
"protocol",
"remote_cidrs",
"enabled"
],
"additionalProperties": false
}
}
},
"required": [
"enabled",
"inboundMode",
"outboundMode",
"rules"
],
"additionalProperties": false
}Responses
200— Successful responseResponse schema
{ "type": "object", "properties": { "ok": { "const": true, "type": "boolean" }, "data": { "type": "object", "properties": { "policy": { "type": "object", "properties": { "id": { "type": "string" }, "generation": { "type": "number" }, "observedGeneration": { "type": "number" }, "enabled": { "type": "boolean" }, "inboundMode": { "type": "string", "enum": [ "allowlist", "allow_all", "inherit" ] }, "outboundMode": { "type": "string", "enum": [ "allowlist", "allow_all", "inherit" ] }, "rules": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "direction": { "type": "string", "enum": [ "inbound", "outbound" ] }, "protocol": { "type": "string", "enum": [ "tcp", "udp", "icmp", "any" ] }, "remote_cidrs": { "type": "array", "items": { "type": "string" } }, "port_start": { "type": "number" }, "port_end": { "type": "number" }, "icmp_type": { "type": "number" }, "icmp_code": { "type": "number" }, "description": { "type": "string" }, "enabled": { "type": "boolean" } }, "required": [ "direction", "protocol", "remote_cidrs", "enabled" ], "additionalProperties": false } }, "status": { "type": "string" }, "lastErrorCode": { "type": "string", "nullable": true } }, "required": [ "id", "generation", "observedGeneration", "enabled", "inboundMode", "outboundMode", "rules", "status", "lastErrorCode" ], "additionalProperties": false, "nullable": true }, "operationId": { "type": "string" } }, "required": [ "policy", "operationId" ], "additionalProperties": false }, "meta": { "type": "object", "properties": { "requestId": { "type": "string" }, "timestamp": { "type": "string" } }, "required": [ "requestId", "timestamp" ], "additionalProperties": false } }, "required": [ "ok", "data", "meta" ], "additionalProperties": false }Example response
{ "ok": true, "data": { "policy": { "id": "string", "generation": 0, "observedGeneration": 0, "enabled": true, "inboundMode": "allowlist", "outboundMode": "allowlist", "rules": [ { "id": "string", "direction": "inbound", "protocol": "tcp", "remote_cidrs": [ "string" ], "port_start": 0, "port_end": 0, "icmp_type": 0, "icmp_code": 0, "description": "string", "enabled": true } ], "status": "string", "lastErrorCode": "string" }, "operationId": "string" }, "meta": { "requestId": "string", "timestamp": "string" } }
GETRead NIC firewall countersDetails +/api/v1/projects/:projectId/boxes/:boxId/nics/:nicId/firewall/counters
Read traffic match counters for this interface policy.
Request parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
projectId | path | Yes | string | — |
boxId | path | Yes | string | — |
nicId | path | Yes | string | — |
Responses
200— Successful responseResponse schema
{ "type": "object", "properties": { "ok": { "const": true, "type": "boolean" }, "data": { "type": "object", "properties": { "accountingGap": { "type": "boolean" }, "updatedAt": { "type": "string" }, "items": { "type": "array", "items": { "type": "object", "properties": { "ruleId": { "type": "string" }, "origin": { "type": "string" }, "direction": { "type": "string" }, "packets": { "type": "number" }, "bytes": { "type": "number" } }, "required": [ "origin", "direction", "packets", "bytes" ], "additionalProperties": false } } }, "required": [ "accountingGap", "items" ], "additionalProperties": false }, "meta": { "type": "object", "properties": { "requestId": { "type": "string" }, "timestamp": { "type": "string" } }, "required": [ "requestId", "timestamp" ], "additionalProperties": false } }, "required": [ "ok", "data", "meta" ], "additionalProperties": false }Example response
{ "ok": true, "data": { "accountingGap": true, "updatedAt": "string", "items": [ { "ruleId": "string", "origin": "string", "direction": "string", "packets": 0, "bytes": 0 } ] }, "meta": { "requestId": "string", "timestamp": "string" } }
POSTReset NIC firewall countersDetails +/api/v1/projects/:projectId/boxes/:boxId/nics/:nicId/firewall/counters/reset
Clear interface-specific firewall counters for a new measurement period.
Request parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
projectId | path | Yes | string | — |
boxId | path | Yes | string | — |
nicId | path | Yes | string | — |
JSON request body
| Field | Type / allowed values | Required |
|---|
Complete request schema
{
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}Responses
200— Successful responseResponse schema
{ "type": "object", "properties": { "ok": { "const": true, "type": "boolean" }, "data": { "type": "object", "properties": { "operationId": { "type": "string" } }, "required": [ "operationId" ], "additionalProperties": false }, "meta": { "type": "object", "properties": { "requestId": { "type": "string" }, "timestamp": { "type": "string" } }, "required": [ "requestId", "timestamp" ], "additionalProperties": false } }, "required": [ "ok", "data", "meta" ], "additionalProperties": false }Example response
{ "ok": true, "data": { "operationId": "string" }, "meta": { "requestId": "string", "timestamp": "string" } }
DELETERemove NIC firewall overrideDetails +/api/v1/projects/:projectId/boxes/:boxId/nics/:nicId/firewall/delete
Delete the NIC policy at an optional expected generation so it can inherit Box policy again.
Request parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
projectId | path | Yes | string | — |
boxId | path | Yes | string | — |
nicId | path | Yes | string | — |
generation | query | Yes | number | — |
Responses
200— Successful responseResponse schema
{ "type": "object", "properties": { "ok": { "const": true, "type": "boolean" }, "data": { "type": "object", "properties": { "operationId": { "type": "string" } }, "required": [ "operationId" ], "additionalProperties": false }, "meta": { "type": "object", "properties": { "requestId": { "type": "string" }, "timestamp": { "type": "string" } }, "required": [ "requestId", "timestamp" ], "additionalProperties": false } }, "required": [ "ok", "data", "meta" ], "additionalProperties": false }Example response
{ "ok": true, "data": { "operationId": "string" }, "meta": { "requestId": "string", "timestamp": "string" } }
GETRead effective NIC firewallDetails +/api/v1/projects/:projectId/boxes/:boxId/nics/:nicId/firewall/effective
Read the merged Box and NIC policy actually applied to this interface.
Request parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
projectId | path | Yes | string | — |
boxId | path | Yes | string | — |
nicId | path | Yes | string | — |
Responses
200— Successful responseResponse schema
{ "type": "object", "properties": { "ok": { "const": true, "type": "boolean" }, "data": { "type": "array", "items": { "type": "object", "properties": { "nicId": { "type": "string" }, "ipv4": { "type": "string" }, "protected": { "type": "boolean" }, "inboundMode": { "type": "string" }, "outboundMode": { "type": "string" }, "systemRules": { "type": "array", "items": { "type": "string" } }, "rules": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "direction": { "type": "string", "enum": [ "inbound", "outbound" ] }, "protocol": { "type": "string", "enum": [ "tcp", "udp", "icmp", "any" ] }, "remoteCidrs": { "type": "array", "items": { "type": "string" } }, "portStart": { "type": "number" }, "portEnd": { "type": "number" }, "icmpType": { "type": "number" }, "icmpCode": { "type": "number" }, "description": { "type": "string" }, "enabled": { "type": "boolean" }, "origin": { "type": "string" } }, "required": [ "direction", "protocol", "remoteCidrs", "enabled", "origin" ], "additionalProperties": false } } }, "required": [ "nicId", "ipv4", "protected", "inboundMode", "outboundMode", "systemRules", "rules" ], "additionalProperties": false } }, "meta": { "type": "object", "properties": { "requestId": { "type": "string" }, "timestamp": { "type": "string" } }, "required": [ "requestId", "timestamp" ], "additionalProperties": false } }, "required": [ "ok", "data", "meta" ], "additionalProperties": false }Example response
{ "ok": true, "data": [ { "nicId": "string", "ipv4": "string", "protected": true, "inboundMode": "string", "outboundMode": "string", "systemRules": [ "string" ], "rules": [ { "id": "string", "direction": "inbound", "protocol": "tcp", "remoteCidrs": [ "string" ], "portStart": 0, "portEnd": 0, "icmpType": 0, "icmpCode": 0, "description": "string", "enabled": true, "origin": "string" } ] } ], "meta": { "requestId": "string", "timestamp": "string" } }
GETRead NIC firewall policyDetails +/api/v1/projects/:projectId/boxes/:boxId/nics/:nicId/firewall
Read interface overrides, inheritance modes, rules and generation before editing.
Request parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
projectId | path | Yes | string | — |
boxId | path | Yes | string | — |
nicId | path | Yes | string | — |
Responses
200— Successful responseResponse schema
{ "type": "object", "properties": { "ok": { "const": true, "type": "boolean" }, "data": { "type": "object", "properties": { "supported": { "type": "boolean" }, "capabilities": { "type": "object", "properties": { "managed_firewall_v1": { "type": "boolean" }, "protocols": { "type": "array", "items": { "type": "string" } }, "rules_per_policy": { "type": "number" }, "cidrs_per_rule": { "type": "number" }, "compiled_clauses_per_host": { "type": "number" } }, "required": [], "additionalProperties": false }, "policy": { "type": "object", "properties": { "id": { "type": "string" }, "generation": { "type": "number" }, "observedGeneration": { "type": "number" }, "enabled": { "type": "boolean" }, "inboundMode": { "type": "string", "enum": [ "allowlist", "allow_all", "inherit" ] }, "outboundMode": { "type": "string", "enum": [ "allowlist", "allow_all", "inherit" ] }, "rules": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "direction": { "type": "string", "enum": [ "inbound", "outbound" ] }, "protocol": { "type": "string", "enum": [ "tcp", "udp", "icmp", "any" ] }, "remote_cidrs": { "type": "array", "items": { "type": "string" } }, "port_start": { "type": "number" }, "port_end": { "type": "number" }, "icmp_type": { "type": "number" }, "icmp_code": { "type": "number" }, "description": { "type": "string" }, "enabled": { "type": "boolean" } }, "required": [ "direction", "protocol", "remote_cidrs", "enabled" ], "additionalProperties": false } }, "status": { "type": "string" }, "lastErrorCode": { "type": "string", "nullable": true } }, "required": [ "id", "generation", "observedGeneration", "enabled", "inboundMode", "outboundMode", "rules", "status", "lastErrorCode" ], "additionalProperties": false, "nullable": true }, "effective": { "type": "array", "items": { "type": "object", "properties": { "nicId": { "type": "string" }, "ipv4": { "type": "string" }, "protected": { "type": "boolean" }, "inboundMode": { "type": "string" }, "outboundMode": { "type": "string" }, "systemRules": { "type": "array", "items": { "type": "string" } }, "rules": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "direction": { "type": "string", "enum": [ "inbound", "outbound" ] }, "protocol": { "type": "string", "enum": [ "tcp", "udp", "icmp", "any" ] }, "remoteCidrs": { "type": "array", "items": { "type": "string" } }, "portStart": { "type": "number" }, "portEnd": { "type": "number" }, "icmpType": { "type": "number" }, "icmpCode": { "type": "number" }, "description": { "type": "string" }, "enabled": { "type": "boolean" }, "origin": { "type": "string" } }, "required": [ "direction", "protocol", "remoteCidrs", "enabled", "origin" ], "additionalProperties": false } } }, "required": [ "nicId", "ipv4", "protected", "inboundMode", "outboundMode", "systemRules", "rules" ], "additionalProperties": false } }, "counters": { "type": "object", "properties": { "accountingGap": { "type": "boolean" }, "updatedAt": { "type": "string" }, "items": { "type": "array", "items": { "type": "object", "properties": { "ruleId": { "type": "string" }, "origin": { "type": "string" }, "direction": { "type": "string" }, "packets": { "type": "number" }, "bytes": { "type": "number" } }, "required": [ "origin", "direction", "packets", "bytes" ], "additionalProperties": false } } }, "required": [ "accountingGap", "items" ], "additionalProperties": false } }, "required": [ "supported", "capabilities", "policy", "effective", "counters" ], "additionalProperties": false }, "meta": { "type": "object", "properties": { "requestId": { "type": "string" }, "timestamp": { "type": "string" } }, "required": [ "requestId", "timestamp" ], "additionalProperties": false } }, "required": [ "ok", "data", "meta" ], "additionalProperties": false }Example response
{ "ok": true, "data": { "supported": true, "capabilities": { "managed_firewall_v1": true, "protocols": [ "string" ], "rules_per_policy": 0, "cidrs_per_rule": 0, "compiled_clauses_per_host": 0 }, "policy": { "id": "string", "generation": 0, "observedGeneration": 0, "enabled": true, "inboundMode": "allowlist", "outboundMode": "allowlist", "rules": [ { "id": "string", "direction": "inbound", "protocol": "tcp", "remote_cidrs": [ "string" ], "port_start": 0, "port_end": 0, "icmp_type": 0, "icmp_code": 0, "description": "string", "enabled": true } ], "status": "string", "lastErrorCode": "string" }, "effective": [ { "nicId": "string", "ipv4": "string", "protected": true, "inboundMode": "string", "outboundMode": "string", "systemRules": [ "string" ], "rules": [ { "id": "string", "direction": "inbound", "protocol": "tcp", "remoteCidrs": [ "string" ], "portStart": 0, "portEnd": 0, "icmpType": 0, "icmpCode": 0, "description": "string", "enabled": true, "origin": "string" } ] } ], "counters": { "accountingGap": true, "updatedAt": "string", "items": [ { "ruleId": "string", "origin": "string", "direction": "string", "packets": 0, "bytes": 0 } ] } }, "meta": { "requestId": "string", "timestamp": "string" } }
PUTUpdate NIC firewall policyDetails +/api/v1/projects/:projectId/boxes/:boxId/nics/:nicId/firewall/update
Set interface inbound/outbound modes to inherit, allowlist or allow_all and submit ordered rules.
Request parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
projectId | path | Yes | string | — |
boxId | path | Yes | string | — |
nicId | path | Yes | string | — |
JSON request body
| Field | Type / allowed values | Required |
|---|---|---|
generation | number | No |
enabled | boolean | Yes |
inboundMode | allowlist | allow_all | inherit | Yes |
outboundMode | allowlist | allow_all | inherit | Yes |
rules | object[] | Yes |
Complete request schema
{
"type": "object",
"properties": {
"generation": {
"type": "number"
},
"enabled": {
"type": "boolean"
},
"inboundMode": {
"type": "string",
"enum": [
"allowlist",
"allow_all",
"inherit"
]
},
"outboundMode": {
"type": "string",
"enum": [
"allowlist",
"allow_all",
"inherit"
]
},
"rules": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"direction": {
"type": "string",
"enum": [
"inbound",
"outbound"
]
},
"protocol": {
"type": "string",
"enum": [
"tcp",
"udp",
"icmp",
"any"
]
},
"remote_cidrs": {
"type": "array",
"items": {
"type": "string"
}
},
"port_start": {
"type": "number"
},
"port_end": {
"type": "number"
},
"icmp_type": {
"type": "number"
},
"icmp_code": {
"type": "number"
},
"description": {
"type": "string"
},
"enabled": {
"type": "boolean"
}
},
"required": [
"direction",
"protocol",
"remote_cidrs",
"enabled"
],
"additionalProperties": false
}
}
},
"required": [
"enabled",
"inboundMode",
"outboundMode",
"rules"
],
"additionalProperties": false
}Responses
200— Successful responseResponse schema
{ "type": "object", "properties": { "ok": { "const": true, "type": "boolean" }, "data": { "type": "object", "properties": { "policy": { "type": "object", "properties": { "id": { "type": "string" }, "generation": { "type": "number" }, "observedGeneration": { "type": "number" }, "enabled": { "type": "boolean" }, "inboundMode": { "type": "string", "enum": [ "allowlist", "allow_all", "inherit" ] }, "outboundMode": { "type": "string", "enum": [ "allowlist", "allow_all", "inherit" ] }, "rules": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "direction": { "type": "string", "enum": [ "inbound", "outbound" ] }, "protocol": { "type": "string", "enum": [ "tcp", "udp", "icmp", "any" ] }, "remote_cidrs": { "type": "array", "items": { "type": "string" } }, "port_start": { "type": "number" }, "port_end": { "type": "number" }, "icmp_type": { "type": "number" }, "icmp_code": { "type": "number" }, "description": { "type": "string" }, "enabled": { "type": "boolean" } }, "required": [ "direction", "protocol", "remote_cidrs", "enabled" ], "additionalProperties": false } }, "status": { "type": "string" }, "lastErrorCode": { "type": "string", "nullable": true } }, "required": [ "id", "generation", "observedGeneration", "enabled", "inboundMode", "outboundMode", "rules", "status", "lastErrorCode" ], "additionalProperties": false, "nullable": true }, "operationId": { "type": "string" } }, "required": [ "policy", "operationId" ], "additionalProperties": false }, "meta": { "type": "object", "properties": { "requestId": { "type": "string" }, "timestamp": { "type": "string" } }, "required": [ "requestId", "timestamp" ], "additionalProperties": false } }, "required": [ "ok", "data", "meta" ], "additionalProperties": false }Example response
{ "ok": true, "data": { "policy": { "id": "string", "generation": 0, "observedGeneration": 0, "enabled": true, "inboundMode": "allowlist", "outboundMode": "allowlist", "rules": [ { "id": "string", "direction": "inbound", "protocol": "tcp", "remote_cidrs": [ "string" ], "port_start": 0, "port_end": 0, "icmp_type": 0, "icmp_code": 0, "description": "string", "enabled": true } ], "status": "string", "lastErrorCode": "string" }, "operationId": "string" }, "meta": { "requestId": "string", "timestamp": "string" } }