Forum Discussion
Create Address List, Port List, Firewall Policy, Firewall rules with F5 Python SDK
Hello!
I really like the detailed documentation for the Traffic Managment Shell. There would be a section and then all the information for each component (ex: virtual server) would be there. However, there seems to not be real detailed examples or information for the F5 SDK. Yes, there's a bunch of examples for how to build a pool and add members.
Would someone please be so kind as to help me know how to create an address-list, port-list, firewall policy, firewall rule, as well as how to build a virtual server and link it all together? I already figured it all out with the TMSH, but it's not a viable path anymore. I have to do this with the python F5 SDK. I keep seeing params being listed in the documentation but no detail of what the parameters are in the same way that the TMSH documentation is very user friendly.
Thank you so much!
- Andy_McGrathCumulonimbus
All f5-sdk documentation can be found here F5 Python SDK Documentation
For Security AFM part of the documentation see F5 SDK API Doc: security
- mkyrcCirrus
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?
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com