[NETCONF-745] Device Notification Created: 29/Nov/20  Updated: 06/Feb/23  Resolved: 11/Jan/23

Status: Resolved
Project: netconf
Component/s: restconf-nb
Affects Version/s: None
Fix Version/s: 5.0.0

Type: New Feature Priority: Medium
Reporter: Nikhil Soni Assignee: Nikhil Soni
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot from 2022-08-22 22-43-17.png    
Issue Links:
Relates
relates to NETCONF-907 Resubscribe Device Notification when ... Open
relates to NETCONF-908 Add Kafka producer to send Device not... Open

 Description   

HTTP client should be able to get Device notification after subscription.
**

Implementation Details -
prerequisite - Notification stream should be enable in device. .

1. Added a new Device Notification Yang for Rest request which takes
input of Device mount point path
2. Added a DeviceNotificationListenerAdaptor which is get registered
in Device Notification server (on Mount point)
3. Created a dynamic Rest Notification SSE HTTP rest url (Response of 1st rest
call )
4. Updated Test tool for Notification

Sample -
1. Enable notification in device -
Post - /rests/operations/network-topology:network-topology/topology=topology-netconf/node=device_ios/yang-ext:mount/notifications:create-subscription
payload: 
{
  "input":

{     "stream": "NETCONF"   }

}

2. Create functionality to add/ register a listener in Netconf module for particular mount point of device 
Rest call -

POST - /rests/operations/odl-device-notification:subscribe-device-notification
Payload -
{
"input":

{ "path":"/network-topology:network-topology/topology[topology-id='topology-netconf']/node[node-id='device']" }

}

Response -
{
"odl-device-notification:output":

{ "stream-path": "http://localhost:8181/rests/notif/device_ios?notificationType=device" }

}
3. Add functionality for above rest call to start SSE Http connection to receive device notification for given mount point 



 Comments   
Comment by Nikhil Soni [ 26/May/22 ]

Observations -

1. We can execute RPC create subscription from Restconf to Device which enables Notification in Device
2. After 1st point device ( odl netconf test tool) starts sending notifications
3. Notifications can be seen in ODL logs

There is no restconf api where user can subscribe ( technically register notification listener on device mount point)

Solution- we may required to augment of exiting Yang and need to update restconf code to support this functionality

Comment by Kowsalya Saravanan [ 23/Aug/22 ]

Hi Nikhil,

I'm testing this feature, after subscription I'm getting the stream path.

http://localhost:8181/rests/notif/network-topology:network-topology/topology=topology-netconf/node=testtool1/yang-ext:mount

but I'm not getting any notifications from the device. Did i miss any configuration. Please find the screenshot for the msg available in the sse http link.

I have tested in both confd and testtool. In both I'm getting the ":  ping" msg only.

Please help me to test this feature.

Generated at Wed Feb 07 20:15:47 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.