Forum Discussion

Jim_43682's avatar
Icon for Nimbostratus rankNimbostratus
Mar 30, 2012

pycontrol GlobalLB.PoolMember.set_enabled_state()

Hello All,



I am trying to write a pycontrol statement that will enable/disable a pool member in a gtm pool.



I'm getting stuck on the MemberEnabledState parameter that i need to pass. I've tried so far:



import pycontrol.pycontrol as pc



memberEnabledState = {}


memberEnabledState['member'] = (Common.IPPortDefinition){


address = ""


port = 443




memberEnabledState['state'] = 'STATE_ENABLED'






Thanks in advanced,





4 Replies

  • I reworked my memberEnabledState obj:



    >>> memberEnabledState




    member =




    address = "167.69.x.x"


    port = "443"




    state =




    value = 1







    so now it is correctly defined


    however when I try to run it..


    gtmPoolMemberObj = b.BIGIP(hostname=host,username=user,password=pass,fromurl=True,wsdls=['GlobalLB.PoolMember'])


    gtmPoolMemberObj.GlobalLB.PoolMember.set_enabled_state([gtm_pool], memberEnabledState)



    I get:


    suds.TypeNotFound: Type not found: 'member'


  • Mark_Worrell_98's avatar
    Historic F5 Account
    The memberEnabledState argument is a sequence sequence.



    gtmPoolMemberObj.GlobalLB.PoolMember.set_enabled_state([gtm_pool], memberEnabledState)



    should be something like



    gtmPoolMemberObj.GlobalLB.PoolMember.set_enabled_state([gtm_pool], [[memberEnabledState]])



    I'm not a pycontrol user so I'm guessing at the actual syntax.





  • >>>gtmPoolMemberObj.GlobalLB.PoolMember.set_enabled_state([gtm_pool], [[memberEnabledState]])





    suds.WebFault: Server raised fault: 'Could not find element by name: member'


  • Found answer here.



    Had to put memberEnabledState into a F5 MemberEnabledStateSequence obj!