Merge "Fixed for bug : 1171 - issue while creating subnet"
[controller.git] / opendaylight / md-sal / sal-protocolbuffer-encoding / src / test / resources / 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-3-13" {
10         description
11             "Initial revision";
12     }
13
14     grouping listGroup {
15         list list {
16             key "uint32InList";
17
18             leaf uint32InList {
19                 type uint32;
20             }
21
22             container containerInList{
23                 leaf uint32 {
24                     type uint32;
25                 }
26                 leaf uint16 {
27                     type uint16;
28                 }
29             }
30         }
31      }
32
33      grouping innerContainerGrouping {
34         container innerContainer {
35             leaf uint16 {
36                 type uint16;
37             }
38
39             container innerInnerContainer {
40
41                 leaf uint16 {
42                     type uint16;
43                 }
44
45                 leaf uint32 {
46                     type uint32;
47                 }
48             }
49         }
50      }
51
52     container container {
53         leaf uint32 {
54             type uint32;
55         }
56
57         leaf decimal64 {
58             type decimal64 {
59                 fraction-digits 2;
60             }
61         }
62
63         leaf boolean {
64             type boolean;
65         }
66
67         leaf binary {
68             type binary;
69         }
70
71         leaf string {
72             type string;
73         }
74
75         uses listGroup {
76             augment "list/" {
77                 leaf stringAugmentedToList{
78                     type string;
79                 }
80
81                 choice choiceInList {
82                     case caseInList1 {
83                         leaf stringAugmentedToListInCase1 {
84                             type string;
85                         }
86                     }
87                     case caseInList2 {
88                         leaf stringAugmentedToListInCase2 {
89                             type string;
90                         }
91                     }
92                 }
93             }
94         }
95
96         list directList {
97             leaf stringInDirectList {
98                 type string;
99             }
100         }
101
102         uses innerContainerGrouping;
103
104         choice choice{}
105         choice choice2{}
106
107         leaf-list leafList {
108             type string;
109         }
110
111         leaf identityRef {
112             type identityref {
113                 base test-identity;
114             }
115         }
116
117         /* TODO test modification with empty type
118         leaf empty {
119              type empty;
120          }
121          */
122     }
123
124     augment "/container/" {
125         leaf augmentUint32 {
126             type uint32;
127         }
128     }
129
130     augment "/container/directList/" {
131         leaf augmentedString {
132             type uint32;
133         }
134     }
135
136     augment "/container/choice/" {
137         case test-identity-augment {
138             when "/container/identityRef = 'test-identity'";
139             leaf augmentString1 {
140                 type string;
141             }
142
143             leaf augmentInt1 {
144                 type uint32;
145             }
146         }
147         case test-identity-augment2 {
148             when "/container/identityRef = 'test-identity2'";
149             leaf augmentString2 {
150                 type string;
151             }
152
153             leaf augmentInt2 {
154                 type uint32;
155             }
156         }
157     }
158
159     augment "/container/choice/test-identity-augment/" {
160
161         choice augmentedChoiceInCase {
162
163             case augmentedCaseInAugmentedChoice {
164                 leaf stringInAugmentedCaseInAugmentedChoice {
165                     type string;
166                 }
167             }
168
169             case augmentedCaseInAugmentedChoice2 {
170                 leaf stringInAugmentedCaseInAugmentedChoice2 {
171                     type string;
172                 }
173             }
174         }
175     }
176
177     augment "/container/choice/test-identity-augment/augmentedChoiceInCase/" {
178         case augmentedCaseInAugmentedChoiceFromAugment {
179             leaf stringInAugmentedCaseInAugmentedChoiceFromAugment {
180                 type string;
181             }
182         }
183     }
184
185     augment "/container/choice2/" {
186         case test-identity-augment {
187             when "/container/identityRef = 'test-identity'";
188             container augmentContainer {
189                 leaf augmentStringInaugmentContainer {
190                     type string;
191                 }
192             }
193         }
194         case test-identity-augment2 {
195             when "/container/identityRef = 'test-identity2'";
196             list augmentedList {
197                 leaf augmentStringInaugmentList {
198                     type string;
199                 }
200             }
201         }
202     }
203
204
205     augment "/container/choice2/test-identity-augment2/augmentedList/" {
206
207         container augmentedContainerInAugmentedListInAugmentedCase {
208             leaf-list leafInAugmentedContainerInAugmentedListInAugmentedCase {
209                 type uint32;
210             }
211         }
212
213         list augmentedListInAugmentedListInAugmentedCase {
214             leaf-list leafInAugmentedListInAugmentedListInAugmentedCase {
215                     type uint32;
216                 }
217         }
218     }
219
220     identity test-identity {}
221     identity test-identity2 {
222         base test-identity;
223     }
224
225 }