Forum Discussion
Python F5SDK - Is Modify Supported?
- Apr 16, 2020
IIRC, with modify, you need to pass the attributes you are wanting to patch in as kwargs instead of setting the attributes directly as with the update method.
IIRC, with modify, you need to pass the attributes you are wanting to patch in as kwargs instead of setting the attributes directly as with the update method.
- BhudsonApr 16, 2020Nimbostratus
Thanks Jason. Amended code below works as desired. Chalk this up to a mistake with understanding kwargs and python. Executing the code below yields a curl command that shows the data element correctly as well.
from f5.bigip import ManagementRoot
from f5.utils.responses.handlers import Stats
import json
mgmt = ManagementRoot(hostname=<myIPHere>, username=<myusername>, password=<mypassword>, token=True, debug=True);
myPool = mgmt.tm.ltm.pools.pool.load(partition='Common', name='<pool name>')
myPoolMembers = myPool.members_s.get_collection()
for poolMember in myPoolMembers:
print(poolMember.raw)
poolMember.modify(session='user-disabled')
# Here only to get curl commands for debug purposes
for x in mgmt.debug_output:
print()
print(x)
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