Merge branch 'master' of ../controller
[yangtools.git] / yang / yang-data-codec-xml / src / test / resources / schema / test.yang
1 // vi: set smarttab et sw=4 tabstop=4:
2 module test {
3     yang-version 1;
4     namespace "urn:opendaylight:params:xml:ns:yang:controller:test";
5     prefix "test";
6
7     organization "Cisco Systems, Inc.";
8
9     revision "2014-03-13" {
10         description
11             "Initial revision";
12     }
13
14     identity a {}
15
16     identity b {
17         base "test:a";
18     }
19
20     grouping listGroup {
21         list list {
22             key "uint32InList";
23
24             leaf uint32InList {
25                 type uint32;
26             }
27
28             container containerInList{
29                 leaf uint32 {
30                     type uint32;
31                 }
32                 leaf uint16 {
33                     type uint16;
34                 }
35
36                 leaf identityr {
37                     type identityref {
38                         base "test:a";
39                      }
40                 }
41
42                 leaf uint16-ref {
43                     type leafref {
44                         path "../uint16";
45                      }
46                 }
47
48                 leaf instance-id {
49                     type instance-identifier;
50                 }
51
52                 anyxml anyX;
53             }
54         }
55      }
56
57      grouping innerContainerGrouping {
58         container innerContainer {
59             leaf uint16 {
60                 type uint16;
61             }
62
63             container innerInnerContainer {
64
65                 leaf uint16 {
66                     type uint16;
67                 }
68
69                 leaf uint32 {
70                     type uint32;
71                 }
72             }
73         }
74      }
75
76     container container {
77         leaf uint32 {
78             type uint32;
79         }
80
81         leaf decimal64 {
82             type decimal64 {
83                 fraction-digits 2;
84             }
85         }
86
87         leaf boolean {
88             type boolean;
89         }
90
91         leaf binary {
92             type binary;
93         }
94
95         leaf string {
96             type string;
97         }
98
99         uses listGroup {
100             augment "list/" {
101                 leaf stringAugmentedToList{
102                     type string;
103                 }
104
105                 choice choiceInList {
106                     case caseInList1 {
107                         leaf stringAugmentedToListInCase1 {
108                             type string;
109                         }
110                     }
111                     case caseInList2 {
112                         leaf stringAugmentedToListInCase2 {
113                             type string;
114                         }
115                     }
116                 }
117             }
118         }
119
120         list directList {
121             leaf stringInDirectList {
122                 type string;
123             }
124         }
125
126         uses innerContainerGrouping;
127
128         choice choice{}
129         choice choice2{}
130
131         leaf-list leafList {
132             type string;
133         }
134
135         leaf identityRef {
136             type identityref {
137                 base test-identity;
138             }
139         }
140     }
141
142     augment "/container/" {
143         leaf augmentUint32 {
144             type uint32;
145         }
146     }
147
148     augment "/container/directList/" {
149         leaf augmentedString {
150             type uint32;
151         }
152     }
153
154     augment "/container/choice/" {
155         case test-identity-augment {
156             when "/container/identityRef = 'test-identity'";
157             leaf augmentString1 {
158                 type string;
159             }
160
161             leaf augmentInt1 {
162                 type uint32;
163             }
164         }
165         case test-identity-augment2 {
166             when "/container/identityRef = 'test-identity2'";
167             leaf augmentString2 {
168                 type string;
169             }
170
171             leaf augmentInt2 {
172                 type uint32;
173             }
174         }
175     }
176
177     augment "/container/choice/test-identity-augment/" {
178
179         choice augmentedChoiceInCase {
180
181             case augmentedCaseInAugmentedChoice {
182                 leaf stringInAugmentedCaseInAugmentedChoice {
183                     type string;
184                 }
185             }
186
187             case augmentedCaseInAugmentedChoice2 {
188                 leaf stringInAugmentedCaseInAugmentedChoice2 {
189                     type string;
190                 }
191             }
192         }
193     }
194
195     augment "/container/choice/test-identity-augment/augmentedChoiceInCase/" {
196         case augmentedCaseInAugmentedChoiceFromAugment {
197             leaf stringInAugmentedCaseInAugmentedChoiceFromAugment {
198                 type string;
199             }
200         }
201     }
202
203     augment "/container/choice2/" {
204         case test-identity-augment {
205             when "/container/identityRef = 'test-identity'";
206             container augmentContainer {
207                 leaf augmentStringInaugmentContainer {
208                     type string;
209                 }
210             }
211         }
212         case test-identity-augment2 {
213             when "/container/identityRef = 'test-identity2'";
214             list augmentedList {
215                 leaf augmentStringInaugmentList {
216                     type string;
217                 }
218             }
219         }
220     }
221
222
223     augment "/container/choice2/test-identity-augment2/augmentedList/" {
224
225         container augmentedContainerInAugmentedListInAugmentedCase {
226             leaf-list leafInAugmentedContainerInAugmentedListInAugmentedCase {
227                 type uint32;
228             }
229         }
230
231         list augmentedListInAugmentedListInAugmentedCase {
232             leaf-list leafInAugmentedListInAugmentedListInAugmentedCase {
233                     type uint32;
234                 }
235         }
236     }
237
238     identity test-identity {}
239     identity test-identity2 {
240         base test-identity;
241     }
242
243 }