Forum Discussion
mkyrc
Mar 09, 2021Cirrus
Hello,
I try to ask here, because f5-sdk documentation is not clear for me. I'd like to read rule_lists with rules.
Here is part of my code:
mgmt = ManagementRoot(bigip_host, bigip_username, bigip_password)
afm = mgmt.tm.security.firewall
# list of rule_lists
rule_lists = afm.rule_lists.get_collection()
i = 0
for rule_list in rule_lists:
print(f"{i}:")
print("[ %s | %s | %s ]" % (rule_list.partition, rule_list.name, rule_list.fullPath))
i += 1
I'm using 'https://f5-sdk.readthedocs.io/en/latest/apidoc/f5.bigip.tm.security.html#f5.bigip.tm.security.firewall.Rule_Lists' for reading all rule_lists. But it's not clear for me, how can I read rules for rule_list.
Is it possible to read not all rule_lists, but e.g. only some rule lists with specifiv preffix? How?