netopeer2 icon indicating copy to clipboard operation
netopeer2 copied to clipboard

netconf-config-change provides <edit> entries for all child elements of a list

Open pramodak opened this issue 3 years ago • 1 comments

Following notification is sent to a subscriber when a list entry is added and the blocks contain the different nodes added till the leaf level.

<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2021-12-27T04:37:06Z</eventTime>
  <netconf-config-change xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-notifications">
    <changed-by>
      <username/>      
      <session-id>5</session-id>
    </changed-by>
    <datastore>running</datastore>
    <edit>
      <target xmlns:mestd="urn:std:sa5:_std-common-managed-element" xmlns:gnbdustd="urn:std:sa5:_std-nr-nrm-du" xmlns:gnbduorg="urn:org:_org-nr-nrm-du">/mestd:ManagedElement[mestd:id='101']/gnbdustd:du[gnbdustd:id='301']/gnbduorg:tconf/gnbduorg:ep[gnbduorg:id='2']</target>
      <operation>create</operation>
    </edit>
    <edit>
      <target xmlns:mestd="urn:std:sa5:_std-common-managed-element" xmlns:gnbdustd="urn:std:sa5:_std-nr-nrm-du" xmlns:gnbduorg="urn:org:_org-nr-nrm-du">/mestd:ManagedElement[mestd:id='101']/gnbdustd:du[gnbdustd:id='301']/gnbduorg:tconf/gnbduorg:ep[gnbduorg:id='2']/gnbduorg:id</target>
      <operation>create</operation>
    </edit>
    <edit>
      <target xmlns:mestd="urn:std:sa5:_std-common-managed-element" xmlns:gnbdustd="urn:std:sa5:_std-nr-nrm-du" xmlns:gnbduorg="urn:org:_org-nr-nrm-du">/mestd:ManagedElement[mestd:id='101']/gnbdustd:du[gnbdustd:id='301']/gnbduorg:tconf/gnbduorg:ep[gnbduorg:id='2']/gnbduorg:attributes</target>
      <operation>create</operation>
    </edit>
    <edit>
      <target xmlns:mestd="urn:std:sa5:_std-common-managed-element" xmlns:gnbdustd="urn:std:sa5:_std-nr-nrm-du" xmlns:gnbduorg="urn:org:_org-nr-nrm-du">/mestd:ManagedElement[mestd:id='101']/gnbdustd:du[gnbdustd:id='301']/gnbduorg:tconf/gnbduorg:ep[gnbduorg:id='2']/gnbduorg:attributes/gnbduorg:userLabel</target>
      <operation>create</operation>
    </edit>
  </netconf-config-change>
</notification>

Is there any configuration that can be done in Netopeer2 to only provide the top-level node that is added? In this case it should look like the below one.

<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2021-12-27T04:37:06Z</eventTime>
  <netconf-config-change xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-notifications">
    <changed-by>
      <username/>      
      <session-id>5</session-id>
    </changed-by>
    <datastore>running</datastore>
    <edit>
      <target xmlns:mestd="urn:std:sa5:_std-common-managed-element" xmlns:gnbdustd="urn:std:sa5:_std-nr-nrm-du" xmlns:gnbduorg="urn:org:_org-nr-nrm-du">/mestd:ManagedElement[mestd:id='101']/gnbdustd:du[gnbdustd:id='301']/gnbduorg:tconf/gnbduorg:ep[gnbduorg:id='2']</target>
      <operation>create</operation>
    </edit>
  </netconf-config-change>
</notification>

Some of the other NETCONF implementations (e.g. ConfD basic) give only the top-level notification. I could not find any flag switch that can be used to change this behaviour in https://datatracker.ietf.org/doc/html/rfc6470

pramodak avatar Dec 27 '21 05:12 pramodak

I believe this is simply a matter of interpretation of the meaning of the parameters in the notification. From the YANG module

An edit record SHOULD be present for each distinct
edit operation that the server has detected on
the target datastore.

Based on that I would say the notification we generate is simply more accurate (each reported edit is a distinct operation) but since it is not strictly required, both are correct.

michalvasko avatar Jan 03 '22 12:01 michalvasko