Город МОСКОВСКИЙ
02:38:20

yangson – Python library to inspect YANG models | stream 2020/05/03

Аватар
Python: новая эра в разработке
Просмотры:
20
Дата загрузки:
02.12.2023 21:00
Длительность:
02:38:20
Категория:
Технологии и интернет

Описание

On this stream I was exploring yangson Python library which allows you to inspect YANG models in Python code. It also provides an ability to load your data and validate it against the YANG models.
I think the concept is interesting, but I had a hard time making it work with real models.
After the stream I did some investigation of the issues I encountered.
1. It seems that backslash usage in some YANG models is not RFC compliant. I've checked YANG models for IOS-XE 16.12.1 and 17.1+ and it seems devs got rid of backslashes. On the stream I was using 16.11.1 models
2. I couldn't load data for openconfig yang model, it was breaking on leafrefs. David Barroso helped me with this and apparently if leafref is used, you need to provide associated data (e.g. besides openconfig-lldp data, you also need to provide openconfig-interfaces data) to pass validation. In the future I would like to see an option for more-relaxed validation skipping leafrefs.
The real question is if it is worth using? And unfortunately I don't have a good answer. It is an interesting and helpful library, but making it work with your models could be a lot of work. Is client-side validation of YANG data THAT important?

Timecode:
0:00 – Introduction
1:50 – Checking if latest virtualenv is faster than venv
10:30 – My thoughts about YANG and ecosystem, what I expect from yangson
29:05 – Demo of some my stuff which achieves config change idempotency with NETCONF/YANG
40:15 – Setting up the environment to play with yangson
51:15 – Going through yangson tutorial
1:02:00 –Applying tutorial to load openconfig-lldp YANG model, troubleshooting issues
2:05:00 – Validating data against YANG model
2:31:20 – Conclusions, summary and wrap-up of the stream

Resources:
yangson docs: https://yangson.labs.nic.cz/

Please note that this content is stream-first and it is slow-paced by design. I recommend increasing playback speed in the player settings.
Don't miss my upcoming streams at https://twitch.tv/dmfigol

The code is on my GitHub: https://github.com/dmfigol/netwarden
Twitter: https://twitter.com/dmfigol
Blog: https://dmfigol.me

Background music (royalty-free):
https://www.pretzel.rocks/

Рекомендуемые видео