Forum Discussion
fxt_31120
Jul 04, 2012Nimbostratus
How to find a Virtual server by ip+port
Hi everybody,
I'm looking for a Icontrol cmdlet or a tips for search if my @ip+port is already used by a Virtual server.
Right now I use a combo of 2 functions but it's not efficient at all (8 to 10...
mhite_60883
Jul 18, 2012Cirrocumulus
Something like this (python):
def f5_virtual_server_exists(b, ip, port):
log.debug("Entering f5_virtual_server_exists()...")
log.debug("ip = %s" % ip)
log.debug("port = %s" % port)
vs_list = b.LocalLB.VirtualServer.get_list()
for vs in vs_list:
vs_dest = b.LocalLB.VirtualServer.get_destination([vs])[0]
if (str(vs_dest.address) == ip) and (str(vs_dest.port) == port):
log.debug("Returning True...")
log.debug("Exiting f5_virtual_server_exists()...")
return(True)
log.debug("Returning False...")
log.debug("Exiting f5_virtual_server_exists()...")
return(False)
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects