File indexing completed on 2024-05-12 04:02:08

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 Dark)"/>
0006 </head><body style="background-color:#232629;color:#cfcfc2"><pre>
0007 <span style="color:#7a7c7d">// from: https://en.wikipedia.org/w/index.php?title=YANG&amp;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:#f44f4f">"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:#2980b9">string</span>;
0017     <span style="font-weight:bold">description</span>
0018       <span style="color:#f44f4f">"The name of a sports season, including the type and the year, e.g,</span>
0019 <span style="color:#f44f4f">       '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:#27aeae">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:#2980b9">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:#27aeae">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:#2980b9">string</span>; }
0034       <span style="font-weight:bold">list</span> player {
0035         <span style="font-weight:bold">key</span> <span style="color:#f44f4f">"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:#2980b9">leafref</span> { <span style="font-weight:bold">path</span> <span style="color:#f44f4f">"/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:#2980b9">uint16</span>; <span style="font-weight:bold">mandatory</span> <span style="color:#27aeae">true</span>; }
0040         <span style="font-weight:bold">leaf</span> scores { <span style="font-weight:bold">type</span> <span style="color:#2980b9">uint16</span>; <span style="font-weight:bold">default</span> 0; }
0041       }
0042     }
0043   }
0044 }
0045 </pre></body></html>