Forum Discussion

Rob_74473's avatar
Rob_74473
Icon for Cirrus rankCirrus
Oct 22, 2018

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?

 

3 Replies

  • 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...)

     

  • Use

    "none"
    . For example (using curl):

     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".'

  • 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')