Closed gotthardp closed 2 years ago
Hi.
You're right, sr_oper_delete_item_str
has not been wrapped yet.
I believe the Session::deleteItem should either call sr_session_get_ds to check the datastore and call sr_oper_delete_item_str in case of an operational store, or there should be another method for deleting items from the operational store, right? The first option may be more user-friendly, the second just wraps whatever sysrepo offers.
I think sysrepo (oper DS) API is confusing enough, so I'll just go with the second approach. The patch can be found here https://gerrit.cesnet.cz/c/CzechLight/sysrepo-cpp/+/5590, There is a test that shows the usage of the method. Let me know, if you have any more questions.
The sysrepo documentation says the
sr_delete_item
cannot be used for the operational store-- thesr_oper_delete_item_str
should be used instead. TheSession::deleteItem
doesn't say that, which could suggest it can be used for any store, but I didn't find thesr_oper_delete_item_str
in the implementation. I believe theSession::deleteItem
should either callsr_session_get_ds
to check the datastore and callsr_oper_delete_item_str
in case of an operational store, or there should be another method for deleting items from the operational store, right? The first option may be more user-friendly, the second just wraps whatever sysrepo offers.