Add BitsTypeObject
[mdsal.git] / binding / mdsal-binding-test-model / src / main / yang / opendaylight-of-migration-test-model.yang
1 module opendaylight-of-migration-test-model {
2     yang-version 1.1;
3     namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:of-migration-test-model";
4     prefix of-migration-test;
5
6     import opendaylight-mdsal-binding-test {prefix test;}
7     import yang-ext {prefix ext;}
8     import opendaylight-mdsal-augment-test {prefix aug;}
9     import opendaylight-test-routed-rpc {prefix routed;}
10
11     description
12         "This module contains a collection of YANG definitions used for
13         test cases that used to depend on flow model.";
14
15     revision 2015-02-10 {
16     }
17
18     typedef bit-flags {
19         type bits {
20             bit FLAG_ONE;
21             bit FLAG_TWO;
22             bit FLAG_THREE;
23             bit FLAG_FOUR;
24             bit FLAG_FIVE;
25         }
26     }
27
28     typedef derived-bit-flags {
29         type bit-flags;
30     }
31
32     typedef restricted-bit-flags {
33         type derived-bit-flags {
34             bit FLAG_ONE;
35             bit FLAG_THREE;
36             bit FLAG_FIVE;
37         }
38     }
39
40     typedef custom-enum {
41         type enumeration {
42             enum type1;
43             enum type2;
44             enum type3;
45         }
46     }
47
48     grouping enum-grouping {
49         leaf attr-enum {
50             type custom-enum;
51         }
52     }
53
54     grouping aug-grouping {
55         container cont1 {
56             leaf attr-str {
57                 type string;
58             }
59         }
60
61         container cont2 {
62             list contlist1 {
63                 key "attr-str";
64
65                 leaf attr-str {
66                     type string;
67                 }
68
69                 uses enum-grouping;
70             }
71         }
72
73         leaf attr-str1 {
74             type string;
75         }
76
77         leaf attr-str2 {
78             type string;
79         }
80
81         leaf attr-str3 {
82             type string;
83         }
84
85         leaf attr-str4 {
86             type string;
87         }
88
89         list list1 {
90             key "attr-str";
91             leaf attr-str {
92                 type string;
93             }
94
95             list list1-1 {
96                 key "attr-int";
97                 leaf attr-int {
98                     type int32;
99                 }
100
101                 leaf attr-str {
102                     type string;
103                 }
104
105                 leaf flags {
106                     type bit-flags;
107                 }
108             }
109
110             list list1-2 {
111                 key "attr-int";
112                 leaf attr-int {
113                     type int32;
114                 }
115
116                 leaf attr-str {
117                     type string;
118                 }
119             }
120         }
121     }
122
123     augment "/test:top/test:top-level-list" {
124         ext:augment-identifier tll-complex-augment;
125         uses aug-grouping;
126     }
127
128     augment "/test:top/test:top-level-list/list1/list1-1"  {
129         ext:augment-identifier list11-simple-augment;
130
131         leaf attr-str2 {
132             type string;
133         }
134
135         container cont {
136             leaf attr-int {
137                 type int32;
138             }
139         }
140     }
141
142     augment "/test:top/test:top-level-list/test:nested-list/"  {
143         ext:augment-identifier nested-list-simple-augment;
144
145         leaf type {
146             type string;
147         }
148     }
149 }