container statistics {
description "A collection of interface
statistics.";
leaf in-octets {
type yang:counter64;
description "The total number of
octets received on the interface.";
}
leaf in-errors {
type yang:counter32;
description "Number of inbound
packets that contained errors.";
}
leaf out-octets {
type yang:counter64;
description "The total number of
octets sent out on the interface.";
}
leaf out-errors {
type yang:counter32;
description "Number of outbound
packets that contained errors.";
}
}
The XML instantiation of this model is the following:
Click here to view code image
<statistics>
<in-octets>5983247896</in-octets>
<in-errors>2578</in-errors>
<out-octets>678845633</out-octets>
<out-errors>0</out-errors>
</statistics>
The last type of node that is used for data modeling in
YANG is the list. A list defines a sequence of list entries.
Each entry is a record instance and is uniquely identified
by the values of its key leaves. A list can be thought of as
a table organized around the key leaf with all the leaves
as rows in that table. For example, the user list in
Example 12-2 can be defined as having three leaves