Forum Discussion
Kevin_Stewart
Jun 28, 2014Employee
Here's a thought, and I haven't tested this with a Python iControl, so your mileage may vary.
If I do this from the command line, adding a node to a pool (where that node already exists somewhere else):
tmsh modify ltm pool test1-pool members add { foo-node:80 { address 10.70.0.2 } }
I'll certainly get the error:
Pool member node (/Common/foo-node) and existing node (/Common/10.70.0.2) cannot use the same IP Address (10.70.0.2)
But if I do this:
modify ltm pool test1-pool members add { 10.70.0.2:80 }
It'll work, which basically means that it's using the existing node and not trying to create a new one. If that node didn't already exist, it would be created automatically. Again, I haven't tested this with a Python iControl, but the iControl REST version would look like this:
curl -sk -u 'admin:admin' -H "Content-Type: application/json" -X PUT https://x.x.x.x/mgmt/tm/ltm/pool/test1-pool -d '{"name":"test1-pool","members":[{"name":"10.70.0.1:80"}]}'
What I don't think is possible is adding a single member to a collection, so you may need to enumerate the existing collection first, and then re-add all of the members.