I all. I am using set-hook inside a list as shown in the below code. But yang is not invoking the callback function. I am able to invoke the callback function using container. But I really don;t know why set-hook is not working in leaf-list.
Can someone please suggest how to invoke a callback function from leaf-list ?
leaf-list code, with set-hook not working:
list set_channel_reverse {
config true;
tailf:callpoint olt {
tailf:set-hook subtree;
}
key value;
leaf value {
type enumeration {
enum “Disable”;
enum “Enable”;
}
}
}
If you ommit one of the callbacks registration, it will be set to NULL.
For example if you only register the create and remove callbacks, the set_elem callback will be set to NULL and you won’t trigger your application code if you set a leaf under an already created list.
So make sur you have the set_elem callbacks registered as well.
For me for list callback is invoked but looks like I can’t have more than 1 leaf node. Since for other leaf nodes also it keeps showing the values fetched from the callpoint.
Btw setting mandatory=TRUE does the trick in the list calling the hook function. But not sure why its a must…