Adjust test suite parser update to conform with API changes
[yangtools.git] / yang / yang-parser-rfc7950 / src / test / resources / semantic-statement-parser / model / foo.yang
1 module foo {
2     yang-version 1;
3     namespace "urn:opendaylight.foo";
4     prefix "foo";
5
6     import bar {
7         prefix "br";
8         revision-date 2013-07-03;
9     }
10
11     import baz {
12         prefix "bz";
13         revision-date 2013-02-27;
14     }
15
16     include subfoo {
17         revision-date "2013-02-27";
18     }
19
20     organization "opendaylight";
21     contact "http://www.opendaylight.org/";
22
23     revision "2013-02-27" {
24         reference " WILL BE DEFINED LATER";
25     }
26
27     typedef identifier {
28         type int32;
29     }
30
31     leaf int32-leaf {
32         type br:int32-ext2 {
33             range "12..max";
34         }
35     }
36
37     leaf string-leaf {
38         type br:string-ext4;
39     }
40
41     leaf invalid-pattern-string-leaf {
42         type br:invalid-string-pattern;
43     }
44
45     leaf invalid-direct-string-pattern-def-leaf {
46         type string {
47             //pattern "[[A-1*-%22!^^}";
48         }
49     }
50
51     leaf multiple-pattern-string-leaf {
52         type br:multiple-pattern-string;
53     }
54
55     leaf multiple-pattern-direct-string-def-leaf {
56         type string {
57             pattern "[e-z]*";
58             //pattern "[[A-1*-%22!^^}";
59             pattern "[a-d]*";
60         }
61     }
62
63     leaf length-leaf {
64         type br:string-ext2 {
65             length "7..max";
66         }
67     }
68
69     leaf decimal-leaf {
70         type br:my-decimal-type {
71             fraction-digits 6;
72         }
73     }
74
75     leaf decimal-leaf2 {
76         type br:my-decimal-type;
77     }
78
79     container ext {
80         bz:c-define "MY_INTERFACES";
81     }
82
83     leaf union-leaf {
84         type br:my-union-ext;
85     }
86
87     deviation /br:interfaces/br:ifEntry {
88         deviate add {
89             config "true";
90         }
91         reference "system/user ref";
92     }
93
94     leaf custom-union-leaf {
95         type bz:union1;
96     }
97
98     container transfer {
99         choice how {
100             default interval;
101             container input {
102             }
103             list output {
104                 leaf id {
105                     type string;
106                 }
107             }
108             case interval {
109                 leaf interval {
110                     type uint16;
111                     default 30;
112                     units minutes;
113                 }
114             }
115             case daily {
116                 leaf daily {
117                     type empty;
118                 }
119                 leaf time-of-day {
120                     type string;
121                     units 24-hour-clock;
122                     default 1am;
123                 }
124             }
125             case manual {
126                 leaf manual {
127                     type empty;
128                 }
129             }
130         }
131     }
132
133     anyxml datas {
134         description
135           "Copy of the source typesstore subset that matched
136            the filter criteria (if any).  An empty types container
137            indicates that the request did not produce any results.";
138         status obsolete;
139     }
140
141     container mycont {
142         container innercont {
143             typedef mytype {
144                 type string;
145             }
146             leaf myleaf {
147                 type mytype;
148             }
149         }
150     }
151
152     uses bz:target {
153         augment "how/interval" {
154             description "inner augment";
155             leaf name {
156                 type string;
157             }
158         }
159     }
160
161     container peer {
162         container destination {
163             uses bz:target {
164                 refine address {
165                     default "1.2.3.4";
166                     description "IP address of target node";
167                     reference "address reference added by refine";
168                     config false;
169                     mandatory false;
170                     must "ifType != 'ethernet' or " +
171                             "(ifType = 'ethernet' and ifMTU = 1500)" {
172                         error-message "An ethernet MTU must be 1500";
173                     }
174                     foo:mountpoint "mnt-extension";
175                 }
176                 refine port {
177                     description "description of port defined by refine";
178                     reference "port reference added by refine";
179                     config false;
180                     presence "presence is required";
181                 }
182                 refine "addresses" {
183                     description "description of addresses defined by refine";
184                     reference "addresses reference added by refine";
185                     config false;
186                     min-elements 2;
187                     max-elements unbounded;
188                 }
189                 refine addresses/id {
190                     description "id of address";
191                 }
192             }
193         }
194     }
195
196     extension mountpoint {
197         description "enter point";
198         argument "name" {
199             yin-element "true";
200         }
201     }
202
203 }