oopt-gnpy
oopt-gnpy copied to clipboard
yaml equipment input
why not using a yaml instead of a json file for the equipment definition?
- unlike the network file, the equipment file is meant to be human readable and maintained.
- from a code and modelling point of view yaml is equivalent to json, for example pyaml library will easily handle it and convert to a dictionary structure.
- yaml is already the standard for platforms configuration (Ansible, Openstack, Docker, Kubernetes...)
- Also, have a look to Munch in order to ease the intricated dict calling in the existing code. This is also largely used when dealing with complex yaml inputs.
And keep up the good work! All the best
Hi Jean-Luc, interesting suggestion, thanks. Right now I'm planning to go with something where we can check the validity of the input data against a YANG model. That will simplify our code and make the input data validaiton more robust as well. Given that there are standard mappings of YANG-formatted data to XML and JSON, but none to YAML, I think that it's better to stick with something which only follows a standard set of data formats. (Yes, I know that one can convert JSON to YAML, but YAML has other stuff such as references.) So, yes, we could just take YAML, convert it to JSON and feed that input into a YANG validator, but I do not see many benefits in doing that compared to just JSON.
Would it be possible to discuss this topic during a call before closing it ?
Sure, we can discuss this tomorrow. It's just that I understood we were pretty much committed to YANG+JSON for a long time, with code being available since July IIRC, and that I never heard about any counter-proposal.
Reopening for discussion. Jean-Luc, you're of course more than welcome to join our call tomorrow at 14:00 CET.
During the call we decided to leave the feature request open for tracking, but I do not think that anyone is (actively) working on this.