Warning, /frameworks/syntax-highlighting/autotests/input/highlight.yang is written in an unsupported language. File is not indexed.
0001 // from: https://en.wikipedia.org/w/index.php?title=YANG&oldid=792171830#Example
0002 module example-sports {
0003
0004 namespace "http://example.com/example-sports";
0005 prefix sports;
0006
0007 import ietf-yang-types { prefix yang; }
0008
0009 typedef season {
0010 type string;
0011 description
0012 "The name of a sports season, including the type and the year, e.g,
0013 'Champions League 2014/2015'.";
0014 }
0015
0016 container sports {
0017 config true;
0018
0019 list person {
0020 key name;
0021 leaf name { type string; }
0022 leaf birthday { type yang:date-and-time; mandatory true; }
0023 }
0024
0025 list team {
0026 key name;
0027 leaf name { type string; }
0028 list player {
0029 key "name season";
0030 unique number;
0031 leaf name { type leafref { path "/sports/person/name"; } }
0032 leaf season { type season; }
0033 leaf number { type uint16; mandatory true; }
0034 leaf scores { type uint16; default 0; }
0035 }
0036 }
0037 }
0038 }