我想建立一個CLI。我選擇使用'楊'來做到這一點。我是新手,無法找到如何導入現有的模塊。例如,我在github上找到了一個用於ospf的模塊(https://github.com/YangModels/yang/blob/master/vendor/cisco/xe/1631/ietf-ospf.yang),我想用我自己的模塊導入它。這可以做到嗎?怎麼樣?如何導入一個模塊在楊
EDIT1:
module mininet {
/* name space */
namespace "http://tail-f.com/ns/example/mininet";
prefix mininet;
import ietf-ospf {
prefix ospf;
revision-date 2015-03-09
}
leaf area-id-type {
type yang:area-id-type;
}
}
於是,我就這樣做了Piotr使用幫助Babij這種方式。不幸的是,這是行不通的。我需要改變什麼? area-id-type是ietf-ospf的typedef。我有誤差TE下列之一:
mininet.yang:12:3: error: trailing garbage after module
mininet.yang:12:3: error: unterminated statement
'我需要改變什麼呢?''''''''''''revision-date'語句缺少分號(';')。你正在使用的工具的解析器有點困惑,因爲它會給你那些非描述性的錯誤信息。另外,您仍然使用錯誤的'prefix'作爲導入模塊的類型引用。 – predi