blob: 4ab5801818991e14c3e4fa061ca0ba6b3b953028 [file] [log] [blame]
Vidyashree Rama6160be12016-11-24 13:43:31 +05301module uniontest {
2
3 yang-version 1;
4
5 namespace "ydt.uniontest";
6
7 prefix "uniontest";
8
9 organization "ON-LAB";
10
11 description "This module defines for union classifier.";
12
13 revision "2016-05-24" {
14 description "Initial revision.";
15 }
16
17 list unionList {
18 config false;
19 leaf id {
20 type union {
21 type int8;
22 type binary;
23 }
24 }
25 }
26
27 typedef percent {
28 type union {
29 type int8;
30 type bits {
31 bit bit0 {
32 position 0;
33 }
34 bit bit1 {
35 position 1;
36 }
37 bit bit2 {
38 position 2;
39 }
40 }
41 }
42 }
43
44 leaf name {
45 type percent;
46 }
47
48 grouping greeting {
49 leaf surname {
50 type union {
51 type int8;
52 type string;
53 }
54 }
55 }
56
57 container cont1 {
58 uses greeting;
59 }
60
61 augment "/cont1" {
62 leaf lastname {
63 type union {
64 type int8;
65 type bits {
66 bit bit0 {
67 position 0;
68 }
69 bit bit1 {
70 position 1;
71 }
72 bit bit2 {
73 position 2;
74 }
75 }
76 }
77 }
78 }
79
80 container food {
81 choice snack {
82 case sportsarena {
83 leaf pretzel {
84 type union {
85 type int8;
86 type binary;
87 }
88 }
89 }
90 }
91 }
92}