Hi All,
I'm exploring streaming telemetry on Cisco devices to receive operational state information. As appears, a telemetry message does not include a unit (byte, kb, etc) for the streamed value -
{
"name": "used-memory",
"uint64Value": "353673736"
}
To interpret the streamed value, we need to look into the YANG model (Cisco-IOS-XE-memory-oper.yang) to get unit information -
leaf used-memory {
type uint64;
units "bytes";
description
"Total used memory in the pool (bytes)";
}
So, I am looking for a YANG parser (in Java) that can help in reading a YANG model so that relevant information e.g. unit, description etc. can be retrieved for a Leaf statement. I explored OpenDayLight Java parser but could not find a way to read Leaf statements. (Python has pyang module that converts YANG model to YIN (kind of XML) but I need something in Java.)
So, my requirement is that given the encoding path from Telemetry message -
"encodingPath": "Cisco-IOS-XE-memory-oper:memory-statistics/memory-statistic"
Can I retrieve all the contained Leaf statements for the path? For the above encoding path, few of the Leaf statements are -
leaf name {
type string;
description
"The name of the memory pool";
}
leaf total-memory {
type uint64;
units "bytes";
description
"Total memory in the pool (bytes)";
}
leaf used-memory {
type uint64;
units "bytes";
description
"Total used memory in the pool (bytes)";
}
Please let me know if you have any pointer in this regard. Thanks.
-Deepak