Bug 2366 - Effective statments impl merge, retest & bugfix
[yangtools.git] / yang / yang-parser-impl / src / test / resources / simple-test / simple-nodes.yang
1 module simple-nodes {
2     yang-version 1;
3     namespace "urn:opendaylight:"+
4         "simple-nodes";
5     prefix "sn";
6
7     organization "opendaylight";
8
9     description
10         "test file containing yang data nodes";   
11
12     revision "2013-07-30" {
13         description
14             "Initial revision.";
15         reference "will be defined";
16     }
17     
18     typedef mytype {
19         type string;
20     }
21
22     // NOTE: simple comment
23
24     anyxml data {
25         config false;
26         description "anyxml desc";
27         if-feature has-name;
28         mandatory true;
29         must "ifType != 'ethernet' or " +
30               "(ifType = 'ethernet' and ifMTU = 1500)" {
31              error-message "An ethernet MTU must be 1500";
32         }
33         must "ifType != 'atm' or " +
34               "(ifType = 'atm' and ifMTU <= 17966 and ifMTU >= 64)" {
35              error-app-tag "anyxml data error-app-tag";
36              error-message "An atm MTU must be  64 .. 17966";
37              description "an error occured in data";
38              reference "data must ref";
39         }
40         reference "data ref";
41         status obsolete;
42         when "class != 'wheel'";
43     }
44
45     container nodes {
46         anyxml text;
47         choice level;
48         config false;
49         container node;
50         description "nodes collection";
51         grouping node-group {
52             leaf source {
53                 type int8;
54             }
55             leaf target {
56                 type int16;
57             }
58         }
59         if-feature has-name;
60         leaf nodes-id {
61             type int32;
62         }
63         leaf-list added {
64             type mytype;
65         }
66         list links {
67         }
68         must "ifType != 'atm' or " +
69               "(ifType = 'atm' and ifMTU <= 17966 and ifMTU >= 64)" {
70              error-app-tag "anyxml data error-app-tag";
71              error-message "An atm MTU must be  64 .. 17966";
72              description "an error occured in data";
73              reference "data must ref";
74         }
75         must "ifId != 0";
76         presence "required";
77         reference "nodes ref";
78         status current;
79         typedef nodes-type {
80             type string;
81         }
82         uses node-group;
83         when "class != 'wheel'";
84     }
85
86     list links {
87         anyxml text;
88         choice level;
89         config false;
90         container link;
91         description "links collection";
92         grouping link-group {
93             leaf source {
94                 type int8;
95             }
96             leaf target {
97                 type int16;
98             }
99         }
100         if-feature has-name;
101         key links-id;
102         leaf links-id {
103             type int32;
104         }
105         leaf-list added {
106             type int64;
107         }
108         list nodes {
109         }
110         max-elements 100;
111         min-elements 1;
112         must "ifType != 'atm' or " +
113               "(ifType = 'atm' and ifMTU <= 17966 and ifMTU >= 64)" {
114              error-app-tag "anyxml data error-app-tag";
115              error-message "An atm MTU must be  64 .. 17966";
116              description "an error occured in data";
117              reference "data must ref";
118         }
119         must "ifId != 0";
120         ordered-by user;
121         reference "links ref";
122         status current;
123         typedef nodes-type {
124             type string;
125         }
126         uses link-group;
127         when "class != 'wheel'";
128     }
129
130 }