Moquery - return a "parent" object if a "child" object meets criteria
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2021 10:11 AM - edited 02-05-2021 10:25 AM
Hello all,
I'm trying to figure out if there is a way to return a "parent" object if a "child" object meets certain criteria, or basically, query the "parent" object in terms of the properties of the "children." I hope I'm making sense LOL
For example, the fvCEp class is a parent of the fvRsCEpToPathEp class. What I would like to do is return the fvCEp class if the child fvRsCEpToPathEp class has a tDn property that contains "eth1/14".
I have tried these commands, but they only return the "child" class fvRsCEpToPathEp :
moquery -c fv.CEp -x query-target=subtree rsp-subtree=full -f 'fv.RsCEpToPathEp.tDn*"eth1/14"'
moquery -c fv.CEp -x query-target=subtree target-subtree-class=fvRsCEpToPathEp rsp-subtree=full -f 'fv.RsCEpToPathEp.tDn*"eth1/14"'
I am wanting a command that can query the child class fvRsCEpToPathEp and return the corresponding "parent" class fvCEp. Or in other words, query the "parent" fvCEp class in terms of the properties of its "child" class fvRsCEpToPathEp.
Any ideas?
- Labels:
-
APIC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2021 11:39 PM
Hi
I agree doing a query-filter on a child-Mo using query-target=subtree and rsp-subtree=full SHOULD return the full tree including the parent itself. As far as I know such queries always returned just the child-MOs (I tested this in multiple releases). I'm not sure if this works as designed or if this is some kind of wrong behavior.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2021 02:20 PM
Thanks for your reply @Marcel Zehnder , and I agree, it would be nice if the parent was included with certain arguments in a moquery search. It would make reverse searches much easier! I'll hold out and see if anyone has a potential solution for this. Thanks again!
