Forum Discussion
Ed_Summers
May 25, 2017Nimbostratus
(YMMV depending on version. I'm using version 12.1.2.)
'monitor' is another collection with the various monitor types underneath it. If you just get the collection from 'monitor' you'll have a list of reference links to the sub-collections underneath it. One way of getting an actual list of monitors is to get the collection of the specific monitor type:
>>> https_monitors = mgmt.tm.ltm.monitor.https_s.get_collection()
>>> for mon in https_monitors:
... print(mon.name)
...
Reminder that since the monitor objects are collections, they'll end in 's', or '_s' if the resource already ends in 's'. Example: to get https monitors, use 'https_s'. To get http monitors, use 'https'.
Apologies if I've butchered SDK terminology on collections/sub-collections. I'm still getting used to the environment myself.