Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - niceRath

#1
22.7 Legacy Series / Re: Alias API - URL-Table updatefreq
September 02, 2022, 09:27:20 AM
Hello.

Thank you for your help!

Seems it works this way.  :D

- have a nice Day
Rath
#2
22.7 Legacy Series / Alias API - URL-Table updatefreq
August 16, 2022, 02:51:12 PM
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