I am reading about CONFD_SET_TAG_XXX() macros in the ConfD user guide. I have a few questions.
When I use a CONFD_SET_TAG_XXX() macro, does the tag value get set and stored in CDB?
When I set many different tag values using CONFD_SET_TAG_XXX() and define my oper YANG, how does ConfD map the leaf nodes in the YANG with the tag names? Does it just follow the order of leaf nodes in the YANG?
I think there are few misconceptions here. The macros CONFD_SET_TAG_XXX are used typically when you are writing a data provider that implements bulk methods and you want to response with s.c. tagged value array. The macros don’t do any magic, they just help you with filling the response array; in particular they do not touch CDB at all.
The point of using tagged value arrays is that you do not have to follow the schema order - you fill only those leaves that should be reported as present and ignore the rest; since the values filled in are accompanied by tags (in effect by leaf/node names), ConfD is then able to map values to YANG leaves.
Again: the macro is of any use only if you want/need to use the type confd_tag_value_t, which you need only if you are implementing data provider bulk methods or dealing with RPCs/actions.
Agreed on everything else, but there are actually a few more cases that use confd_tag_value_t arrays, notably the cdb_set_values() and maapi_set_values() functions (and corresponding xxx_get_values()), one of which @arun88 is perhaps using. Also RPC/action invocation via MAAPI, as well as sending of NETCONF a.k.a. “stream” notifications (via the data provider API).