Refresh topology models and make them build
[mdsal.git] / model / ietf / ietf-topology-l3-unicast-igp / src / main / yang / l3-unicast-igp-topology@2013-10-21.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-10-21;
9     }
10
11     import ietf-inet-types {
12         prefix "inet";
13     }
14
15     organization "TBD";
16     contact "TBD";
17
18     revision "2013-10-21" {
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
50         type identityref {
51             base "flag-identity";
52         }
53     }
54
55     grouping igp-prefix-attributes {
56         leaf prefix {
57             type inet:ip-prefix;
58         }
59         leaf metric {
60             type uint32;
61         }
62         leaf-list flag {
63             type flag-type;
64         }
65     }
66
67     grouping l3-unicast-igp-topology-type {
68         container l3-unicast-igp-topology {
69             presence "indicates L3 Unicast IGP Topology";
70         }
71     }
72
73     grouping igp-topology-attributes {
74         container igp-topology-attributes {
75             leaf name {
76                 description "Name of the topology";
77                     type string;
78             }
79             leaf-list flag {
80                 description "Topology flags";
81                 type flag-type;
82             }
83         }
84     }
85
86     grouping igp-node-attributes {
87         container igp-node-attributes {
88             leaf name {
89                 description "Node name";
90                 type inet:domain-name;
91             }
92             leaf-list flag {
93                 description "Node operational flags";
94                 type flag-type;
95             }
96             leaf-list router-id {
97                 description "Router-id for the node";
98
99                 type inet:ip-address;
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         }
152     } // grouping igp-termination-point-attributes
153
154
155     augment "/nt:network-topology/nt:topology/nt:topology-types" {
156         uses l3-unicast-igp-topology-type;
157     }
158
159     augment "/nt:network-topology/nt:topology" {
160         when "nt:topology-types/l3-unicast-igp-topology";
161         uses igp-topology-attributes;
162     }
163
164     augment "/nt:network-topology/nt:topology/nt:node" {
165         when "../nt:topology-types/l3-unicast-igp-topology";
166         uses igp-node-attributes;
167     }
168     augment "/nt:network-topology/nt:topology/nt:link" {
169         when "../nt:topology-types/l3-unicast-igp-topology";
170         uses igp-link-attributes;
171     }
172     augment "/nt:network-topology/nt:topology/nt:node/nt:termination-point" {
173         when "../../nt:topology-types/l3-unicast-igp-topology";
174         uses igp-termination-point-attributes;
175     }
176
177     notification igp-node-event {
178         leaf igp-event-type {
179             type igp-event-type;
180         }
181         leaf topology-ref {
182             type nt:topology-ref;
183         }
184         uses l3-unicast-igp-topology-type;
185         uses nt:node-attributes;
186         uses igp-node-attributes;
187     }
188
189     notification igp-link-event {
190         leaf igp-event-type {
191             type igp-event-type;
192         }
193         leaf topology-ref {
194             type nt:topology-ref;
195         }
196
197         uses l3-unicast-igp-topology-type;
198         uses nt:link-attributes;
199         uses igp-link-attributes;
200     }
201
202     notification igp-prefix-event {
203         leaf igp-event-type {
204             type igp-event-type;
205         }
206         leaf topology-ref {
207             type nt:topology-ref;
208         }
209         leaf node-ref {
210             type nt:node-ref;
211         }
212         uses l3-unicast-igp-topology-type;
213         container prefix {
214             uses igp-prefix-attributes;
215         }
216     }
217
218     notification termination-point-event {
219         leaf igp-event-type {
220             type igp-event-type;
221         }
222         leaf topology-ref {
223             type nt:topology-ref;
224         }
225         leaf node-ref {
226             type nt:node-ref;
227         }
228         uses l3-unicast-igp-topology-type;
229         uses nt:tp-attributes;
230         uses igp-termination-point-attributes;
231     }
232 }