I’m not sure if I got correctly what the ratio is with the implementation of NETCONF in Confd. What I understood is that when a configuration is received, this is first validated using the YANG model, it is then written on the CDB (if valid) and only then it is handled via a subscription to the CDB.
In my case my configuration can contain a route to be added to a routing table.
I would add the route using my Python script, that has a subscription to the DB.
Is it possible, in case there is some error while adding the route, to make the DB roll back to the previous configuration? Plus, the transaction should not be acknowledged to the NETCONF client (I’m using NSO).
From what I saw, the Python subscription can only read configuration data and I cannot (?) use it for aborting the transaction when I have some error (even though there is the possibility to apply a lock to the DB while processing changes, I guess that is only to make sure the data is consistent during all my processing).
If I want to make some operation before the transaction is accepted I can use custom scripting using validation points in the YANG model. That would probably work, but it is not the intended use I guess? (that should only be intended for semantic validation).
Finally, are validation points the only way of executing some custom code before a transaction is validated or can I do it after the DB has been written a first time and then eventually roll back?
Thank you and sorry for the long question,