How import blacklist domain to Proxmox 6.4-3

Apr 9, 2021
12
0
6
28
Hi

I exported blacklist domains from older Proxmox Gateway to file blacklist.txt.
This file has this structure
[
{
"descr" : "bizwebsite.com",
"domain" : "bizwebsite.com",
"id" : "2881",
"ogroup" : 2,
"otype" : 1002,
"otype_text" : "Domain",
"receivertest" : 0
}, ....
]
How Can I import this blacklist to new Proxmox Gateway?

Best regards
 
In that case you can use the PMG-API or pmgsh:
https://pmg.proxmox.com/pmg-docs/api-viewer/index.html#/config/ruledb/who
(is the api-path you're interested in (and the POST method there)

the REST-API of PMG is quite similar to the one of PVE - check out the docs for it:
https://pve.proxmox.com/wiki/Proxmox_VE_API

the text-file looks like a json-dump - you should be able to get all information in a sensible way out using jq (or any other json parser)
https://lzone.de/cheat-sheet/jq

I hope this helps!