Forum Discussion
removing the last moniotr from a pool in the python sdk
I have some code where I can add and remove monitors from pools using:
pool = self.bigip_root.tm.ltm.pools.pool.load(partition=self.partition, name=pool_name)
pool.update(monitor='/Common/http and /Common/https')
But, when I get to the last monitor, I can't remove it. What I'm doing is:
pool.update(monitor='')
But, this doesn't do anything. How do I remove the last monitor in python?
- Rob_74473
Cirrus
I still don't have a solution for removing the last health monitor from a pool, but I have found a way to crash a bigip!
pool.update(monitor=' ')
This reliably crashes version: BIG-IP 12.1.3.7 Build 0.0.2 Point Release 7
This API just keeps getting better...
(also, I just tried to put this comment in as a comment, but this site did nothing when I clicked on Add Comment, so I have to put it in as an answer...)
- Satoshi_Toyosa1Ret. Employee
Use
. For example (using curl):"none"
curl -sku : https:///mgmt/tm/ltm/pool/TestPool \ -H "Content-type: application/json" -X PATCH \ -d '{"monitor":"none"}'
The tm.ltm.pool API Guide says: 'You may remove the monitor by specifying "none".'
- Satoshi_Toyosa1Ret. Employee
And here's a sample Python code.
from f5.bigip import ManagementRoot poolObj = ManagementRoot('', '', '').tm.ltm.pools.pool.load(name='TestPool') poolObj.update(monitor='none')
Recent Discussions
Related Content
* 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