Automated bulk import of rules?

Hi,

if the API featured a command add_rule, just like add_host, I’d agree that the API would be easier to handle. But unfortunately you need to first identify the ruleset you want with get_ruleset_info, then retrieve the complete ruleset with get_ruleset, then have your script add the new rules and then use set_ruleset to import this modified ruleset, including all old and new rules.

So, just adding a few text lines to add a Python dictionary to a rules.mk file indeed does seem a lot easier and less risky. There’s probably a good reason, why handling rules is not yet possible with the new REST API, only with the old API. It seems to be a rather complex topic.

Kind regards,
Dirk.