[NETCONF-857] Export supported features to ietf-yang-library Created: 03/Feb/22  Updated: 22/Jan/24

Status: Confirmed
Project: netconf
Component/s: netconf
Affects Version/s: None
Fix Version/s: 7.0.0, 5.0.10, 6.0.7

Type: Improvement Priority: High
Reporter: Robert Varga Assignee: Peter Suna
Resolution: Unresolved Votes: 0
Labels: pick-next, pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
is blocked by NETCONF-909 Fix odl-yanglib feature usage Resolved
is blocked by NETCONF-910 Odl-yanglib fails to register provide... Resolved
is blocked by YANGTOOLS-1368 Do not build FeatureEffectiveStatemen... Resolved
Relates
relates to MDSAL-719 Take supported features into account Resolved

 Description   

Multiple netconf components deal with ietf-yang-library. Audit all of them and update them:

  1. when we are creating a view from EffectiveModelContext we need to examine FeatureEffectiveStatements (or FeatureDefinitions) present in a particular module to construct the list of supported features
  2. when we are creating an EffectiveModelContext, we need to pass down the set of supported features to the parser

The following need to be updated:

  1. org.opendaylight.netconf.mdsal.yang.library.YangLibraryWriter
  2. org.opendaylight.netconf.sal.connect.netconf.NetconfDevice (based on LibraryModulesSchemas)
  3. org.opendaylight.yanglib.impl.YangLibProvider (this might be a bit tricky, it seems it's doing multple things)


 Comments   
Comment by Oleksandr Zharov [ 04/Apr/22 ]

YangLibraryWriter is done and merged. Only other two left.

Comment by Peter Suna [ 25/Oct/22 ]

I found out that LibraryModulesSchemas is not working properly and contains several issues.

Wrong initialization of LIBRARY_CONTEXT constant could be fixed with this:
https://git.opendaylight.org/gerrit/c/netconf/+/102761/5

Wrong handling response from device could be fixed with this:
https://git.opendaylight.org/gerrit/c/netconf/+/102827/1

But the bigger problem is that the wrong RPC request is sent to the device. Instead of get RPC from ietf-netconf should be used get-data from ietf-netconf-nmda in LibraryModulesSchemas#create:
https://github.com/opendaylight/netconf/blob/9ab3c42bbf50e2a506f31f641548e06c0681f1e0/plugins/netconf-client-mdsal/src/main/java/org/opendaylight/netconf/client/mdsal/LibraryModulesSchemas.java#L166

YANG Library - https://www.rfc-editor.org/rfc/rfc8525

This version of the YANG library supports the Network Management Datastore
   Architecture (NMDA) by listing all datastores supported by a network
   management server and the schema that is used by each of these
   datastores.  

NETCONF Extensions to Support the NMDA https://www.rfc-editor.org/rfc/rfc8526

The update to RFC 6241
   adds new <get-data> and <edit-data> operations and augments existing
   <lock>, <unlock>, and <validate> operations.  The update to RFC 7950
   requires the usage of the YANG library (described in RFC 8525) by
   NETCONF servers implementing the NMDA.

So ietf-yang-library should be used with NMDA because data saved in ietf-yang-library model are visible only in operation data store.
https://www.rfc-editor.org/rfc/rfc8525#page-6

All data nodes in the "ietf-yang-library" module are "config
false" and thus only accessible in the operational state datastore.

Therefore, data from ietf-yang-library could be retrieved only with get-data which can specified target data-store.

Comment by Peter Suna [ 08/Nov/22 ]

I have added supported features to YangLibProvider. But these changes are not properly tested due to issues I have found.
https://jira.opendaylight.org/browse/NETCONF-910
https://jira.opendaylight.org/browse/NETCONF-909

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