Can anyone please tell me. How can we know the snmp-oid of a leaf from a subscription function.
E.g.
leaf esModemRxFreq {
type esModemRxFreqType;
tailf:snmp-oid “1.3.6.1.4.1.119.2.3.69.501.4.2.1.4”;
}
This is one esModemRxFreq leaf. I want to get snmp-oid value in subscription. So, which cdb api will be useful to get this info.
These annotations are not available to the runtime code. You have following options instead:
copy it so that you can access it in the runtime, e.g. using tailf:meta-data or directly in your code - this is obviously acceptable only if you have just a few such leaves;
process the YANG module (in the compile time, presumably) so that you can access the data - transform it to YIN and extract from that, or write a pyang plugin that generates a C-struct or something that you can use in your code.