...
- Normal response codes: 200
- Error response codes: 401, 404
Redirect
Rule
GET /cgi-bin/luci/sdewan/firewall/v1/frules
Lists all defined rules
Request: N/A
Response
- Normal response codes: 200
Response Parameters
Name In Type Description rules body array a list of defined rules - Response Example
{
"rules": [{
"name":"REJECT_LAN_80"
"src":"lan",
"src_ip": "192.168.1.2",
"src_port": "80",
"proto":"tcp",
"target":"REJECT"
}
]
}
GET /cgi-bin/luci/sdewan/firewall/v1/rule/{rule}
Get a rule
Request: N/A
Request Parameters
Name In Type Description rule path string rule name
Response
- Normal response codes: 200
- Error response code: 404
Response Parameters
Name In Type Description name body string (Required) forwarding name src body string (Required) traffic source zone dest body string (Required) traffic destination zone family body string Protocol family ( ipv4
,ipv6
orany
) to generate iptables rules for.- Response Example
{
"name":"REJECT_LAN_80"
"src":"lan",
"src_ip": "192.168.1.2",
"src_port": "80",
"proto":"tcp",
"target":"REJECT"
}
POST /cgi-bin/luci/sdewan/firewall/v1/rule
create a new rule
Request:
Request Parameters: same with GET's response request
- Request Example: same with GET's response example
Response
- Normal response codes: 201
- Error response codes: 400, 401
PUT /cgi-bin/luci/sdewan/firewall/v1/rule/{rule}
update a rule
Request:
Request Parameters:
Name In Type Description rule path string rule name {other params} body same with GET response - Request Example
{
"src":"lan",
"src_ip": "192.168.1.2",
"src_port": "80",
"proto":"tcp",
"target":"REJECT"
}
Response
- Normal response codes: 204
- Error response codes: 400, 401, 404
DELETE /cgi-bin/luci/sdewan/firewall/v1/rule/{rule}
delete a firewall rule
Request:
Request Parameters
Name In Type Description rule path string rule name
Response
- Normal response codes: 200
- Error response codes: 401, 404
Forwarding
GET /cgi-bin/luci/sdewan/firewall/v1/forwardings
...