Forum Discussion
BIG-IQ REST - Is it possible to expandSubcollections=true
- Feb 12, 2025
Hi Ichnafi,
How many LTMs do you have reporting to BIGIQ.
It appears that the expandSubcollections=true parameter, which works on the BIG-IP API, does not function the same way on the BIG-IQ API. This parameter is intended to resolve references and provide detailed information, but it seems that BIG-IQ does not support this feature in the same manner.
Alternative Approach
To achieve your goal of obtaining a JSON representation of all configured virtual servers with their detailed configurations, you might need to make additional API calls to resolve the references manually. Here’s a step-by-step approach:
- Get the List of Virtual Servers:
- Make a request to get the list of all virtual servers.
- curl -sk -u admin:password "https://<BIG-IQ-IP>/mgmt/cm/adc-core/working-config/ltm/virtual"
- Iterate Over Each Virtual Server:
- For each virtual server, extract the reference links for pools, VLANs, etc.
- Make Additional API Calls:
- For each reference link, make an additional API call to retrieve the detailed information.
- curl -sk -u admin:password "https://<BIG-IQ-IP>/mgmt/cm/adc-core/working-config/ltm/pool/<pool-id>"
- Combine the Data:
- Combine the data from the initial virtual server list with the detailed information from the additional API calls to create a comprehensive JSON representation.
Example Script
Here’s a simplified example script in Python to illustrate the process:
import requests
import json
# BIG-IQ credentials and URL
bigiq_url = "https://<BIG-IQ-IP>/mgmt/cm/adc-core/working-config/ltm/virtual"
auth = ('admin', 'password')
# Get the list of virtual servers
response = requests.get(bigiq_url, auth=auth, verify=False)
virtual_servers = response.json().get('items', [])
# Function to get detailed information
def get_details(url):
response = requests.get(url, auth=auth, verify=False)
return response.json()
# Iterate over each virtual server and get detailed information
for vs in virtual_servers:
vs_id = vs['id']
vs_details_url = f"{bigiq_url}/{vs_id}"
vs_details = get_details(vs_details_url)
# Get pool details if available
if 'poolReference' in vs_details:
pool_url = vs_details['poolReference']['link']
pool_details = get_details(pool_url)
vs_details['poolDetails'] = pool_details
# Add more details as needed (e.g., VLANs, profiles)
# ...
# Print or store the detailed virtual server information
print(json.dumps(vs_details, indent=2))
# Note: You may need adjustments for your specific use case.
This approach ensures you get a comprehensive JSON representation of all configured virtual servers with their detailed configurations.
Let me know for additional help if you want to extract the list of all the F5 LTM VIPs config , in BASH mode on each LTM you can run this commands to obtain list of all the VIPs on all partition on a Particular LTM:
tmsh -q -c "cd / ; show ltm virtual recursive all-properties detail" | grep -i -e 'LTM\|Destination'
Kindly rate
HTH
F5 Design Engineer
This looks promising.
Main Problem stays: No easy format to parse. Oh well...what would we do if things were easy 😄
I never the less mark your 1st answer es solution, because my question was about expandSubcollections in Big-IQ and this is sadly not implemented.
Cheers
Ichnafi
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