Forum Discussion
Mark_Stradling_
Jun 01, 2016Cirrus
Thanks for your reply. I've read through the documentation, and I've done the same for things like pool members and other subcollections, but profiles seem different. The virtual object does not have an attribute "profiles." It does, however, have an attribute called "profilesReference". I cannot enumerate it though. Here is the output i get when I try to enumerate it:
virt = srcf5.tm.ltm.virtuals.virtual.load(partition="Common", name="my.virt.com")
for profile in virt.profilesReferences.get_collection():
print profile.name
`
(I also tried profilesReference_s, profilesReferences, and profilesReference just in case)
results in:
`Traceback (most recent call last):
File "./profiles.py", line 31, in <module>
for profile in virt.profilesReference.get_collection():
AttributeError: 'dict' object has no attribute 'get_collection'</module>
`
If I just try to print the profilesReference attribute I get a self link to the object which I suppose I could craft my own rest request to utilize. I was just hoping the f5 sdk would be able to handle the profile subcollection like it does pool members
`{u'isSubcollection': True, u'link': u'https://localhost/mgmt/tm/ltm/virtual/~Common~my.virt.com/profiles?ver=11.6.0'}
- tatmotivJun 02, 2016CirrostratusRE: The virtual object does not have an attribute "profiles." You are right, but that's what I already mentioned. It does have a "Profiles_s" subcollection class though, as you also can see here: https://github.com/F5Networks/f5-common-python/blob/0.1/f5/bigip/tm/ltm/virtual.py The code snippet I provided above works for me. It outputs a list of profile names. I'm using f5-Python SDK version 0.1