1
Development and Code Review / Re: API Wireguard "result": "failed"
« on: November 22, 2022, 12:20:38 am »
Having same issue trying to toggle a firewall rule:
This is same as in this example: https://docs.opnsense.org/development/api/plugins/firewall.html
The uuid is a correct one, I can do:
and obtain a complete JSON with details.
Also getting same error with a simpler:
How does one actually obtain some more meaningful reason for an error?
EDIT: my issue was due to the Firewall Plugin API only supporting rules that were added using its own UI; see https://github.com/opnsense/docs/pull/437
Code: [Select]
curl -k -u "user":"pass" "https://opnsense/api/firewall/filter/toggleRule/702cdc85-cf43-437a-9882-4beba77fb35c/0" -X POST -d ""
{"result":"failed"}%
This is same as in this example: https://docs.opnsense.org/development/api/plugins/firewall.html
The uuid is a correct one, I can do:
Code: [Select]
url -k -u key:pass "https:/opnsense/api/firewall/filter/getRule?uuid=702cdc85-cf43-437a-9882-4beba77fb35c"
and obtain a complete JSON with details.
Also getting same error with a simpler:
Code: [Select]
curl -k -u key:pass "https://opnsense/api/firewall/filter/toggleRule/702cdc85-cf43-437a-9882-4beba77fb35c/1"
How does one actually obtain some more meaningful reason for an error?
EDIT: my issue was due to the Firewall Plugin API only supporting rules that were added using its own UI; see https://github.com/opnsense/docs/pull/437