-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit YANG instance using NETCONF operations #24
Comments
Hi, I am not sure libyang is suitable for this. Maybe you should have a look at sysrepo (or sysrepo-python). |
Would need to explore more deeply on what's possible using libyang2. As there is a method to "merge" data instances, it would be an obvious requirement to do "replace", "remove", "create" and "replace" to modify data instances (dnode). This would be useful to implement dryrun/preview as with Ansible. |
In that case, maybe you are looking for lyd_diff() https://github.com/CESNET/libyang/blob/libyang1/src/tree_data.h#L415 |
Hi @rjarry So the idea is, that you can retrieve the current device config, apply the change and look what would be different. |
This needs to be supported by libyang itself. I do not think we will implement this only in the python bindings. If you need it you can submit a pull request on libyang. Note that the python bindings are incomplete and lyd_diff is not yet supported. |
@rjarry... Let me review what is available in libyang2 first. I guess, that editing data instances is sort of a basic requirement for an advanced YANG engine like libyang. Converting dnodes to native XML, JSON or dict to modify and converting it back to XML, JSON or dict thereafter does not sound like a good approach at all. Also editing XML, JSON or dict is sort of tricky because of the way that lists are converted - so access by key(s) requires quite some extra code. |
Hi @wisotzky , do you still need that? If you need NETCONF, isn't ncclient (for instance) more suited to your needs? |
At the moment, NETCONF operations are carried but are not functional. It would be useful, to dry-run an
edit-config
operation that uses thenc:operation
as defined.The text was updated successfully, but these errors were encountered: