Merge "When a node is going down, remove edges in both directions associated with...
[controller.git] / opendaylight / sal / yang-prototype / yang / yang-model-parser-impl / src / test / resources / model / nodes.yang
1 module nodes {
2     yang-version 1;
3     namespace "urn:simple.nodes.test";
4     prefix "n";
5
6     import types {
7         prefix "t";
8         revision-date 2013-07-03;
9     }
10
11    import custom {
12         prefix "c";
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 int32-leaf {
24         type t:int32-ext2 {
25             range "12..max";
26         }
27     }
28
29     leaf string-leaf {
30         type t:string-ext4;
31     }
32
33     leaf length-leaf {
34         type t:string-ext2 {
35             length "7..max";
36         }
37     }
38
39     leaf decimal-leaf {
40         type t:my-decimal-type {
41             fraction-digits 4;
42         }
43     }
44
45     leaf decimal-leaf2 {
46         type t:my-decimal-type;
47     }
48
49     container ext {
50         types:c-define "MY_INTERFACES";
51     }
52
53     leaf union-leaf {
54         type t:my-union-ext;
55     }
56
57     deviation /t:interfaces/t:ifEntry {
58         deviate add {
59             default "admin"; // new users are 'admin' by default
60             config "true";
61         }
62         reference "system/user ref";
63     }
64
65     leaf custom-union-leaf {
66         type c:union1;
67     }
68
69     container transfer {
70         choice how {
71             default interval;
72             container input {
73             }
74             list output {
75                 leaf id {
76                     type string;
77                 }
78             }
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 datas {
105         description
106           "Copy of the source typesstore subset that matched
107            the filter criteria (if any).  An empty types container
108            indicates that the request did not produce any results.";
109         status obsolete;
110     }
111
112     augment "/t:interfaces/t:ifEntry/c:augment-holder" {
113         when "if:ifType='ds0'";
114         leaf ds0ChannelNumber {
115             type string;
116         }
117         leaf interface-id {
118             type leafref {
119                 path "/if:interfaces/if:interface/if:name";
120             }
121         }
122         leaf my-type {
123             type t:int32-ext2;
124         }
125         container schemas {
126         }
127         choice odl {
128             leaf id {
129                 type int8;
130             }
131             case node1 {
132                 description "node1";
133             }
134             case node2 {
135                 description "node2";
136             }
137             container node3 {
138                 description "node3";
139             }
140         }
141     }
142
143     container mycont {
144         container innercont {
145             typedef mytype {
146                 type string;
147             }
148             leaf myleaf {
149                 type mytype;
150             }
151         }
152     }
153
154     uses c:target {
155         augment "/mycont/innercont" {
156             description "inner augment";
157             leaf name {
158                 type string;
159             }
160         }
161     }
162
163     container peer {
164         container destination {
165             uses c:target {
166                 refine address {
167                     default "1.2.3.4";
168                     description "IP address of target node";
169                     reference "address reference added by refine";
170                     config false;
171                     mandatory true;
172                     must "ifType != 'ethernet' or " +
173                             "(ifType = 'ethernet' and ifMTU = 1500)" {
174                         error-message "An ethernet MTU must be 1500";
175                     }
176                 }
177                 refine port {
178                     description "description of port defined by refine";
179                     reference "port reference added by refine";
180                     config false;
181                     presence "presence is required";
182                 }
183                 refine addresses {
184                     description "description of addresses defined by refine";
185                     reference "addresses reference added by refine";
186                     config false;
187                     min-elements 2;
188                     max-elements 12;
189                 }
190                 refine target-inner {
191                     description "new target-inner grouping description";
192                 }
193                 refine group-type {
194                     description "new group-type description";
195                     reference "new group-type reference";
196                 }
197             }
198         }
199     }
200
201 }