File indexing completed on 2024-05-19 15:23:15
0001 <!DOCTYPE html> 0002 <html><head> 0003 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> 0004 <title>highlight.yang</title> 0005 <meta name="generator" content="KF5::SyntaxHighlighting - Definition (YANG) - Theme (Breeze Light)"/> 0006 </head><body style="background-color:#ffffff;color:#1f1c1b"><pre> 0007 <span style="color:#898887;">// from: https://en.wikipedia.org/w/index.php?title=YANG&oldid=792171830#Example</span> 0008 <span style="font-weight:bold;">module</span> example-sports { 0009 0010 <span style="font-weight:bold;">namespace</span> <span style="color:#bf0303;">"http://example.com/example-sports"</span>; 0011 <span style="font-weight:bold;">prefix</span> sports; 0012 0013 <span style="font-weight:bold;">import</span> ietf-yang-types { <span style="font-weight:bold;">prefix</span> yang; } 0014 0015 <span style="font-weight:bold;">typedef</span> season { 0016 <span style="font-weight:bold;">type</span> <span style="color:#0057ae;">string</span>; 0017 <span style="font-weight:bold;">description</span> 0018 <span style="color:#bf0303;">"The name of a sports season, including the type and the year, e.g,</span> 0019 <span style="color:#bf0303;"> 'Champions League 2014/2015'."</span>; 0020 } 0021 0022 <span style="font-weight:bold;">container</span> sports { 0023 <span style="font-weight:bold;">config</span> <span style="color:#0057ae;">true</span>; 0024 0025 <span style="font-weight:bold;">list</span> person { 0026 <span style="font-weight:bold;">key</span> name; 0027 <span style="font-weight:bold;">leaf</span> name { <span style="font-weight:bold;">type</span> <span style="color:#0057ae;">string</span>; } 0028 <span style="font-weight:bold;">leaf</span> birthday { <span style="font-weight:bold;">type</span> yang:date-and-time; <span style="font-weight:bold;">mandatory</span> <span style="color:#0057ae;">true</span>; } 0029 } 0030 0031 <span style="font-weight:bold;">list</span> team { 0032 <span style="font-weight:bold;">key</span> name; 0033 <span style="font-weight:bold;">leaf</span> name { <span style="font-weight:bold;">type</span> <span style="color:#0057ae;">string</span>; } 0034 <span style="font-weight:bold;">list</span> player { 0035 <span style="font-weight:bold;">key</span> <span style="color:#bf0303;">"name season"</span>; 0036 <span style="font-weight:bold;">unique</span> number; 0037 <span style="font-weight:bold;">leaf</span> name { <span style="font-weight:bold;">type</span> <span style="color:#0057ae;">leafref</span> { <span style="font-weight:bold;">path</span> <span style="color:#bf0303;">"/sports/person/name"</span>; } } 0038 <span style="font-weight:bold;">leaf</span> season { <span style="font-weight:bold;">type</span> season; } 0039 <span style="font-weight:bold;">leaf</span> number { <span style="font-weight:bold;">type</span> <span style="color:#0057ae;">uint16</span>; <span style="font-weight:bold;">mandatory</span> <span style="color:#0057ae;">true</span>; } 0040 <span style="font-weight:bold;">leaf</span> scores { <span style="font-weight:bold;">type</span> <span style="color:#0057ae;">uint16</span>; <span style="font-weight:bold;">default</span> 0; } 0041 } 0042 } 0043 } 0044 } 0045 </pre></body></html>