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