Getting Started with the f5-common-python SDK
If you have dabbled with python and iControl over the years, you might be familiar with some of my other “Getting Stared with …” articles on python libraries. I started my last, on Bigsuds, this way:...
Updated Jun 06, 2023
Version 2.0JRahm
Admin
Joined January 20, 2005
JRahm
Nov 30, 2017Admin
The partitionAccess field is a list of attributes on the primary user object, but not a subcollection. A true subcollection, like pool members, is addressed like this:
>>pool = b.tm.pools.pool.load(name='testpool')
>>members = pool.members_s.get_collection()
>>for member in members:
... print member.name
10.10.10.100:80
192.168.103.20:80
To get to your attributes and change them, you just need to pull the dictionary indexed at list item 0:
>>> u = b.tm.auth.users.user.load(name='jason')
>>> u.partitionAccess[0]['role']
u'irule-manager'
>>> u.partitionAccess[0]['role'] = 'guest'
>>> u.update()