That did the trick! I've not migrated my "old rules" to "new rules", so I created a simple test "new rule".
Running my Python-script works like a charm, so many thanks again for taking your time and responding!
If anyone is interested;
Running my Python-script works like a charm, so many thanks again for taking your time and responding!
If anyone is interested;
- as meyergru stated: API access to toggle_rule only works for "new rules", created via https://<OPNSENSE>/ui/firewall/filter/, as only those are exposed via the API
- You don't need a (json-)payload for the POST request, the API endpoint is https://<OPNSENSE>/api/firewall/filter/toggle_rule/<UUID>
- The POST request is as simple as api_response = requests.post(opnsense_api_url, auth=(opnsense_api_key, opnsense_api_secret), verify=False)
"