Fixed schema path of types in augment statements.
[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 "min..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             case interval {
80                 leaf interval {
81                     type uint16;
82                     default 30;
83                     units minutes;
84                 }
85             }
86             case daily {
87                 leaf daily {
88                     type empty;
89                 }
90                 leaf time-of-day {
91                     type string;
92                     units 24-hour-clock;
93                     default 1am;
94                 }
95             }
96             case manual {
97                 leaf manual {
98                     type empty;
99                 }
100             }
101         }
102     }
103
104     anyxml data {
105         description
106           "Copy of the source datastore subset that matched
107            the filter criteria (if any).  An empty data container
108            indicates that the request did not produce any results.";
109     }
110
111     augment "/data:interfaces/data:ifEntry/t3:augment-holder" {
112         when "if:ifType='ds0'";
113         leaf ds0ChannelNumber {
114             type string;
115         }
116         leaf interface-id {
117             type leafref {
118                 path "/if:interfaces/if:interface/if:name";
119             }
120         }
121         leaf-list higher-layer-if {
122             type leafref {
123                 path "/if:interfaces/if:interface/if:higher-layer-if";
124             }
125         }
126         leaf my-type {
127             type data:my-type1;
128         }
129     }
130     
131     container mycont {
132         container innercont {
133             typedef mytype {
134                 type string;
135             }
136         
137             leaf myleaf {
138                 type mytype;
139             }
140         }
141     }
142     
143 }