简体   繁体   English

从本地输入 CLI 到 YANG XML

[英]CLI to YANG XML from local input

I have a huge cli conf file that I'd like to convert to YANG xml我有一个巨大的 cli conf 文件,我想将其转换为 YANG xml

....
system
 host-name hostname.com
 system-ip 8.8.8.8
 site-id 1
 organization-name "Organization name"
 sp-organization-name "Organization name"
 vbond vbond.net
 ....
!

There are utilities like netconf-console2 that will fetch the configs from a router and display them as YANG XML有像 netconf-console2 这样的实用程序,可以从路由器获取配置并将它们显示为 YANG XML

netconf-console2 --host=192.168.0.2 -u admin -p PASSWORD --port 830 --get-config

I was wondering if I could use the same utility to convert the conf from a local input, something like:我想知道是否可以使用相同的实用程序从本地输入转换 conf,例如:

netconf-console2 --file localConf.cf

Not sure if that is even possible or if there is an alternative to netconf-console2 for this.不确定这是否可能,或者是否有替代 netconf-console2 的方法。

There's no "YANG XML".没有“YANG XML”。 There are YANG models (a lot of them), and you can think of sets of these YANG models as database schemas .有 YANG模型(很多),您可以将这些 YANG 模型的集合视为数据库模式 Then there is some configuration data which is structured according to a set of some YANG models.然后是一些配置数据,这些数据是根据一组 YANG 模型构建的。 This data can be serialized into JSON, or XML (and in future, to other formats as well).这些数据可以序列化为 JSON 或 XML(将来也可以序列化为其他格式)。 However, before you can do that, you have to know about that set of YANG models which the data corresponds to.但是,在您这样做之前,您必须了解数据对应的那组 YANG 模型。 What YANG models are you trying to use?你想使用什么 YANG 模型?

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

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