Forum Discussion
Thiyagu
Jan 26, 2021Cirrus
Need help with f5 SDK for a program to identify the node for the provided IP address and subsequently removing the config
Hello All, I'm working on a F5 SDK python script to to identify the node for the provided IP address and subsequently removing the node from the member and removing the node from the load balancer c...
Jan 26, 2021
Hello Thiyagu.
You are assigning 'member.name' to pool_memeber.
After that you are deleting this object, but this no makes sense.
First you need to load the whole pool object using "load" and then you can delete it.
# Delete a pool if it exists
if mgmt.tm.ltm.pools.pool.exists(name='mypool', partition='Common'):
pool_b = mgmt.tm.ltm.pools.pool.load(name='mypool', partition='Common')
pool_b.delete()
The pool object you are loading in the previous code is the same object you can get from your code this way.
for pool in ltm.pools.get_collection():
for member in pool.members_s.get_collection():
if my_node in member.name:
print("{} is in the pool {}".format(my_node, pool.name))
# Deleting the pool.
pool.delete()
Regards,
Darío.
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