Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also support RFC 8525, YANG Library, revision 2019-01-04 #144

Open
kwatsen opened this issue Jan 11, 2025 · 2 comments
Open

Also support RFC 8525, YANG Library, revision 2019-01-04 #144

kwatsen opened this issue Jan 11, 2025 · 2 comments

Comments

@kwatsen
Copy link
Contributor

kwatsen commented Jan 11, 2025

Description

Yangson currently supports the original RFC 7895, YANG Library, revision 2016-06-21.

This can be seen by grep-ing for the string "RFC7895" on these two pages:

The string may appear on other pages too. These two listed pages are only the ones that come to my mind ;)

The ask is for Yangson to also support RFC 8525.

How to Identify which YL is Provided

Two ideas:

  1. use an additional parameter/flag to indicate the YL's revision
  2. auto-sense the YL-revision (i.e., is "modules-state" than 7895, else 8525)

How to Identify which Datastore is Use

This assumes that each datastore can be supported by an instance of yangson.DataModel.

Only one idea:

  1. use an additional parameter/flag to indicate the datastore

Context

My RESTCONF server wishes to implement NMDA, in order to support the datastore described in draft-ietf-netmod-system-config, in order to support multi-tenancy (i.e., the 'host' system can share stuff with 'tenant' systems, that appear as data to the tenants.

Doing this with existing Yangson is a little awkward as my server MUST return RFC 8525 YL to clients, per RFC 8527, Section 2, and yet it doesn't consume that format itself. My code must maintain distinct instances of both YL revisions.

@llhotka
Copy link
Member

llhotka commented Jan 13, 2025

I actually addressed this issue last week by a note in the documentation. The thing is that the 8525 format adds some complications, as you discuss above. I was thinking that the data model doesn't change that often so that an offline conversion utility might suffice. Could convert8525 help you?

@kwatsen
Copy link
Contributor Author

kwatsen commented Jan 13, 2025

Laugh. I wrote a similar thing yesterday. Now my Python code natively uses 8525 everywhere, and JIT-converts to 7895 just before calling DataModel(). That said, having convert8525 on the command line will help some of my command-line tests using Yangson to work too, so thank you for that!

Still, I wish Yangson had more native support....

FWIW, yanglint supports 8525-formated YL on the command line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants