Merge branch 'master' of ../controller
[yangtools.git] / yang / yang-parser-rfc7950 / src / test / resources / simple-test / simple-nodes.yang
1 module simple-nodes {
2     yang-version 1.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     feature has-name;
25
26     anyxml data {
27         config false;
28         description "anyxml desc";
29         if-feature has-name;
30         mandatory true;
31         must "ifType != 'ethernet' or " +
32               "(ifType = 'ethernet' and ifMTU = 1500)" {
33              error-message "An ethernet MTU must be 1500";
34         }
35         must "ifType != 'atm' or " +
36               "(ifType = 'atm' and ifMTU <= 17966 and ifMTU >= 64)" {
37              error-app-tag "anyxml data error-app-tag";
38              error-message "An atm MTU must be  64 .. 17966";
39              description "an error occured in data";
40              reference "data must ref";
41         }
42         reference "data ref";
43         status obsolete;
44         when "class != 'wheel'";
45     }
46
47     anydata data2 {
48         config false;
49         description "anydata desc";
50         if-feature has-name;
51         mandatory true;
52         must "ifType != 'ethernet' or " +
53               "(ifType = 'ethernet' and ifMTU = 1500)" {
54              error-message "An ethernet MTU must be 1500";
55         }
56         must "ifType != 'atm' or " +
57               "(ifType = 'atm' and ifMTU <= 17966 and ifMTU >= 64)" {
58              error-app-tag "anydata data error-app-tag";
59              error-message "An atm MTU must be  64 .. 17966";
60              description "an error occured in data";
61              reference "data must ref";
62         }
63         reference "data ref";
64         status obsolete;
65         when "class != 'wheel'";
66     }
67
68     container nodes {
69         anyxml text;
70         choice level;
71         config false;
72         container node;
73         description "nodes collection";
74         grouping node-group {
75             leaf source {
76                 type int8;
77             }
78             leaf target {
79                 type int16;
80             }
81         }
82         if-feature has-name;
83         leaf nodes-id {
84             type int32;
85         }
86         leaf-list added {
87             type mytype;
88         }
89         list links {
90         }
91         must "ifType != 'atm' or " +
92               "(ifType = 'atm' and ifMTU <= 17966 and ifMTU >= 64)" {
93              error-app-tag "anyxml data error-app-tag";
94              error-message "An atm MTU must be  64 .. 17966";
95              description "an error occured in data";
96              reference "data must ref";
97         }
98         must "ifId != 0";
99         presence "required";
100         reference "nodes ref";
101         status current;
102         typedef nodes-type {
103             type string;
104         }
105         uses node-group;
106         when "class != 'wheel'";
107     }
108
109     list links {
110         anyxml text;
111         choice level;
112         config false;
113         container link;
114         description "links collection";
115         grouping link-group {
116             leaf source {
117                 type int8;
118             }
119             leaf target {
120                 type int16;
121             }
122         }
123         if-feature has-name;
124         key links-id;
125         leaf links-id {
126             type int32;
127         }
128         leaf-list added {
129             type int64;
130         }
131         list nodes {
132         }
133         max-elements 100;
134         min-elements 1;
135         must "ifType != 'atm' or " +
136               "(ifType = 'atm' and ifMTU <= 17966 and ifMTU >= 64)" {
137              error-app-tag "anyxml data error-app-tag";
138              error-message "An atm MTU must be  64 .. 17966";
139              description "an error occured in data";
140              reference "data must ref";
141         }
142         must "ifId != 0";
143         ordered-by user;
144         reference "links ref";
145         status current;
146         typedef nodes-type {
147             type string;
148         }
149         uses link-group;
150         when "class != 'wheel'";
151     }
152
153 }