You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, and thank you for your wonderful work.
I'm trying to add a rule via your API (JSON) with the source matched to an alias list.
if I query the rules created via the interface the result is similar to:
"source":{"address":"pfB_PRI1_v4"}
obviously if specific
"src": "any",
it works and creates the rule
I've tried in multiple ways and with various syntaxes [] but I can't:
The request schema for this endpoint differs a bit from the response schema. In short, the src and dst request body fields must be a string containing an IP, CIDR, interface name, or alias name. You can find the entire request body schema documentation by doing the following:
In the pfSense webConfigurator, go to System > API > Documentation.
Locate and select the endpoint you are looking to interact with.
Under the 'Request body' section, select the 'Schema' tab. This will provide documentation for each field available to be used in the request body.
The documentation for the field you are looking for is:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, and thank you for your wonderful work.
I'm trying to add a rule via your API (JSON) with the source matched to an alias list.
if I query the rules created via the interface the result is similar to:
"source":{"address":"pfB_PRI1_v4"}
obviously if specific
"src": "any",
it works and creates the rule
I've tried in multiple ways and with various syntaxes [] but I can't:
example:
curl -k -u 'user:password' -X 'POST'
'https://192.168.11.252/api/v1/firewall/rule'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{
"apply": false,
"descr": "TEST RULE API",
"direction": "any",
"disabled": true,
"dst": "any",
"floating": false,
"interface": [
"wan"
],
"ipprotocol": "inet",
"log": false,
"protocol": "any",
"quick": false,
"src": {
"address": "pfB_TEST_v4"
},
"tcpflags_any": false,
"tcpflags1": [
"fin"
],
"tcpflags2": [
"fin"
],
"top": false,
"type": "block"
}'
I'm definitely doing something wrong, can you help me
Beta Was this translation helpful? Give feedback.
All reactions