Adjust test suite parser update to conform with API changes
[yangtools.git] / yang / yang-parser-rfc7950 / src / test / resources / semantic-statement-parser / two-revisions / l3-unicast-igp-topology@2013-07-12.yang
1 module l3-unicast-igp-topology {
2     yang-version 1;
3     namespace "urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology";
4     // replace with IANA namespace when assigned
5     prefix "l3t";
6     import network-topology {
7         prefix "nt";
8         revision-date 2013-07-12;
9     }
10     
11     import ietf-inet-types {
12         prefix "inet";
13     }
14
15     organization "TBD";
16     contact "TBD";
17
18     revision "2013-07-12" {
19         description "Initial revision";
20         reference "TBD";
21     }
22     
23     typedef igp-event-type {
24         description "IGP Event type for notifications";
25         type enumeration {
26             enum "add" {
27                 value 0;
28                     description "An IGP node or link or prefix or termination-point has been added";
29             }
30             enum "remove" {
31                 value 1;
32                 description "An IGP node or link or prefix or termination-point has been removed";
33             }
34             enum "update" {
35                 value 2;
36                 description "An IGP node or link or prefix or termination-point has been updated";
37             }
38         }
39     } // igp-event-type
40
41     identity flag-identity {
42         description "Base type for flags";
43     }
44     identity undefined-flag {
45         base "flag-identity";
46     }
47     
48     typedef flag-type {
49         type identityref {
50             base "flag-identity";
51         }
52     }
53     
54     grouping igp-prefix-attributes {
55         leaf prefix {
56             type inet:ip-prefix;
57         }
58         leaf metric {
59             type uint32;
60         }
61         leaf-list flag {
62             type flag-type;
63         }
64     }
65     
66     grouping l3-unicast-igp-topology-type {
67         container l3-unicast-igp-topology {
68             presence "indicates L3 Unicast IGP Topology";
69         }
70     }
71     
72     grouping igp-topology-attributes {
73         container igp-topology-attributes { 
74             leaf name {
75                 description "Name of the topology";
76                     type string;
77             }
78             leaf-list flag {
79                 description "Topology flags";
80                 type flag-type;
81             }
82         }
83     }
84
85     grouping igp-node-attributes {
86         container igp-node-attributes {
87             leaf name {
88                 description "Node name";
89                 type inet:domain-name; 
90             }
91             leaf-list flag {
92                 description "Node operational flags";
93                 type flag-type; 
94             }
95             
96             leaf-list router-id {
97                 description "Router-id for the node";
98                 type inet:ip-address;
99             }
100             
101             list prefix {  
102                 key "prefix";
103                 uses igp-prefix-attributes; 
104             }
105         }
106     }
107
108     grouping igp-link-attributes {
109         container igp-link-attributes { 
110             leaf name {
111                 description "Link Name";
112                 type string;
113             }
114             leaf-list flag {
115                 description "Link flags";
116                 type flag-type; 
117             }
118             leaf metric {
119                 description "Link Metric";
120                 type uint32 {
121                     range "0..16777215"  {
122                         description "
123                         "; 
124                         // OSPF/ISIS supports max 3 byte metric. 
125                         // Ideally we would like this restriction to be
126                         // defined in the derived models, however,  
127                         // we are not allowed to augment a "must" statement. 
128                     }
129                 }
130             }
131         }
132     } // grouping igp-link-attributes
133
134     grouping igp-termination-point-attributes {
135         container igp-termination-point-attributes {
136             choice termination-point-type {  
137                 case ip {
138                    leaf-list ip-address {
139                     description "IPv4 or IPv6 address";
140                     type inet:ip-address;
141                     }
142                 }
143                 case unnumbered {
144                     leaf unnumbered-id {  
145                     description "Unnumbered interface identifier";
146                     type uint32;
147                     }
148                 }
149             }
150         }
151     } // grouping igp-termination-point-attributes
152     
153     
154     augment "/nt:network-topology/nt:topology/nt:topology-types" {  
155         uses l3-unicast-igp-topology-type; 
156     }
157     
158     
159     augment "/nt:network-topology/nt:topology" {
160         when "topology-types/l3-unicast-igp-topology";
161         uses igp-topology-attributes;  
162     }
163     
164     augment "/nt:network-topology/nt:topology/nt:node" {
165         when "../../topology-types/l3-unicast-igp-topology";
166         uses igp-node-attributes; 
167     }
168     
169
170     augment "/nt:network-topology/nt:topology/nt:link" {
171         when "../../topology-types/l3-unicast-igp-topology";
172         uses igp-link-attributes; 
173     }
174     augment "/nt:network-topology/nt:topology/nt:node/nt:termination-point" {
175         when "../../topology-types/l3-unicast-igp-topology";
176         uses igp-termination-point-attributes; 
177     }
178     
179     notification igp-node-event {
180         leaf igp-event-type {
181             type igp-event-type;
182         }
183         leaf topology-ref {
184             type nt:topology-ref;
185         }
186         uses l3-unicast-igp-topology-type; 
187         uses nt:node-attributes;
188         uses igp-node-attributes;
189     }
190
191     notification igp-link-event {
192         leaf igp-event-type {
193             type igp-event-type;
194         }
195         leaf topology-ref {
196             type nt:topology-ref;
197         }
198         uses l3-unicast-igp-topology-type; 
199         uses nt:link-attributes; 
200         uses igp-link-attributes; 
201     }
202
203     notification igp-prefix-event {
204         leaf igp-event-type {
205             type igp-event-type;
206         }
207         leaf topology-ref {
208             type nt:topology-ref;
209         }
210         leaf node-ref {
211             type nt:node-ref;
212         }
213         uses l3-unicast-igp-topology-type; 
214         container prefix {
215             uses igp-prefix-attributes;
216         }
217     }   
218
219     notification termination-point-event {
220         leaf igp-event-type {
221             type igp-event-type;
222         }
223         leaf topology-ref {
224             type nt:topology-ref;
225         }
226         leaf node-ref {
227             type nt:node-ref;
228         }
229         uses l3-unicast-igp-topology-type;
230         uses nt:tp-attributes;
231         uses igp-termination-point-attributes;
232     }
233 }