For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

mcomardici's avatar
mcomardici
Icon for Nimbostratus rankNimbostratus
Oct 08, 2025

expandsSubcollections and filtering in F5 SDK

Hello,

 

I need to use the F5 BIGIP SDK to pull all the firewall policies from a partition along with their respective expanded rules. I wrote the following code:

policies = f5_manager.mgmt.tm.security.firewall.policy_s.get_collection(
        requests_params={
            "params": f"$filter=partition eq {partition_name}&expandSubcollections=true"
        },
    )

If i only want to use expandSubcollections=true or only the filter it works as expected. However, when I try to combine them it doesn't expand the results anymore. Has anyone encountered this before?

Thanks!

2 Replies

  • Hello mcomardici​

    I noticed your post has been up for a bit with no responses and wanted to check if you had already found an answer? If you have please update your post with the information. However, if you have not please let me know and I will help find a resource to help you out. 

    -Melissa 

    • mcomardici's avatar
      mcomardici
      Icon for Nimbostratus rankNimbostratus

      Hi,
      No, I didn't find a solution to make this work in a single API call. What I did is pull all the data from all the partitions with the expanded fields and filter by partition afterwards using Python. This is suboptimal but it will work until I find a solution to this. Thanks!