Populate model/ hierarchy
[yangtools.git] / model / yang-model-export / src / test / resources / schema-context-emitter-test / foo@2016-08-05.yang
1 module foo {
2     namespace foo-namespace;
3     prefix foo-prefix;
4
5     revision 2016-08-05;
6
7     feature test-feature {
8         status current;
9         description "test-feature description";
10         reference "test-feature reference";
11     }
12
13     typedef test-uint32-typedef {
14         type uint32 {
15             range "50..100";
16         }
17         units seconds;
18     }
19
20     typedef test-int32-typedef {
21         type int32 {
22             range "50..100";
23         }
24     }
25
26     typedef test-leafref-typedef {
27         type leafref {
28             path "../leafref-target-leaf";
29         }
30     }
31
32     typedef test-iid-typedef {
33         type instance-identifier {
34             require-instance false;
35         }
36     }
37
38     identity test-base-identity;
39
40     identity test-identity {
41         base test-base-identity;
42         status current;
43         description "test-identity description";
44         reference "test-identity reference";
45     }
46
47     extension test-extension;
48
49     rpc test-rpc {
50         input {
51             leaf input-leaf {
52                 type string;
53             }
54         }
55         output {
56             leaf output-leaf {
57                 type string;
58             }
59         }
60
61         grouping rpc-grouping {
62             leaf rpc-grouping-leaf {
63                 type string;
64             }
65         }
66     }
67
68     notification test-notification {
69         uses test-grouping-2 {
70             refine test-anyxml-2 {
71                 config false;
72             }
73             refine test-choice-2 {
74                 config false;
75             }
76         }
77     }
78
79     anyxml test-anyxml {
80         when "foo != 'bar'";
81         must "bar != 'foo'";
82
83         foo-prefix:test-extension;
84     }
85
86     leaf leafref-target-leaf {
87         type string;
88     }
89
90     container test-container-1 {
91         must "bar != 'foo'";
92     }
93
94     container test-container-3 {
95         choice test-choice {
96             case a {
97                 leaf case-a-leaf {
98                     type int32;
99                 }
100             }
101             case b {
102                 leaf case-b-leaf {
103                     type decimal64 {
104                         fraction-digits 3;
105                     }
106                 }
107             }
108         }
109         leaf bits-leaf {
110             type bits {
111                 bit one {
112                     position 1;
113                 }
114                 bit two {
115                     position 2;
116                 }
117             }
118         }
119         leaf identityref-leaf {
120             type identityref {
121                 base test-base-identity;
122             }
123         }
124     }
125
126     augment "/test-container-3/test-choice" {
127         case c {
128             leaf case-c-leaf {
129                 type string;
130             }
131         }
132     }
133
134     augment "/test-container-1" {
135         uses test-grouping-1 {
136             refine test-leaf-1 {
137                 default "def-val";
138             }
139             refine test-leaf-list {
140                 config false;
141             }
142             refine test-list {
143                 min-elements 5;
144             }
145             refine test-container-2 {
146                 config false;
147             }
148             augment test-container-2 {
149                 leaf test-leaf-2 {
150                     type string;
151                 }
152             }
153         }
154     }
155
156     grouping test-grouping-1 {
157         leaf test-leaf-1 {
158             type string;
159             default "def-val";
160         }
161         leaf-list test-leaf-list {
162             type string;
163             config false;
164             ordered-by user;
165         }
166         list test-list {
167             key "key-leaf-1 key-leaf-2";
168             min-elements 5;
169
170             leaf key-leaf-1 {
171                 type string;
172             }
173
174             leaf key-leaf-2 {
175                 type string;
176             }
177         }
178         container test-container-2 {
179             config false;
180         }
181     }
182
183     grouping test-grouping-2 {
184         anyxml test-anyxml-2 {
185             config false;
186         }
187         choice test-choice-2 {
188             config false;
189
190             case first {
191                 leaf first-case-leaf {
192                     type string {
193                         length "10..10 | 15";
194                     }
195                 }
196             }
197             case second {
198                 leaf second-case-leaf {
199                     type int32 {
200                         range "10..10 | 15";
201                     }
202                 }
203             }
204         }
205     }
206 }