47e649112a26f07f973490f4ed26d139f1510d8d
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / test / resources / model / testfile1.yang
1 module types1 {
2     yang-version 1;
3     namespace "urn:simple.container.demo";
4     prefix "t1";
5
6     import types2 {
7         prefix "data";
8         revision-date 2013-02-27;
9     }
10
11    import types3 {
12         prefix "t3";
13         revision-date 2013-02-27;
14     }
15
16     organization "opendaylight";
17     contact "http://www.opendaylight.org/";
18
19     revision "2013-02-27" {
20         reference " WILL BE DEFINED LATER";
21     }
22
23     leaf testleaf {
24         type data:my-type1 {
25             range "12..max";
26         }
27     }
28
29     leaf test-string-leaf {
30         type data:my-string-type-ext;
31     }
32
33     leaf leaf-with-length {
34         type data:my-string-type {
35             length "7..max";
36         }
37     }
38
39     leaf test-int-leaf {
40         type data:my-int-type-ext;
41     }
42
43     leaf test-decimal-leaf {
44         type data:my-decimal-type {
45             fraction-digits 4;
46         }
47     }
48
49     leaf test-decimal-leaf2 {
50         type data:my-decimal-type-ext;
51     }
52
53     container ext {
54         data:c-define "MY_INTERFACES";
55     }
56
57     leaf union-leaf {
58         type data:my-union-ext;
59     }
60
61     deviation /data:system/data:user {
62         deviate add {
63             default "admin"; // new users are 'admin' by default
64             config "true";
65         }
66     }
67
68     leaf nested-union-leaf {
69         type data:nested-union1;
70     }
71
72     leaf custom-union-leaf {
73         type t3:union1;
74     }
75
76     container transfer {
77         choice how {
78             default interval;
79             container input {
80             }
81             list output {
82                 leaf id {
83                     type string;
84                 }
85             }
86             case interval {
87                 leaf interval {
88                     type uint16;
89                     default 30;
90                     units minutes;
91                 }
92             }
93             case daily {
94                 leaf daily {
95                     type empty;
96                 }
97                 leaf time-of-day {
98                     type string;
99                     units 24-hour-clock;
100                     default 1am;
101                 }
102             }
103             case manual {
104                 leaf manual {
105                     type empty;
106                 }
107             }
108         }
109     }
110
111     anyxml data {
112         description
113           "Copy of the source datastore subset that matched
114            the filter criteria (if any).  An empty data container
115            indicates that the request did not produce any results.";
116     }
117
118     augment "/data:interfaces/data:ifEntry/t3:augment-holder" {
119         when "if:ifType='ds0'";
120         leaf ds0ChannelNumber {
121             type string;
122         }
123         leaf interface-id {
124             type leafref {
125                 path "/if:interfaces/if:interface/if:name";
126             }
127         }
128         leaf-list higher-layer-if {
129             type leafref {
130                 path "/if:interfaces/if:interface/if:higher-layer-if";
131             }
132         }
133         leaf my-type {
134             type data:my-type1;
135         }
136         container schemas {
137         }
138         choice odl {
139             leaf id {
140                 type int8;
141             }
142         }
143     }
144     
145     container mycont {
146         container innercont {
147             typedef mytype {
148                 type string;
149             }
150         
151             leaf myleaf {
152                 type mytype;
153             }
154         }
155     }
156     
157 }