cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
638
Views
0
Helpful
0
Replies
ajbharad
Cisco Employee

Python Code for Confd`s netconf_notification example

I am trying to implement the Confd`s netconf_notification example code in Python. 

I am getting error when I call send_notification : 

<<<<<<<<<<<<<<<<<

<ERR> 9-May-2019::11:00:40.069 ajbharad ncs[27244]: devel-c Failed to send notification for stream interface: /linkDown: not_found: No default namespace has been defined.

>>>>>>>>>>>>>>>>>

 

I translated the below code in C :

<<<<<<<<<<<<<<<<<<

static void send_notifdown(int index)
{
confd_tag_value_t vals[3];
int i = 0;

CONFD_SET_TAG_XMLBEGIN(&vals[i], notif_linkDown, notif__ns); i++;
CONFD_SET_TAG_UINT32(&vals[i], notif_ifIndex, index); i++;
CONFD_SET_TAG_XMLEND(&vals[i], notif_linkDown, notif__ns); i++;
send_notification(vals, i);
}

>>>>>>>>>>>>>>>>>>

 

In Python : 

<<<<<<<<<<<<<<<<<<<

vals = []
vals.append(_ncs.TagValue(tag=740290268, ns=1945824463))
vals.append(_ncs.TagValue(xmltag = _ncs.XmlTag(1945824463, 1909855274), v=_ncs.Value(128, _ncs.C_UINT32)))

dateTime = _ncs.DateTime(2017, 5, 5, 1, 1, 1, 1, 0, 0)

dp.notification_send(nctx, dateTime, vals)

>>>>>>>>>>>>>>>>>>>

0 REPLIES 0