How to get the yang type from maapi

Hey Everyone,

Am looking for an API to discover the yang data type for a key path pointing to a specific leaf
so that I can determine which type specific get function to call ,like maapi_get_ipv4_elem, maapi_get_u_int8_elem

~ascesh

In order to find the data type of a leaf node dynamically at runtime, you will need to use the schema information as described in the “USING SCHEMA INFORMATION” section of confd_types(3) in the ConfD man-pages. A tree representation of the data model is available through the schema information, which contains a struct confd_cs_node for every node in the data model.

You can also refer to a previous posting that is related to working with the confd_cs_node structure to find its data type for more information.

1 Like