CESNET / netopeer2

NETCONF toolset
BSD 3-Clause "New" or "Revised" License
296 stars 187 forks source link

question about modifying configured subscriptions from stream to ietf-yang-push:datastore #1436

Closed jeremie6wind closed 9 months ago

jeremie6wind commented 1 year ago

Hi, In the context of configured subscriptions, how would you change a subscription from stream to ietf-yang-push:datastore? For clarity, let's have an example: First create a configured subscription with id 1 and with a 'stream' : 'NETCONF'. Then modify this configured subscription replacing the 'stream' by 'ietf-yang-push:datastore' :' ds:operational' and 'datastore-xpath-filter' : '/state/interface/physical/enabled'.

When iterating over sysrepo changes with sr_get_changes_iter(session, "/ietf-subscribed-notifications:subscriptions/subscription/*", &iter); sr_get_change_tree_next(session, iter, &op, &node, NULL, NULL, NULL)

There would be one 'delete' 'stream' and two 'create' with 'datastore' and 'datastore-xpath-filter'.

Would you delete the subscription completely and create a new one?

Best regards. Jeremie

michalvasko commented 1 year ago

It should not matter much how exactly you do it so I would choose the simpler approach. That, I assume, is removing the subscription and creating a new one.