Forum Discussion
Mark_Stradling_
May 31, 2016Cirrus
F5 Python SDK - How to Get Profiles on a Virtual
I am using the F5 python SDK. It is awesome. Very useful. I am not, however, able to figure out how to access the subcollection of monitors attached to a virtual object. Any one have any idea how to ...
tatmotiv
Jun 01, 2016Cirrostratus
You need to take care about the following:
1.) In order to access a subcollection, you must first load the resource containing the subcollection.
2.) When the subcollection is named as plural (like in profiles), the according object for the request will need a suffix of "_s" appended to it.
Taking this into account, you could achieve what you want by doing the following:
session = BigIP('1.2.3.4', 'admin', 'password')
virtual = session.ltm.virtuals.virtual.load(partition='my_partition', name='my_virtual')
for profile in virtual.profiles_s.get_collection():
print(profile.name)
That would for example output a list of names of the profiles which are attached to that virtual.
HTH
Martin
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects