Forum Discussion
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?
Hello rahvee,
BigREST is similar to use iControlREST. Have you tried with the same resources available as with iControlREST?
https://support.f5.com/csp/article/K27215222
- rahveeCirrus
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 https://bigrest.readthedocs.io/examples.html
Hope that helps.
- rahveeCirrus
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...
- rahveeCirrus
My mistake. By default, all results *are* returned, and I only need to examine the `fullPath` property, as you said.
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