sysrepo / sysrepo

YANG-based configuration and operational state data store for Unix/Linux applications

Home Page:http://www.sysrepo.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Detecting subscription expiration

maxrossello opened this issue · comments

Hi Michal,
I am wondering what could be the proper way to register for a subscription stop time reached.

When a client subscribes to e.g. /o-ran-supervision:supervision-notification with start and stop time, it receives /notification:replayComplete and then /notification:notificationComplete.

My wish would be to register, from plugin, to /o-ran-supervision:supervision-notification and have my callback called with SR_EV_NOTIF_STOP_TIME, but I only receive SR_EV_NOTIF_REALTIME. Maybe because the replay and stop notifications pertain to the specific client session only and, actually, it would be hard to understand in the callback which netconf session they may be related to.

The only option I see so far is to keep my own timer set after the stop time seen at subscription time. Is there any other possibility which I can't see?

Thanks a lot!

Yes, this is not directly supported and you will not be informed about random subscription end. One possible way to learn this would be to check sysrepo-monitoring data and the subscription will disappear after it ends. However, you would have to periodically retrieve these data and check the existence of the subscription, there is no push mechanism for this.

Thanks for the very quick answer!