Hi Team,
My Yang file:
container computers {
list device-list {
key "keyboardinfo";
leaf keyboardinfo {
type string;
}
leaf monitor;
leaf printer;
}
}
I have key leaf “keyboardinfo” datum in a list like below,
keyboard1-1/keyboard1
keyboard1-1/keyboard2
keyboard2-1/keyboard1
keyboard2-2/keyboard2
I need to filter based on the “keyboard1” or "keyboard2"string.
In get_schema api, I am trying to get the complete shema of computers and filtering is done in keypath based on regexp like below,
getSchema(th, '', '/computers:computer/computers:devices-list', 1, false).done(function(schema)
keypath : '/computers:computer/computers:devices-list[contains(resource,"/keyboard1")]';
But “/keyboard1
” is unable to filter. Error is invalid key path. Because / is taken as another keypath parser.
But If I give,
keypath : '/computers:computer/computers:devices-list[contains(resource,"keyboard1")]';
I am able to get the result as,
keyboard1-1/keyboard1
keyboard1-1/keyboard2
keyboard2-1/keyboard1
But my intention to retieve the output as,
keyboard1-1/keyboard1
keyboard2-1/keyboard1
Please provide your valuable suggestion on this.
Thanks,
Shanthini