def set_firewall_rule_destination_networkgroup(hostname, firewall_name, rulenumber, dnetworkgroup): v = vapilib.api( hostname=hostname, api="post", op="set", cmd=[ "firewall", "name", firewall_name, "rule", rulenumber, "destination", "group", "network-group", dnetworkgroup ], description="set dnetworkgroup", ) return v
def set_firewall_rule_source_networkgroup_delete(hostname, firewall_name, rulenumber): v = vapilib.api( hostname=hostname, api="post", op="delete", cmd=[ "firewall", "name", firewall_name, "rule", rulenumber, "source", "group", "network-group" ], description="delete snetworkgroup", ) return v
def set_firewall_rule_source_addressgroup(hostname, firewall_name, rulenumber, saddressgroup): v = vapilib.api( hostname=hostname, api="post", op="set", cmd=[ "firewall", "name", firewall_name, "rule", rulenumber, "source", "group", "address-group", saddressgroup ], description="set saddressgroup", ) return v
def set_firewall_rule_destination_addressgroup_delete(hostname, firewall_name, rulenumber): v = vapilib.api( hostname=hostname, api="post", op="delete", cmd=[ "firewall", "name", firewall_name, "rule", rulenumber, "destination", "group", "address-group" ], description="delete daddressgroup", ) return v
def set_firewall_rule_source_address_delete(hostname, firewall_name, rulenumber): v = vapilib.api( hostname=hostname, api="post", op="delete", cmd=[ "firewall", "name", firewall_name, "rule", rulenumber, "source", "address" ], description="set saddress", ) return v
def set_firewall_rule_destination_address(hostname, firewall_name, rulenumber, address): v = vapilib.api( hostname=hostname, api="post", op="set", cmd=[ "firewall", "name", firewall_name, "rule", rulenumber, "destination", "address", address ], description="set daddress", ) return v
def set_firewall_rule_destination_ports_delete(hostname, firewall_name, rulenumber): v = vapilib.api( hostname=hostname, api="post", op="delete", cmd=[ "firewall", "name", firewall_name, "rule", rulenumber, "destination", "port" ], description="delete destination port", ) return v
def set_firewall_rule_tcpflags(hostname, firewall_name, rulenumber, tcpflags): if len(tcpflags) > 0: tcpflags_txt = ",".join(tcpflags) v = vapilib.api( hostname=hostname, api="post", op="set", cmd=[ "firewall", "name", firewall_name, "rule", rulenumber, "tcp", "flags", tcpflags_txt ], description="set tcpflags", ) return v
def set_firewall_rule_source_ports(hostname, firewall_name, rulenumber, ports): ports_text = ','.join(ports) v = vapilib.api( hostname=hostname, api="post", op="set", cmd=[ "firewall", "name", firewall_name, "rule", rulenumber, "source", "port", ports_text ], description="set source ports", ) return v