Forum Discussion
Robert_47833
Altostratus
Aug 15, 2017python f5-sdk search node name with ip
there is ip IPA , I need to search its name if this IPA already exists in LTM
currently I am using :
nodes = mgmt.tm.ltm.nodes.get_collection()
for m in nodes:
if m.address==IPA:
print(m.name)
But it is too slow, any one have idea to improve this?
- cjunior
Nacreous
Hi Robert, Unfortunately I could not test it, but looking at the documentation quickly, I think it should be like this:
if mgmt.tm.ltm.nodes.node.exists(partition='Common', address=IPA): node = mgmt.tm.ltm.nodes.node.load(partition='Common', address=IPA) print(node.name)
Just a shot.
I hope it helps.
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