libnetconf2 icon indicating copy to clipboard operation
libnetconf2 copied to clipboard

Is there is a way to build the XML tree ( filter tree) from yang models to pass as paramter to getdata

Open gvpbalaji opened this issue 4 years ago • 1 comments

Hi , i am new to libyang and libnetconf library.
my requirement is to build the XML filter (XML subtree) from given yang module and provide that as input to nc_rpc_getdata . I have gone through the available examples, but unable to find suitable example. My requirement description as below: user will request to fetch the data from server by providing the leaf reference name ( element name) and Yang module . my app has to build the XML filter tree and has to fetch the data from server by passing XML tree filter to nc_rpc_getdata .

Could you please any one suggest, suitable APIs that has to be used or suitable example that i can refer.

Thanks In advance for the help.

gvpbalaji avatar Nov 15 '21 11:11 gvpbalaji

Well, you will have to do most of the work yourself. I would start by finding the appropriate struct lysc_node in struct lys_module, preferably using some API function such as lys_find_path. Once you have it, manually build the XML for the node and its parents.

michalvasko avatar Nov 22 '21 09:11 michalvasko