I am integrating with a well-known Netconf server implementation. That server supplies XPath strings to my code when an action is taken in the module/subtree of interest to indicate what was changed. I would like to use that XPath string to find the corresponding method in my pyangbind-generated module and then take appropriate action based on the action inidicated by the NC server.
For example, if the NC server indicates that the client added a node, then it would give me a structure sort of like: {'xpath': '/module:container/list[key='keyvalue']/leaf', action: 'create', value: 'somevalue'}, or {'xpath': '/module:container/list[key='keyvalue']/leaf', action: 'modify', value: 'somenewvalue'}, or {'xpath': '/module:container/list[key='keyvalue']/leaf', action: 'delete'}, or even {'xpath': '/module:container/list[key='keyvalue']', action: 'delete'}
I see in the documentation that XPathHelper allows the user to get values based on a supplied XPath, but could it (and how) provide a way to modify/create/delete nodes in the tree based on the supplied XPath?
I am integrating with a well-known Netconf server implementation. That server supplies XPath strings to my code when an action is taken in the module/subtree of interest to indicate what was changed. I would like to use that XPath string to find the corresponding method in my pyangbind-generated module and then take appropriate action based on the action inidicated by the NC server.
For example, if the NC server indicates that the client added a node, then it would give me a structure sort of like: {'xpath': '/module:container/list[key='keyvalue']/leaf', action: 'create', value: 'somevalue'}, or {'xpath': '/module:container/list[key='keyvalue']/leaf', action: 'modify', value: 'somenewvalue'}, or {'xpath': '/module:container/list[key='keyvalue']/leaf', action: 'delete'}, or even {'xpath': '/module:container/list[key='keyvalue']', action: 'delete'}
I see in the documentation that XPathHelper allows the user to get values based on a supplied XPath, but could it (and how) provide a way to modify/create/delete nodes in the tree based on the supplied XPath?
Thanks