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