Hi,
I have a list as below. I would like to send a notification from a list.
I need help in implementing the same.
It will be helpful if you have any sample example.
grouping tx-array-notification-group {
description
"Grouping for tx-array for notification";
list tx-array-carriers{
key name;
description "notification of state change for tx-array-carriers";
leaf name{
type leafref{
path "/user-plane-configuration/tx-array-carriers/name";
}
description
"name of tx-array-carriers is notified at state change";
}
leaf state{
type leafref{
path "/user-plane-configuration/tx-array-carriers/state";
}
description
"state of tx-array-carriers is notified at state change";
}
}
}
Implemented as below:
cfgTxCarrier is number nodes present in list.
int j=0;
for(i=0;i<cfgTxCarrier;i++)
{
getdatetime(&eventTime);
CONFD_SET_TAG_XMLBEGIN(&val[j],o_ran_uplane_conf_tx_array_carriers_state_change,o_ran_uplane_conf__ns);
j++;
CONFD_SET_TAG_STR(&val[j],o_ran_uplane_conf_name,"INACTIVE");
j++;
CONFD_SET_TAG_ENUM_VALUE(&val[j],o_ran_uplane_conf_state,0);
j++;
CONFD_SET_TAG_XMLEND(&val[j],o_ran_uplane_conf_tx_array_carriers_state_change, o_ran_uplane_conf__ns);
j++;
int status = confd_notification_send(notifctx, &eventTime, val, j);
if (status != CONFD_OK) {
errorLog("UPLANE: Tx Carrier state-change Notification fail - status = %d %s", status,
confd_lasterr());
}
}
}
Hi cohult,
Thanks a lot for your reply.
I have modified as per example.
getdatetime(&eventTime);
CONFD_SET_TAG_XMLBEGIN(val[j],o_ran_uplane_conf_tx_array_carriers_state_change,o_ran_uplane_conf__ns);
j++;
CONFD_SET_TAG_XMLBEGIN(&val[j],o_ran_uplane_conf_tx_array_carrier,o_ran_uplane_conf__ns);
j++;
CONFD_SET_TAG_STR(&val[j],o_ran_uplane_conf_name,TxArrayCarrier[0].TxCarrierKey);
j++;
CONFD_SET_TAG_ENUM_VALUE(&val[j],o_ran_uplane_conf_state,0);
j++;
CONFD_SET_TAG_XMLEND(&val[j],o_ran_uplane_conf_tx_array_carrier, o_ran_uplane_conf__ns);
j++;
CONFD_SET_TAG_XMLEND(&val[j],o_ran_uplane_conf_tx_array_carriers_state_change, o_ran_uplane_conf__ns);
j++;
int status = confd_notification_send(notifctx, &eventTime, val, j);
If (status != CONFD_OK) {
errorLog("UPLANE: Tx Carrier state-change Notification fail - status = %d %s", status, confd_lasterr());
}
The main difference i notice between the example and my requirement is :
the notification leaf nodes are referencing to list.
will there any implementation change?
Currently on client i am not getting as expected output.On client, I am getting all the list present in yang file without value.
If you can figure out my mistake then it will be really helpful.
[biswajit@krikkit confd]$ ~buildtools/confd/7.3/x86_64/bin/netconf-console-tcp --host=10.21.10.234 -port=2023 -s all notification.xml