Forum Discussion

Jim_43682's avatar
Jim_43682
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 = "167.69.74.38"

 

port = 443

 

}

 

memberEnabledState['state'] = 'STATE_ENABLED'

 

 

pc.BIGIP(hostname=gtm,username=soapUser,password=soapPasswd,fromurl=True,wsdls=content).GlobalLB.Pool.set_enabled_state([gtm_pool],memberEnabledState)

 

 

Thanks in advanced,

 

 

Jim

 

  • I reworked my memberEnabledState obj:

     

     

    >>> memberEnabledState

     

    (GlobalLB.PoolMember.MemberEnabledState){

     

    member =

     

    (Common.IPPortDefinition){

     

    address = "167.69.x.x"

     

    port = "443"

     

    }

     

    state =

     

    (Common.EnabledState){

     

    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
    Mark_Worrell_98
    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.

     

     

    Mark

     

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

     

     

    returns..

     

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

     

  • Found answer here. https://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/4/aft/1176415/showtab/groupforums/Default.aspx

     

     

    Had to put memberEnabledState into a F5 MemberEnabledStateSequence obj!

     

     

    BAM!