Code is community submitted, community supported, and recognized as ‘Use At Your Own Risk’.
In this article, I will explore how to create a graphical representation of a virtual server using Python Flask, Pyvis libraries, and the IControl REST F5 API. This graphical representation will provide a visual representation of the virtual server, including the pools and pool members(servers) it is connected to, and also the URI.
(As irules can be really complex, this is mainly for irules with "if" and "switch" clauses.)
Problem solved by this Code Snippet
Having a graphical representation of how a virtual server distributes the traffic to its pools, makes it easier to understand.
How to use this Code Snippet
There are 2 main files:
F5_VIP_grapher.py <VIP_name> - this is how you run it and will generate the HTML files "static" folder.
app.py - this is the app that starts the Flask web server and provides a front-end to the F5_VIP_grapher.py.
There is also a Dockerfile that you can use to containerize this app.
There are 2 environment variables: Authorization_string (this is credentials(user:pass) for Basic authentication) and IP_ADDRESS (this is the IP of the F5 device).