I want to display a table that can have only a single record. So basically, there is no specific key required. Please suggest an appropriate yang construct to achieve this.
I have a C structure similar to this to be displayed in a show command (show table details):
Hello Joseph,
Can you please also suggest how to populate the values of these leaves from the C application? Usually, we define a callpoint under list construct in the yang. How would we do this in this specific scenario?
you can have callpoint on the container too no problem.
quickest way is to just implement:
exists_optional() - existence check for container table node itself
get_elem() - pattern for leaves inside table as usually for any other leaves
(dont’f take check existence of leaf into account too, as it may not be guaranteed that exists_optional() will be invoked by ConfD before get_elem on insider leaves…)
If you have get_object() et.c callbacks, i think same rules apply as for list entries, you just won’t have the key value in request input keypath… (so some sort of array of xml-begin table, table values, xml-end table, etc.)