DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1

called name, uid, and full-name, with the name leaf
being defined as the key leaf.


Example 12-2 YANG List Example

list user {
key name;
leaf name {
type string;
}
leaf uid {
type uint32;
}
leaf full-name {
type string;
}
}

An instantiation of this data model on the wire might
look in this case as shown in Example 12-3.


Example 12-3 Instantiation of the YANG List

Click here to view code image


<user>
<name>john</name>
<uid>1000</uid>
<full-name>John Doe</full-name>
</user>
<user>
<name>jeanne</name>
<uid>1001</uid>
<full-name>Jeanne Doe</full-name>
</user>

We could combine all the nodes discussed so far to create
a rudimentary YANG data model. Let’s call this module
bogus-interfaces. The data model defined in this
module will be saved in a file that has to match the
module name. In this case, the file that will contain the
module will have to be called bogus-interfaces.yang.

Free download pdf