简体   繁体   English

如何将YANG数据模型转换为JSON数据?

[英]how to convert YANG data model to JSON data?

How do I convert "YANG" data model to "JSON"? 如何将“YANG”数据模型转换为“JSON”? As there is many many docs available in web, in that they changed in YANG synatx to JSON but how the value for the leaf or leaf list they are getting? 由于网上有很多文档可供使用,因此他们将YANG synatx更改为JSON,但是他们得到的叶子或叶子列表的值是多少? from where and how it will get actual data in JSON from YANG? 从哪里以及如何从YANG获得JSON中的实际数据?

  1. Convert yang to xml using pyang -f yin filename 使用pyang -f yin filename将yang转换为xml
  2. Convert xml file to json using any of the solutions below https://stackoverflow.com/a/10201397/3283069 https://stackoverflow.com/a/6465496/3283069 使用以下任何解决方案将xml文件转换为json https://stackoverflow.com/a/10201397/3283069 https://stackoverflow.com/a/6465496/3283069

Yang is a modeling language, not a data generation language. 杨是一种建模语言,而不是数据生成语言。

What you are asking for is a simulator that will contain the same or pseudo logic as your application to generate data. 你要求的是一个模拟器,它将包含与生成数据的应用程序相同或伪的逻辑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM