Forum Discussion

Ichnafi's avatar
Ichnafi
Icon for Cirrostratus rankCirrostratus
Feb 12, 2025
Solved

BIG-IQ REST - Is it possible to expandSubcollections=true

Hi, I try to get a List of all virtual servers with all of their configurer objects from out BIG-IQ. A request on https:///mgmt/cm/adc-core/working-config/ltm/virtual will give me a list of all v...
  • F5_Design_Engineer's avatar
    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:

    1. Get the List of Virtual Servers:
      • Make a request to get the list of all virtual servers.
    2.  curl -sk -u admin:password "https://<BIG-IQ-IP>/mgmt/cm/adc-core/working-config/ltm/virtual"
    3. Iterate Over Each Virtual Server:
      • For each virtual server, extract the reference links for pools, VLANs, etc.
    4. Make Additional API Calls:
      • For each reference link, make an additional API call to retrieve the detailed information.
    5.  curl -sk -u admin:password "https://<BIG-IQ-IP>/mgmt/cm/adc-core/working-config/ltm/pool/<pool-id>"
    6. 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