janani b | 99fccd7 | 2017-07-13 19:14:44 +0530 | [diff] [blame] | 1 | module YtbDataTypes { |
2 | yang-version 1; | ||||
3 | namespace "yms:test:ytb:data:types"; | ||||
4 | prefix "data-types"; | ||||
5 | revision "2016-08-26"; | ||||
6 | // Enum with all combinations. | ||||
7 | |||||
8 | typedef def1 { | ||||
9 | type union { | ||||
10 | type uint64; | ||||
11 | type enumeration { | ||||
12 | enum ten { | ||||
13 | value "10"; | ||||
14 | } | ||||
15 | enum hundred { | ||||
16 | value "100"; | ||||
17 | } | ||||
18 | enum thousand { | ||||
19 | value "1000"; | ||||
20 | } | ||||
sonugupta-huawei | 35540a3 | 2017-08-22 16:18:50 +0530 | [diff] [blame] | 21 | enum * { |
22 | value "10000"; | ||||
23 | } | ||||
janani b | 99fccd7 | 2017-07-13 19:14:44 +0530 | [diff] [blame] | 24 | } |
25 | } | ||||
26 | } | ||||
27 | |||||
28 | typedef def2 { | ||||
29 | type bits { | ||||
30 | bit b1; | ||||
31 | bit b2; | ||||
32 | bit b3; | ||||
33 | } | ||||
34 | } | ||||
35 | |||||
36 | typedef def3 { | ||||
37 | type empty; | ||||
38 | } | ||||
39 | |||||
40 | typedef def4 { | ||||
41 | type empty; | ||||
42 | } | ||||
43 | |||||
44 | typedef def5 { | ||||
45 | type leafref { | ||||
46 | path "/leaf3"; | ||||
47 | } | ||||
48 | } | ||||
49 | |||||
surya-huawei | a762e29 | 2017-08-25 23:00:41 +0530 | [diff] [blame^] | 50 | typedef def6 { |
51 | type identityref { | ||||
52 | base type; | ||||
53 | } | ||||
54 | } | ||||
55 | |||||
56 | typedef def7 { | ||||
57 | type union { | ||||
58 | type identityref { | ||||
59 | base physical ; | ||||
60 | } | ||||
61 | type identityref { | ||||
62 | base virtual; | ||||
63 | } | ||||
64 | } | ||||
65 | } | ||||
66 | |||||
janani b | 99fccd7 | 2017-07-13 19:14:44 +0530 | [diff] [blame] | 67 | identity type { |
68 | description "type value"; | ||||
69 | } | ||||
70 | |||||
71 | identity physical { | ||||
72 | base type; | ||||
73 | } | ||||
74 | |||||
75 | identity virtual { | ||||
76 | base type; | ||||
77 | } | ||||
78 | |||||
79 | leaf leaf1 { | ||||
80 | type string; | ||||
81 | } | ||||
82 | |||||
83 | leaf leaf2 { | ||||
84 | type def1; | ||||
85 | } | ||||
86 | |||||
87 | leaf leaf3 { | ||||
88 | type binary; | ||||
89 | } | ||||
90 | |||||
91 | leaf leaf4 { | ||||
92 | type leafref { | ||||
93 | path "/leaf2"; | ||||
94 | } | ||||
95 | } | ||||
96 | |||||
97 | leaf leaf5 { | ||||
98 | type identityref { | ||||
99 | base type; | ||||
100 | } | ||||
101 | } | ||||
102 | |||||
103 | leaf leaf6 { | ||||
104 | type instance-identifier; | ||||
105 | } | ||||
106 | |||||
107 | leaf leaf7 { | ||||
108 | type bits { | ||||
109 | bit b1; | ||||
110 | bit b2; | ||||
111 | bit b3; | ||||
112 | } | ||||
113 | } | ||||
114 | |||||
115 | leaf leaf8 { | ||||
116 | type empty; | ||||
117 | } | ||||
118 | |||||
119 | leaf leaf9 { | ||||
120 | type def2; | ||||
121 | } | ||||
122 | |||||
123 | leaf leaf10 { | ||||
124 | type def3; | ||||
125 | } | ||||
126 | |||||
127 | leaf leaf11 { | ||||
128 | type leafref { | ||||
129 | path "/leaf8"; | ||||
130 | } | ||||
131 | } | ||||
132 | |||||
133 | leaf leaf12 { | ||||
134 | type def5; | ||||
135 | } | ||||
136 | |||||
sonugupta-huawei | 35540a3 | 2017-08-22 16:18:50 +0530 | [diff] [blame] | 137 | leaf leaf13 { |
138 | type def1; | ||||
139 | } | ||||
140 | |||||
surya-huawei | a762e29 | 2017-08-25 23:00:41 +0530 | [diff] [blame^] | 141 | leaf leaf14 { |
142 | type def6; | ||||
143 | } | ||||
144 | |||||
145 | leaf leaf15 { | ||||
146 | type def7; | ||||
147 | } | ||||
148 | |||||
janani b | 99fccd7 | 2017-07-13 19:14:44 +0530 | [diff] [blame] | 149 | container cont1 { |
150 | leaf leaf1 { | ||||
151 | type string; | ||||
152 | } | ||||
153 | |||||
154 | leaf leaf2 { | ||||
155 | type def1; | ||||
156 | } | ||||
157 | |||||
158 | leaf leaf3 { | ||||
159 | type binary; | ||||
160 | } | ||||
161 | |||||
162 | leaf leaf4 { | ||||
163 | type leafref { | ||||
164 | path "/leaf2"; | ||||
165 | } | ||||
166 | } | ||||
167 | |||||
168 | leaf leaf5 { | ||||
169 | type identityref { | ||||
170 | base type; | ||||
171 | } | ||||
172 | } | ||||
173 | |||||
174 | leaf leaf6 { | ||||
175 | type instance-identifier; | ||||
176 | } | ||||
177 | |||||
178 | leaf leaf7 { | ||||
179 | type bits { | ||||
180 | bit b1; | ||||
181 | bit b2; | ||||
182 | bit b3; | ||||
183 | } | ||||
184 | } | ||||
185 | |||||
186 | leaf leaf8 { | ||||
187 | type empty; | ||||
188 | } | ||||
189 | |||||
190 | leaf leaf9 { | ||||
191 | type def2; | ||||
192 | } | ||||
193 | |||||
194 | leaf leaf10 { | ||||
195 | type def3; | ||||
196 | } | ||||
197 | |||||
198 | leaf leaf11 { | ||||
199 | type leafref { | ||||
200 | path "/leaf8"; | ||||
201 | } | ||||
202 | } | ||||
203 | |||||
204 | leaf leaf12 { | ||||
205 | type def5; | ||||
206 | } | ||||
207 | |||||
sonugupta-huawei | 35540a3 | 2017-08-22 16:18:50 +0530 | [diff] [blame] | 208 | leaf leaf13 { |
209 | type def1; | ||||
210 | } | ||||
211 | |||||
surya-huawei | a762e29 | 2017-08-25 23:00:41 +0530 | [diff] [blame^] | 212 | leaf leaf14 { |
213 | type def6; | ||||
214 | } | ||||
215 | |||||
216 | leaf leaf15 { | ||||
217 | type def7; | ||||
218 | } | ||||
219 | |||||
janani b | 99fccd7 | 2017-07-13 19:14:44 +0530 | [diff] [blame] | 220 | leaf-list ll1 { |
221 | type string; | ||||
222 | } | ||||
223 | |||||
224 | leaf-list ll2 { | ||||
225 | type def1; | ||||
226 | } | ||||
227 | |||||
228 | leaf-list ll3 { | ||||
229 | type binary; | ||||
230 | } | ||||
231 | |||||
232 | leaf-list ll4 { | ||||
233 | type leafref { | ||||
234 | path "/ll2"; | ||||
235 | } | ||||
236 | } | ||||
237 | |||||
238 | leaf-list ll5 { | ||||
239 | type identityref { | ||||
240 | base type; | ||||
241 | } | ||||
242 | } | ||||
243 | |||||
244 | leaf-list ll6 { | ||||
245 | type instance-identifier; | ||||
246 | } | ||||
247 | |||||
248 | leaf-list ll7 { | ||||
249 | type bits { | ||||
250 | bit b1; | ||||
251 | bit b2; | ||||
252 | bit b3; | ||||
253 | } | ||||
254 | } | ||||
255 | |||||
256 | leaf-list ll8 { | ||||
257 | type empty; | ||||
258 | } | ||||
259 | |||||
260 | leaf-list ll9 { | ||||
261 | type def2; | ||||
262 | } | ||||
263 | |||||
264 | leaf-list ll10 { | ||||
265 | type def3; | ||||
266 | } | ||||
267 | |||||
268 | leaf-list ll11 { | ||||
269 | type leafref { | ||||
270 | path "/ll8"; | ||||
271 | } | ||||
272 | } | ||||
273 | |||||
274 | leaf-list ll12 { | ||||
275 | type def5; | ||||
276 | } | ||||
277 | |||||
sonugupta-huawei | 35540a3 | 2017-08-22 16:18:50 +0530 | [diff] [blame] | 278 | leaf-list ll13 { |
279 | type def1; | ||||
280 | } | ||||
281 | |||||
surya-huawei | a762e29 | 2017-08-25 23:00:41 +0530 | [diff] [blame^] | 282 | leaf-list ll14 { |
283 | type def6; | ||||
284 | } | ||||
285 | |||||
286 | leaf-list ll15 { | ||||
287 | type def7; | ||||
288 | } | ||||
janani b | 99fccd7 | 2017-07-13 19:14:44 +0530 | [diff] [blame] | 289 | container cont2 { |
290 | } | ||||
291 | } | ||||
292 | |||||
293 | leaf-list ll1 { | ||||
294 | type string; | ||||
295 | } | ||||
296 | |||||
297 | leaf-list ll2 { | ||||
298 | type def1; | ||||
299 | } | ||||
300 | |||||
301 | leaf-list ll3 { | ||||
302 | type binary; | ||||
303 | } | ||||
304 | |||||
305 | leaf-list ll4 { | ||||
306 | type leafref { | ||||
307 | path "/ll2"; | ||||
308 | } | ||||
309 | } | ||||
310 | |||||
311 | leaf-list ll5 { | ||||
312 | type identityref { | ||||
313 | base type; | ||||
314 | } | ||||
315 | } | ||||
316 | |||||
317 | leaf-list ll6 { | ||||
318 | type instance-identifier; | ||||
319 | } | ||||
320 | |||||
321 | leaf-list ll7 { | ||||
322 | type bits { | ||||
323 | bit b1; | ||||
324 | bit b2; | ||||
325 | bit b3; | ||||
326 | } | ||||
327 | } | ||||
328 | |||||
329 | leaf-list ll8 { | ||||
330 | type empty; | ||||
331 | } | ||||
332 | |||||
333 | leaf-list ll9 { | ||||
334 | type def2; | ||||
335 | } | ||||
336 | |||||
337 | leaf-list ll10 { | ||||
338 | type def3; | ||||
339 | } | ||||
340 | |||||
341 | leaf-list ll11 { | ||||
342 | type leafref { | ||||
343 | path "/ll8"; | ||||
344 | } | ||||
345 | } | ||||
346 | |||||
347 | leaf-list ll12 { | ||||
348 | type def5; | ||||
349 | } | ||||
350 | |||||
sonugupta-huawei | 35540a3 | 2017-08-22 16:18:50 +0530 | [diff] [blame] | 351 | leaf-list ll13 { |
352 | type def1; | ||||
353 | } | ||||
354 | |||||
surya-huawei | a762e29 | 2017-08-25 23:00:41 +0530 | [diff] [blame^] | 355 | leaf-list ll14 { |
356 | type def6; | ||||
357 | } | ||||
358 | |||||
359 | leaf-list ll15 { | ||||
360 | type def7; | ||||
361 | } | ||||
janani b | 99fccd7 | 2017-07-13 19:14:44 +0530 | [diff] [blame] | 362 | augment "/cont1/cont2" { |
363 | leaf leaf1 { | ||||
364 | type string; | ||||
365 | } | ||||
366 | |||||
367 | leaf leaf2 { | ||||
368 | type def1; | ||||
369 | } | ||||
370 | |||||
371 | leaf leaf3 { | ||||
372 | type binary; | ||||
373 | } | ||||
374 | |||||
375 | leaf leaf4 { | ||||
376 | type leafref { | ||||
377 | path "/leaf2"; | ||||
378 | } | ||||
379 | } | ||||
380 | |||||
381 | leaf leaf5 { | ||||
382 | type identityref { | ||||
383 | base type; | ||||
384 | } | ||||
385 | } | ||||
386 | |||||
387 | leaf leaf6 { | ||||
388 | type instance-identifier; | ||||
389 | } | ||||
390 | |||||
391 | leaf leaf7 { | ||||
392 | type bits { | ||||
393 | bit b1; | ||||
394 | bit b2; | ||||
395 | bit b3; | ||||
396 | } | ||||
397 | } | ||||
398 | |||||
399 | leaf leaf8 { | ||||
400 | type empty; | ||||
401 | } | ||||
402 | |||||
403 | leaf leaf9 { | ||||
404 | type def2; | ||||
405 | } | ||||
406 | |||||
407 | leaf leaf10 { | ||||
408 | type def3; | ||||
409 | } | ||||
410 | |||||
411 | leaf leaf11 { | ||||
412 | type leafref { | ||||
413 | path "/leaf8"; | ||||
414 | } | ||||
415 | } | ||||
416 | |||||
417 | leaf leaf12 { | ||||
418 | type def5; | ||||
419 | } | ||||
420 | |||||
sonugupta-huawei | 35540a3 | 2017-08-22 16:18:50 +0530 | [diff] [blame] | 421 | leaf leaf13 { |
422 | type def1; | ||||
423 | } | ||||
424 | |||||
surya-huawei | a762e29 | 2017-08-25 23:00:41 +0530 | [diff] [blame^] | 425 | leaf leaf14 { |
426 | type def6; | ||||
427 | } | ||||
428 | |||||
429 | leaf leaf15 { | ||||
430 | type def7; | ||||
431 | } | ||||
432 | |||||
janani b | 99fccd7 | 2017-07-13 19:14:44 +0530 | [diff] [blame] | 433 | leaf-list ll1 { |
434 | type string; | ||||
435 | } | ||||
436 | |||||
437 | leaf-list ll2 { | ||||
438 | type def1; | ||||
439 | } | ||||
440 | |||||
441 | leaf-list ll3 { | ||||
442 | type binary; | ||||
443 | } | ||||
444 | |||||
445 | leaf-list ll4 { | ||||
446 | type leafref { | ||||
447 | path "/ll2"; | ||||
448 | } | ||||
449 | } | ||||
450 | |||||
451 | leaf-list ll5 { | ||||
452 | type identityref { | ||||
453 | base type; | ||||
454 | } | ||||
455 | } | ||||
456 | |||||
457 | leaf-list ll6 { | ||||
458 | type instance-identifier; | ||||
459 | } | ||||
460 | |||||
461 | leaf-list ll7 { | ||||
462 | type bits { | ||||
463 | bit b1; | ||||
464 | bit b2; | ||||
465 | bit b3; | ||||
466 | } | ||||
467 | } | ||||
468 | |||||
469 | leaf-list ll8 { | ||||
470 | type empty; | ||||
471 | } | ||||
472 | |||||
473 | leaf-list ll9 { | ||||
474 | type def2; | ||||
475 | } | ||||
476 | |||||
477 | leaf-list ll10 { | ||||
478 | type def3; | ||||
479 | } | ||||
480 | |||||
481 | leaf-list ll11 { | ||||
482 | type leafref { | ||||
483 | path "/ll8"; | ||||
484 | } | ||||
485 | } | ||||
486 | |||||
487 | leaf-list ll12 { | ||||
488 | type def5; | ||||
489 | } | ||||
sonugupta-huawei | 35540a3 | 2017-08-22 16:18:50 +0530 | [diff] [blame] | 490 | |
491 | leaf-list ll13 { | ||||
492 | type def1; | ||||
493 | } | ||||
surya-huawei | a762e29 | 2017-08-25 23:00:41 +0530 | [diff] [blame^] | 494 | |
495 | leaf-list ll14 { | ||||
496 | type def6; | ||||
497 | } | ||||
498 | |||||
499 | leaf-list ll15 { | ||||
500 | type def7; | ||||
501 | } | ||||
janani b | 99fccd7 | 2017-07-13 19:14:44 +0530 | [diff] [blame] | 502 | } |
503 | } |