rahvee
Oct 14, 2022Altocumulus
How to use partitions with BIGREST
Hi, I'm using BIGREST, and I'm able to create a BIGIP object,
f5 = BIGIP(hostname, username, password...)
I'm able to get a list of partitions:
def f5_get_partitions(f5_session: BIGIP) -> List[str]:
result = f5_session.load("/mgmt/tm/sys/folder") # type: List[RESTObject]
partitions: List[str] = []
for r in result:
if len(r.properties['fullPath']) < 2:
# The '/' path should be ignored
continue
if r.properties['fullPath'].count('/') > 1:
# Skip things like /Common/foo and /Common/bar
continue
partitions.append(r.properties['name'])
return partitions
But I haven't figured out how to load something from a partition other than 'Common'. I tried this. It doesn't work:
for partition in partitions:
f5.load("/mgmt/tm/sys/crypto/cert", partition=partition)
The error I get is:
TypeError: load() got an unexpected keyword argument 'partition'
How do you load from a partition?