Greetings! (:
We are managing OPNSense aliases using the API.
I have a problem setting the update frequency for the alias-type 'urltable'.
Per example I'm sending a request like this:
POST to /api/firewall/alias/addItem
Data: {"name": "IPLIST_Spamhaus_DROPv6", "type": "urltable", "content": ["https://www.spamhaus.org/drop/dropv6.txt"]}
This works like expected and the alias gets added.
But without setting any update frequency. I actually don't know if the ip-list gets fetched periodically without that.
I tried setting it via:
updatefreq refenence: https://github.com/opnsense/core/blob/master/src/opnsense/mvc/app/models/OPNsense/Firewall/Alias.xml
updatefreq_days reference: https://github.com/opnsense/core/blob/master/src/opnsense/mvc/app/views/OPNsense/Firewall/alias.volt
Combined string:
{"name": "N", "type": "urltable", "content": ["U"], "updatefreq": "7d"}
Default int: (not defined if days or hours?)
{"name": "N", "type": "urltable", "content": ["U"], "updatefreq": 7}
Days string:
{"name": "N", "type": "urltable", "content": ["U"], "updatefreq_days": "7"}
Days int:
{"name": "N", "type": "urltable", "content": ["U"], "updatefreq_days": 7}
Nested string:
{"name": "N", "type": "urltable", "content": ["U"], "updatefreq": {"updatefreq_days": "7"}}
Nested int:
{"name": "N", "type": "urltable", "content": ["U"], "updatefreq": {"updatefreq_days": 7}}
Note: 'N' and 'U' are replacements to simplify the examples
But none of the tries succeeded.
As I found no further documentation for using the API => is this possible at all?
And if - how? (:
- have a nice Day
Rath
{"alias":{"enabled":"1","name":"SPAMHOUSE_DROP","type":"urltable","proto":"","updatefreq":"0.5","content":"https://www.spamhaus.org/drop/drop.txt","interface":"","counters":"0","description":"SPAMHOUSE_DROP"},"network_content":""}
? (for 12h updatefreq alias)
so updatefreq is precalculated value as a number of days between updates
Hello.
Thank you for your help!
Seems it works this way. :D
- have a nice Day
Rath