Merge "Fix junit dependencies in poms. Reuse existing from parent, add missing ones."
[bgpcep.git] / topology / api / src / main / yang / l3-unicast-igp-topology.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     }
9
10     import ietf-inet-types {
11         prefix "inet";
12     }
13
14     organization "TBD";
15     contact "TBD";
16
17     revision "2013-10-21" {
18         description "Initial revision";
19         reference "TBD";
20     }
21
22     typedef igp-event-type {
23         description "IGP Event type for notifications";
24             type enumeration {
25                 enum "add" {
26                     value 0;
27                         description "An IGP node or link or prefix or termination-point has been added";
28                 }
29                 enum "remove" {
30                     value 1;
31                     description "An IGP node or link or prefix or termination-point has been removed";
32                 }
33                 enum "update" {
34                     value 2;
35                     description "An IGP node or link or prefix or termination-point has been updated";
36                 }
37             }
38         } // igp-event-type
39
40     identity flag-identity {
41         description "Base type for flags";
42     }
43     identity undefined-flag {
44         base "flag-identity";
45     }
46
47     typedef flag-type {
48
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             leaf-list router-id {
96                 description "Router-id for the node";
97
98                 type inet:ip-address;
99             }
100             list prefix {
101                 key "prefix";
102                 uses igp-prefix-attributes;
103             }
104         }
105     }
106
107     grouping igp-link-attributes {
108         container igp-link-attributes {
109             leaf name {
110                 description "Link Name";
111                 type string;
112             }
113             leaf-list flag {
114                 description "Link flags";
115                 type flag-type;
116             }
117             leaf metric {
118                 description "Link Metric";
119                 type uint32 {
120                     range "0..16777215"  {
121                         description "
122                         ";
123                         // OSPF/ISIS supports max 3 byte metric.
124                         // Ideally we would like this restriction to be
125                         // defined in the derived models, however,
126                         // we are not allowed to augment a "must" statement.
127                     }
128                 }
129             }
130         }
131     } // grouping igp-link-attributes
132
133     grouping igp-termination-point-attributes {
134         container igp-termination-point-attributes {
135             choice termination-point-type {
136                 case ip {
137                    leaf-list ip-address {
138                     description "IPv4 or IPv6 address";
139                     type inet:ip-address;
140                     }
141                 }
142                 case unnumbered {
143                     leaf unnumbered-id {
144                     description "Unnumbered interface identifier";
145                     type uint32;
146
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     augment "/nt:network-topology/nt:topology" {
159         when "nt:topology-types/l3-unicast-igp-topology";
160         uses igp-topology-attributes;
161     }
162
163     augment "/nt:network-topology/nt:topology/nt:node" {
164         when "../nt:topology-types/l3-unicast-igp-topology";
165         uses igp-node-attributes;
166     }
167     augment "/nt:network-topology/nt:topology/nt:link" {
168         when "../nt:topology-types/l3-unicast-igp-topology";
169         uses igp-link-attributes;
170     }
171     augment "/nt:network-topology/nt:topology/nt:node/nt:termination-point" {
172         when "../../nt:topology-types/l3-unicast-igp-topology";
173         uses igp-termination-point-attributes;
174     }
175
176     notification igp-node-event {
177         leaf igp-event-type {
178             type igp-event-type;
179         }
180         leaf topology-ref {
181             type nt:topology-ref;
182         }
183         uses l3-unicast-igp-topology-type;
184         uses nt:node-attributes;
185         uses igp-node-attributes;
186     }
187
188     notification igp-link-event {
189         leaf igp-event-type {
190             type igp-event-type;
191         }
192         leaf topology-ref {
193             type nt:topology-ref;
194         }
195
196         uses l3-unicast-igp-topology-type;
197         uses nt:link-attributes;
198         uses igp-link-attributes;
199     }
200
201     notification igp-prefix-event {
202         leaf igp-event-type {
203             type igp-event-type;
204         }
205         leaf topology-ref {
206             type nt:topology-ref;
207         }
208         leaf node-ref {
209             type nt:node-ref;
210         }
211         uses l3-unicast-igp-topology-type;
212         container prefix {
213             uses igp-prefix-attributes;
214         }
215     }
216
217     notification termination-point-event {
218         leaf igp-event-type {
219             type igp-event-type;
220         }
221         leaf topology-ref {
222             type nt:topology-ref;
223         }
224         leaf node-ref {
225             type nt:node-ref;
226         }
227         uses l3-unicast-igp-topology-type;
228         uses nt:tp-attributes;
229         uses igp-termination-point-attributes;
230     }
231 }