Technical Forum
Ask questions. Discover Answers.
Showing results for 
Search instead for 
Did you mean: 

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(['fullPath']) < 2:
            # The '/' path should be ignored
        if['fullPath'].count('/') > 1:
            # Skip things like /Common/foo and /Common/bar
    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?


Hello @rahvee,

BigREST is similar to use iControlREST. Have you tried with the same resources available as with iControlREST?



It seems, by default, I actually am getting all results, so I don't need to use the `options=recursive` setting. In fact, when I try `options=recursive` I get no results. But applying the filter as shown `?\$filter=partition+eq+<partition name>` works, so that's helpful. Thanks

Hi @rahvee 

The partition names are integrated into the object names. Check the examples here

Hope that helps.

Yes, I noticed the partition name is embedded in the response, but it's only returning results from Common. Not from any other partition. I'll try Dario's answer and see if that helps...

My mistake. By default, all results *are* returned, and I only need to examine the `fullPath` property, as you said.