Merge "Refactor frontend JS"
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / test / resources / model / testfile2.yang
1 module types2 {
2     yang-version 1;
3     namespace "urn:simple.types.data.demo";
4     prefix "t2";
5     
6     import types1 {
7          prefix "if";
8          revision-date 2013-02-27;
9      }
10
11     organization "opendaylight";
12     contact "WILL-BE-DEFINED-LATER";
13     description "This is types-data test description";
14
15     revision "2013-02-27" {
16         reference " WILL BE DEFINED LATER";
17     }
18     
19     typedef my-base-int32-type {
20         type int32 {
21             range "2..20";
22         }
23     }
24
25     typedef my-type1 {
26         type my-base-int32-type {
27             range "11..max";
28         }
29         units "mile";
30         default "11";
31     }
32     
33     typedef my-custom-string {
34         type string {
35             pattern "[a-k]*";
36             length "5..11";
37         }
38     }
39     
40     typedef my-string-type {
41         type my-custom-string {
42             length "5..10";
43         }
44     }
45     
46     typedef my-string-type2 {
47         type my-string-type {
48             pattern "[b-u]*";
49         }
50     }
51
52     typedef my-string-type-ext {
53         type my-string-type2 {
54             pattern "[e-z]*";
55         }
56     }
57
58     typedef my-int-type {
59         type int32 {
60             range "10..20";
61         }
62     }
63     
64     typedef my-int-type2 {
65         type my-int-type {
66             range "12..18";
67         }
68     }
69     
70     typedef my-int-type-ext {
71         type my-int-type2 {
72             range "14..16";
73         }
74     }
75     
76     typedef my-decimal-type {
77         type decimal64 {
78             fraction-digits 6;
79         }
80     }
81     
82     typedef my-decimal-type-ext {
83         type decimal64 {
84             fraction-digits 5;
85         }
86     }
87
88     typedef my-union {
89         type union {
90                 type int16 {
91                         range "1..100";
92                 }
93                 type int32;
94         }
95     }
96
97     typedef my-union-ext {
98         type my-union;
99     }
100
101     typedef nested-union1 {
102         type nested-union2;
103     }
104
105     typedef nested-union2 {
106         type union {
107                 type my-union-ext;
108                 type string;
109         }
110     }
111
112     augment "/if:interfaces/if:ifEntry" {
113         when "if:ifType='ds0'";
114         leaf ds0ChannelNumber {
115             type string;
116         }
117     }
118
119     leaf if-name {
120         type leafref {
121             path "/interface/name";
122         }
123     }
124      
125     leaf name {
126         type string;
127     }
128      
129     leaf nested-type-leaf {
130         type my-type1;
131     }
132     
133     extension c-define {
134         description
135         "Takes as argument a name string.
136         Makes the code generator use the given name in the
137         #define.";
138         argument "name" {
139             yin-element "true";
140         }
141     }
142     
143     container system {
144         leaf user {
145             type string;
146         }
147     }
148
149 }