Merge "Refactored ModuleBuilder to avoid name conflicts. Fixed implementation of...
[controller.git] / opendaylight / sal / yang-prototype / code-generator / maven-yang-plugin-it / src / test / resources / GenerateTest1 / src / main / resources / testfile2.yang
1 module types2 {
2     yang-version 1;
3     namespace "urn:simple.types.data.demo";
4     prefix "t2";
5     
6     organization "opendaylight";
7     contact "http://www.opendaylight.org/";
8     
9     description "This is types-data test description";
10
11     revision "2013-02-27" {
12         reference " WILL BE DEFINED LATER";
13     }
14     
15     typedef my-base-int32-type {
16         type int32 {
17             range "2..20";
18         }
19     }
20
21     typedef my-type1 {
22         type my-base-int32-type {
23             range "11..max";
24         }
25         units "mile";
26         default "11";
27     }
28     
29     typedef my-custom-string {
30         type string {
31             pattern "[a-k]*";
32             length "5..11";
33         }
34     }
35     
36     typedef my-string-type {
37         type my-custom-string {
38             length "5..10";
39         }
40     }
41     
42     typedef my-string-type2 {
43         type my-string-type {
44             pattern "[b-u]*";
45         }
46     }
47
48     typedef my-string-type-ext {
49         type my-string-type2 {
50             pattern "[e-z]*";
51         }
52     }
53
54     typedef my-int-type {
55         type int32 {
56             range "10..20";
57         }
58     }
59     
60     typedef my-int-type2 {
61         type my-int-type {
62             range "12..18";
63         }
64     }
65     
66     typedef my-int-type-ext {
67         type my-int-type2 {
68             range "14..16";
69         }
70     }
71     
72     typedef my-decimal-type {
73         type decimal64 {
74             fraction-digits 6;
75         }
76     }
77     
78     typedef my-decimal-type-ext {
79         type decimal64 {
80             fraction-digits 5;
81         }
82     }
83
84     typedef my-union {
85         type union {
86                 type int16 {
87                         range "1..100";
88                 }
89                 type int32;
90         }
91     }
92
93     typedef my-union-ext {
94         type my-union;
95     }
96
97     typedef nested-union1 {
98         type nested-union2;
99     }
100
101     typedef nested-union2 {
102         type union {
103                 type my-union-ext;
104                 type string;
105         }
106     }
107
108     leaf if-name {
109         type leafref {
110             path "/interface/name";
111         }
112     }
113      
114     leaf name {
115         type string;
116     }
117      
118     leaf nested-type-leaf {
119         type my-type1;
120     }
121     
122     extension c-define {
123         description
124         "Takes as argument a name string.
125         Makes the code generator use the given name in the
126         #define.";
127         argument "name" {
128             yin-element "true";
129         }
130     }
131     
132     container system {
133         leaf user {
134             type string;
135         }
136     }
137     
138     grouping target {
139         leaf address {
140             type string;
141             description "Target IP address";
142         }
143         container port {
144             description "Target port container";
145         }
146     }
147
148     container peer {
149         container destination {
150             uses target {
151                 refine address {
152                     default "1.2.3.4";
153                 }
154                 refine port {
155                     description "new port description updated by refine";
156                 }
157             }
158         }
159     }
160     
161     container interfaces {
162          list ifEntry {
163              key "ifIndex";
164
165              leaf ifIndex {
166                  type uint32;
167                  units minutes;
168              }
169              
170              leaf ifMtu {
171                  type int32;
172              }
173          }
174     }
175
176 }