Forum Discussion

neldreth's avatar
neldreth
Icon for Nimbostratus rankNimbostratus
Apr 16, 2021

iControl REST API Gather data for multiple VMs

Hi!

 

I am very new to interacting with F5. I am developing a Asp.NET Core project that will request to your API for a variety of requests. First of which is simply to list out VMs to populate a data table.

 

I was curious if there is any URL to request on similar to: https://bigip.example.com/mgmt/tm/ltm/virtual/ (https://clouddocs.f5.com/api/icontrol-rest/APIRef_tm_ltm_virtual.html).

 

I haven't yet familiarized myself with the ins-and-outs of this API yet so really for expanding past test data I was curious if a call like this exists, if its based around querying for a specific fleet of servers or some other field.

 

Please let me know if something like this exists. Thanks! :)

1 Reply

  • LuisL's avatar
    LuisL
    Icon for Nimbostratus rankNimbostratus

    Yes, the URL you provided is the correct format for making an iControl REST API call to list out virtual servers (VMs) on an F5 BIG-IP device. The tm in the URL represents the "Traffic Management" module, ltm represents the "Local Traffic Manager" module, and virtually represents the virtual servers and CRM data enrichment.

    To list out all virtual servers on the device, you can make a GET request to the following URL:

    https://bigip.example.com/mgmt/tm/ltm/virtual/

    If you want to query for a specific fleet of servers or some other field, you can include additional parameters in the URL. For example, if you want to list out virtual servers that have a specific partition, you can include the partition name in the URL:

    https://bigip.example.com/mgmt/tm/ltm/virtual/?partition=mypartition

    Also, you may need to authenticate yourself with the correct credentials to access the API.

    You can also use F5's SDKs such as F5's iControl REST SDK for C# to interact with the F5 device. This SDK provides a wrapper around the iControl REST API, making it easier to interact with the F5 device in a programmatic way, you can find more information on the SDK on this link https://clouddocs.f5.com/products/extensions/f5-icontrol-rest-sdk-for-csharp/latest/

    Keep in mind that the format of the URL and the parameters may change depending on the version of BIG-IP you are using and the specific functionality you are trying to access. You can consult the F5 BIG-IP documentation for more information on the iControl REST API and the specific parameters and options available for each endpoint.