V20: SFOS Automation SDK (Python) - Working Example for L3-Rule create

Hi,

I need a working Example how can I create a simple Any-Any Allow L3-Rule on a V20 SFOS using the Python SFOS Automation SDK.

This:


rule_params = rule_params = dict(
    rulename="Allow Any-Any",
    description="Test change automation",
    action="accept",
    log="Disable",
    src_zones=["LAN"],
    dst_zones=["WAN"],
    src_networks=["Any"],
    dst_networks=["Any"],
    service_list=["Any"]
)

res = ""
#with trial: res = sfos.create_rule(rule_params=rule_params, debug=True)
res = sfos.create_rule(rule_params=rule_params, debug=True)
pprint(res)

does not work.

Error:

sophosfirewall_python.firewallapi.SophosFirewallAPIError: {'@transactionid': '', 'Status': {'@code': '500', '#text': 'Operation could not be performed on Entity.'}}



Added V20 TAG
[edited by: Erick Jan at 2:01 AM (GMT -7) on 17 Apr 2024]