cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

334
Views
0
Helpful
2
Replies
vv0bbLeS
Beginner

Moquery - return a "parent" object if a "child" object meets criteria

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?

 

 

0xD2A6762E
2 REPLIES 2
Marcel Zehnder
Participant

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. 

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!

0xD2A6762E
Content for Community-Ad
This widget could not be displayed.