如何将YANG数据模型转换为JSON数据? [英] how to convert YANG data model to JSON data?

查看:1256
本文介绍了如何将YANG数据模型转换为JSON数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将"YANG"数据模型转换为"JSON"? 网路上有许多文件可供使用,因为它们在YANG中有所变更 将synatx转换为JSON,但是如何获取它们的叶子或叶子列表的值?从何处以及如何从YANG获取JSON中的实际数据?

How do I convert "YANG" data model to "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? from where and how it will get actual data in JSON from YANG?

推荐答案

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

这篇关于如何将YANG数据模型转换为JSON数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆