BIG-IP : iControl API retrieve device-groups and members

F5 BIG-IP Virtual Edition v11.4.1 (Build 635.0) LTM on ESXi

Does iControl API provide methods to retrieve the following info :

-- list of device-groups a device belongs to ?

Main > Device Management > Device Groups > Device Group List

-- device-group members

Properties > Members

Please note that Management.DeviceGroup class constructor doesn’t take any args – so how to specify the hostname/ip ?

In other iControl classes ( such as System.ConfigSync ) the constructor accepts args ( hostname, username, password, timeout ) that are used to connect to the BIG-IP device for all of the class member methods.

curl -sk -u 'admin:admin'  https://mgmt-ip/mgmt/tm/cm/device-group/~Common~myDeviceGroup/devices | python -m json.tool

Tested in 11.5.1. I think won’t work with 11.4.0.

curl -sk -u 'admin:admin'  https://mgmt-ip/mgmt/tm/cm/device-group/~Common~myDeviceGroup/devices | python -m json.tool

Tested in 11.5.1. I think won’t work with 11.4.0.

Thanks kunjan but I am need a programmatic solution via iControl API

Thanks kunjan but I am need a programmatic solution via iControl API

Have you looked here in the icontrol wiki?

DevCentral - An F5 Technical Community DevCentral - An F5 Technical Community

Thanks Tim K. But those methods assume Device Group names are known. First, I need to retrieve the names of the Device Groups that a device belongs to.

get_list does that

get_list() does not take any args -- how to specify the BIG-IP device for which I am retrieving device-groups ?

The iControl call is directed to a specific F5 device (by host name or the IP address). This is how you specify the BIG-IP device for the get_list() call.

Thanks Greg. Ok but how to direct the call to Management.DeviceGroup.get_list() to a specific device ?