I am learning netconf and yang. One thing which confuses me is, how to write an XML instance data for a given yang schema. Is there a tool which can create a sample instance data? Where I can just put my own values without worrying about nodes, and it's nesting.
eg for below given yang model
module tubecats {
namespace "http://plajjan.github.io/ns/yang/tubecats";
prefix tc;
revision 2017-03-15 {
description "First and only version";
}
container internet {
list cat {
key name;
leaf name {
type string;
}
}
}
}
How below sample instance data is generated?
<ns0:data xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0">
<tc:internet xmlns:tc="http://plajjan.github.io/ns/yang/tubecats">
<tc:cat>
<tc:name>jingles</tc:name>
</tc:cat>
<tc:cat>
<tc:name>fluffy</tc:name>
</tc:cat>
</tc:internet>
</ns0:data>
I understand there is a tool called yanglint which can validate model again instance data but that is not what I want.