Create Firewall Traffic Rule
POST
/network/firewall/traffic
const url = 'https://sylve.lan:8181/api/network/firewall/traffic';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"action":"pass","blockResponse":"default","description":"example","destObjId":1,"destRaw":"example","direction":"in","dstPortObjId":1,"dstPortsRaw":"example","egressInterfaces":["example"],"enabled":true,"family":"any","icmpTypes":["example"],"ingressInterfaces":["example"],"kind":"standard","log":true,"name":"example","priority":1,"protocol":"any","quick":true,"rawPF":"example","sourceObjId":1,"sourceRaw":"example","srcPortObjId":1,"srcPortsRaw":"example","statePolicy":"default"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://sylve.lan:8181/api/network/firewall/traffic \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "action": "pass", "blockResponse": "default", "description": "example", "destObjId": 1, "destRaw": "example", "direction": "in", "dstPortObjId": 1, "dstPortsRaw": "example", "egressInterfaces": [ "example" ], "enabled": true, "family": "any", "icmpTypes": [ "example" ], "ingressInterfaces": [ "example" ], "kind": "standard", "log": true, "name": "example", "priority": 1, "protocol": "any", "quick": true, "rawPF": "example", "sourceObjId": 1, "sourceRaw": "example", "srcPortObjId": 1, "srcPortsRaw": "example", "statePolicy": "default" }'Create and apply a firewall traffic rule
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Create Firewall Traffic Rule Request
Media typeapplication/json
object
action
string
blockResponse
string
description
string
destObjId
integer
destRaw
string
direction
string
dstPortObjId
integer
dstPortsRaw
string
egressInterfaces
required
Array<string>
enabled
boolean
family
string
icmpTypes
required
Array<string>
ingressInterfaces
required
Array<string>
kind
string
log
boolean
name
required
string
priority
integer
protocol
string
quick
boolean
rawPF
string
sourceObjId
integer
sourceRaw
string
srcPortObjId
integer
srcPortsRaw
string
statePolicy
string
Responses
Section titled “Responses”Created
Media typeapplication/json
object
data
integer
error
string
message
string
status
string
Examplegenerated
{ "data": 1, "error": "example", "message": "example", "status": "example"}Bad Request
Media typeapplication/json
object
data
error
string
message
string
status
string
Examplegenerated
{ "data": "example", "error": "example", "message": "example", "status": "example"}Unauthorized
Media typeapplication/json
object
data
error
string
message
string
status
string
Examplegenerated
{ "data": "example", "error": "example", "message": "example", "status": "example"}Forbidden
Media typeapplication/json
object
data
error
string
message
string
status
string
Examplegenerated
{ "data": "example", "error": "example", "message": "example", "status": "example"}Payload Too Large
Media typeapplication/json
object
data
error
string
message
string
status
string
Examplegenerated
{ "data": "example", "error": "example", "message": "example", "status": "example"}Internal Server Error
Media typeapplication/json
object
data
error
string
message
string
status
string
Examplegenerated
{ "data": "example", "error": "example", "message": "example", "status": "example"}