Forum Discussion

irulemaker_1057's avatar
irulemaker_1057
Icon for Nimbostratus rankNimbostratus
Oct 13, 2014

Enable pool member in Python/Bigsuds

Hi, My request is simple. I just want to enable pool with Python/Bigsuds on a BigIP 6800 V10.2.3.

 

This is my connection in bigsuds :

 

b = bigsuds.BIGIP(hostname = 'mybigip.local', username = 'myuser', password = 'mypass')

 

This code work to disable pool member :

 

b.LocalLB.PoolMember.set_monitor_state(['mypool'], [[{'member': {'address' : '192.168.X.X', 'port': 443}}]]), [[{'monitor_state': 'STATE_DISABLED'}]]

 

But if replace [[{'monitor_state': 'STATE_DISABLED'}]] by [[{'monitor_state': 'STATE_ENABLED'}]], i've no action...

 

Do you have an idea please ?

 

Thanks

 

5 Replies

  • Its been a while since I did this in 10.2. Anyway I am thinking you do not need to define that as a dictionary, it just needs to be a list.

    b.LocalLB.PoolMember.set_monitor_state(['mypool'], [[{'member': {'address' : '192.168.X.X', 'port': 443}}]]), ['STATE_DISABLED'])
    

    See if that works, if not let me know and I will find an old ltm to test against.

  • Correction, needs to be a list in a list

    b.LocalLB.PoolMember.set_monitor_state(['mypool'], [[{'member': {'address' : '192.168.X.X', 'port': 443}}]]), [['STATE_DISABLED']])
    
  • last try. I found a V9 LTM to test against, 10.2 should be the same. It should be a dictionary item as you originally had, it just needs to be part of the same dictionary as the member definition.

    b.LocalLB.PoolMember.set_monitor_state(['mypool'], [[{'member': {'address' : '192.168.X.X', 'port': 443}, 'monitor_state' : 'STATE_ENABLED'}]])
    
  • Hi Mimlo, Thanks so much for your reply.

     

    Your last answer working fine for me. It's strange 'monitor_state' be on the same dictionary than 'member'...

     

    It's not too explicit on this doc : https://devcentral.f5.com/Wiki/iControl.LocalLB__PoolMember__set_monitor_state.ashx

     

    Thanks again

     

    • mimlo_61970's avatar
      mimlo_61970
      Icon for Cumulonimbus rankCumulonimbus
      Agreed, I had to try it like 10 times to figure it out. Its cleaner in v11