Upgrade Network model from 2.1 to 4.1
[transportpce.git] / ordmodels / network / src / main / yang / org-openroadm-network-topology@2018-11-30.yang
1 module org-openroadm-network-topology {
2   yang-version 1.1;
3   namespace "http://org/openroadm/network/topology";
4   prefix topo;
5
6   import ietf-network {
7     prefix nd;
8     revision-date 2018-02-26;
9   }
10   import ietf-network-topology {
11     prefix nwt;
12     revision-date 2018-02-26;
13   }
14   import org-openroadm-network-types {
15     prefix org-openroadm-network-types;
16     revision-date 2018-11-30;
17   }
18   import org-openroadm-srg {
19     prefix srg;
20     revision-date 2018-11-30;
21   }
22   import org-openroadm-degree {
23     prefix dgr;
24     revision-date 2018-11-30;
25   }
26   import org-openroadm-xponder {
27     prefix xpdr;
28     revision-date 2018-11-30;
29   }
30   import org-openroadm-external-pluggable {
31     prefix plg;
32     revision-date 2018-11-30;
33   }
34   import org-openroadm-link {
35     prefix link;
36     revision-date 2018-11-30;
37   }
38   import org-openroadm-common-state-types {
39     prefix org-openroadm-common-state-types;
40     revision-date 2018-11-30;
41   }
42   import org-openroadm-common-network {
43     prefix cnet;
44     revision-date 2018-11-30;
45   }
46
47   organization
48     "OPEN ROADM MSA";
49   contact
50     "OpenROADM.org.";
51   description
52     "YANG definitions for network view of a ROADM
53
54      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
55      All other rights reserved.
56
57      Redistribution and use in source and binary forms, with or without modification,
58      are permitted provided that the following conditions are met:
59
60      * Redistributions of source code must retain the above copyright notice, this
61        list of conditions and the following disclaimer.
62      * Redistributions in binary form must reproduce the above copyright notice,
63        this list of conditions and the following disclaimer in the documentation and/or
64        other materials provided with the distribution.
65      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
66        contributors may be used to endorse or promote products derived from this software
67        without specific prior written permission.
68
69      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
70      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
71      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
72      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
73      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
74      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
75      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
76      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
77      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
78      POSSIBILITY OF SUCH DAMAGE.";
79
80   revision 2018-11-30 {
81     description
82       "Version 4.1.0";
83   }
84   revision 2018-09-28 {
85     description
86       "Version 4.0.0";
87   }
88   revision 2018-05-30 {
89     description
90       "Version 3.1.0";
91   }
92   revision 2018-03-30 {
93     description
94       "Version 3.0.0";
95   }
96   revision 2017-12-15 {
97     description
98       "Version 2.2";
99   }
100   revision 2017-09-29 {
101     description
102       "Version 2.1";
103   }
104   revision 2017-07-28 {
105     description
106       "Version 2.0.1 - added revision-date to imports";
107   }
108   revision 2017-06-26 {
109     description
110       "Version 2.0";
111   }
112
113   deviation "/nd:networks/nd:network/nd:node/cnet:node-type" {
114     deviate add {
115       must
116         "(not /nd:networks/nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-topology) or
117          (/nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-topology and
118          (../cnet:node-type = 'DEGREE' or ../cnet:node-type = 'SRG' or ../cnet:node-type = 'TPDR' or ../cnet:node-type = 'SWITCH' or
119           ../cnet:node-type = 'REGEN' or ../cnet:node-type = 'REGEN-UNI' or ../cnet:node-type = 'EXT-PLUGGABLE' or
120           ../cnet:node-type = 'MUXPDR'))" {
121         error-message "Invalid node type for openroadm-topology";
122         description
123           "The valid node types in the ROADM topology are 'SRG', 'DEGREE',
124            'TPDR', 'SWITCH', 'REGEN', 'REGEN-UNI', 'EXT-PLUGGABLE' and 'MUXPDR'";
125       }
126     }
127   }
128   deviation "/nd:networks/nd:network/nd:node/nwt:termination-point/cnet:tp-type" {
129     description
130       "Defines which TP types can be instantiated on which Node types";
131     deviate add {
132       must
133         "/nd:network/nd:node/cnet:node-type != 'DEGREE' or (../../cnet:node-type = 'DEGREE'  and
134          (../cnet:tp-type = 'DEGREE-TX-TTP' or ../cnet:tp-type = 'DEGREE-RX-TTP' or  ../cnet:tp-type = 'DEGREE-TXRX-TTP' or
135          ../cnet:tp-type = 'DEGREE-TX-CTP' or ../cnet:tp-type = 'DEGREE-RX-CTP' or ../cnet:tp-type = 'DEGREE-TXRX-CTP'))" {
136         error-message "Invalid TP for node type 'DEGREE'";
137       }
138       must
139         "/nd:network/nd:node/cnet:node-type != 'SRG' or (../../cnet:node-type = 'SRG' and
140          (../cnet:tp-type = 'SRG-TX-CP' or ../cnet:tp-type = 'SRG-RX-CP' or ../cnet:tp-type = 'SRG-TXRX-CP' or
141          ../cnet:tp-type = 'SRG-RX-PP' or ../cnet:tp-type = 'SRG-TX-PP' or ../cnet:tp-type = 'SRG-TXRX-PP'))" {
142         error-message "Invalid TP for node type 'SRG'";
143       }
144       must
145         " (/nd:network/nd:node/cnet:node-type != 'TPDR' and ../../cnet:node-type != 'MUXPDR' and ../../cnet:node-type != 'REGEN' and
146          ../../cnet:node-type != 'REGEN-UNI' and ../../cnet:node-type != 'SWITCH')
147          or ((../../cnet:node-type = 'TPDR' or ../../cnet:node-type = 'MUXPDR' or ../../cnet:node-type = 'REGEN' or
148          ../../cnet:node-type = 'REGEN-UNI' or ../../cnet:node-type = 'SWITCH') and
149          (../cnet:tp-type = 'XPONDER-NETWORK' or ../cnet:tp-type = 'XPONDER-CLIENT' or ../cnet:tp-type = 'XPONDER-PORT'))" {
150         error-message "Invalid TP for node type 'XPONDER'";
151       }
152       must "/nd:network/nd:node/cnet:node-type != 'EXT-PLUGGABLE' or (../../cnet:node-type = 'EXT-PLUGGABLE' and ../cnet:tp-type = 'EXT-PLUGGABLE-TP')" {
153         error-message "Invalid TP for node type 'EXT-PLUGGABLE'";
154       }
155     }
156   }
157   deviation "/nd:networks/nd:network/nwt:link/cnet:link-type" {
158     deviate add {
159       must
160         "(not /nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-topology) or
161          (/nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-topology and
162          (../cnet:link-type = 'ROADM-TO-ROADM' or ../cnet:link-type = 'ADD-LINK' or ../cnet:link-type = 'DROP-LINK' or
163           ../cnet:link-type = 'EXPRESS-LINK' or ../cnet:link-type = 'XPONDER-INPUT' or ../cnet:link-type = 'XPONDER-OUTPUT'))" {
164         error-message "Invalid link type for openroadm-topology";
165         description
166           "The valid link types in the ROADM topology are 'ROADM-TO-ROADM', 'ADD-LINK',
167            'DROP-LINK', 'EXPRESS-LINK', 'XPONDER-INPUT', 'XPONDER-OUTPUT'";
168       }
169     }
170   }
171   augment "/nd:networks/nd:network/nd:network-types/cnet:openroadm-common-network" {
172     description
173       "Introduce new network type for the Open ROADM optical
174        `     network topology";
175     container openroadm-topology {
176       presence "indicates optical network topology for Open ROADMs";
177     }
178   }
179   augment "/nd:networks/nd:network/nd:node" {
180     when "../nd:network-types/cnet:openroadm-common-network/openroadm-topology";
181     description
182       "This augmentations adds the ROADM Node type to the generic node
183        definition and defines node-specific attributes for each node type
184        in the ROADM Topology.";
185     leaf node-type {
186       type org-openroadm-network-types:openroadm-node-type;
187       must
188         "(../node-type = 'DEGREE' or ../node-type = 'SRG' or ../node-type = 'TPDR' or ../node-type = 'SWITCH' or
189           ../node-type = 'REGEN' or ../node-type = 'REGEN-UNI' or ../node-type = 'EXT-PLUGGABLE' or
190           ../node-type = 'MUXPDR')" {
191         error-message "Invalid node type for openroadm-topology";
192       }
193       status deprecated;
194       description
195         "The type of a node in the ROADM topology. Valid node types are 'SRG', 'DEGREE',
196          'TPDR', 'SWITCH', 'REGEN', 'REGEN-UNI', 'EXT-PLUGGABLE' and 'MUXPDR'";
197     }
198     container srg-attributes {
199       when "../cnet:node-type = 'SRG'";
200       description
201         "Topology-related attributes for SRG nodes";
202       uses srg:srg-node-attributes;
203     }
204     container degree-attributes {
205       when "../cnet:node-type = 'DEGREE'";
206       description
207         "Topology-related attributes for degree nodes";
208       uses dgr:degree-node-attributes;
209     }
210     container xpdr-attributes {
211       when
212         "../cnet:node-type = 'TPDR' or ../cnet:node-type = 'MUXPDR' or ../cnet:node-type = 'REGEN' or
213          ../cnet:node-type = 'REGEN-UNI' or ../cnet:node-type = 'SWITCH'";
214       description
215         "Topology-related attributes for Xponder nodes";
216       uses xpdr:xpdr-topo-node-attributes;
217     }
218   }
219   augment "/nd:networks/nd:network/nd:node/nwt:termination-point" {
220     when "../../nd:network-types/cnet:openroadm-common-network/openroadm-topology";
221     description
222       "Defines the type of a termination point in the ROADM topology and
223        TP-specific attributes for each termination point type.";
224     leaf tp-type {
225       type org-openroadm-network-types:openroadm-tp-type;
226       must
227         "../../topo:node-type != 'DEGREE' or (../../topo:node-type = 'DEGREE'  and
228          (../topo:tp-type = 'DEGREE-TX-TTP' or ../topo:tp-type = 'DEGREE-RX-TTP' or  ../topo:tp-type = 'DEGREE-TXRX-TTP' or
229          ../topo:tp-type = 'DEGREE-TX-CTP' or ../topo:tp-type = 'DEGREE-RX-CTP' or ../topo:tp-type = 'DEGREE-TXRX-CTP'))" {
230         error-message "Invalid TP for node type 'DEGREE'";
231       }
232       must
233         "../../topo:node-type != 'SRG' or (../../topo:node-type = 'SRG' and
234          (../topo:tp-type = 'SRG-TX-CP' or ../topo:tp-type = 'SRG-RX-CP' or ../topo:tp-type = 'SRG-TXRX-CP' or
235          ../topo:tp-type = 'SRG-RX-PP' or ../topo:tp-type = 'SRG-TX-PP' or ../topo:tp-type = 'SRG-TXRX-PP'))" {
236         error-message "Invalid TP for node type 'SRG'";
237       }
238       must
239         " (../../topo:node-type != 'TPDR' and ../../topo:node-type != 'MUXPDR' and ../../topo:node-type != 'REGEN' and
240          ../../topo:node-type != 'REGEN-UNI' and ../../topo:node-type != 'SWITCH')
241          or ((../../topo:node-type = 'TPDR' or ../../topo:node-type = 'MUXPDR' or ../../topo:node-type = 'REGEN' or
242          ../../topo:node-type = 'REGEN-UNI' or ../../topo:node-type = 'SWITCH') and
243          (../topo:tp-type = 'XPONDER-NETWORK' or ../topo:tp-type = 'XPONDER-CLIENT' or ../topo:tp-type = 'XPONDER-PORT'))" {
244         error-message "Invalid TP for node type 'XPONDER'";
245       }
246       must "../../topo:node-type != 'EXT-PLUGGABLE' or (../../topo:node-type = 'EXT-PLUGGABLE' and ../topo:tp-type = 'EXT-PLUGGABLE-TP')" {
247         error-message "Invalid TP for node type 'EXT-PLUGGABLE'";
248       }
249       status deprecated;
250       description
251         "The TP type; also defines which TP types can be instantiated
252          on which Node types";
253     }
254     container tx-ttp-attributes {
255       when "../cnet:tp-type = 'DEGREE-TX-TTP' or ../cnet:tp-type = 'DEGREE-TXRX-TTP'";
256       description
257         "There must be only one TP of type DEGREE-TX-TTP in any given
258          degree node";
259       uses dgr:degree-used-wavelengths;
260     }
261     container rx-ttp-attributes {
262       when "../cnet:tp-type = 'DEGREE-RX-TTP'";
263       description
264         "There must be only one TP of type DEGREE-RX-TTP in any given
265          degree node";
266       uses dgr:degree-used-wavelengths;
267     }
268     container ctp-attributes {
269       when "../cnet:tp-type = 'DEGREE-TX-CTP' or ../cnet:tp-type = 'DEGREE-RX-CTP' or ../cnet:tp-type = 'DEGREE-TXRX-CTP'";
270       uses dgr:degree-used-wavelengths;
271     }
272     container cp-attributes {
273       when "../cnet:tp-type = 'SRG-TX-CP' or ../cnet:tp-type = 'SRG-RX-CP' or ../cnet:tp-type = 'SRG-TXRX-CP'";
274       description
275         "This list is created to accommodate fixed grid (1.2.1) as well as flex grid (2.0 above). In case of fixed grid
276          index number will refer to one of the 96 WL defined in the wavelength map file. In case of flex grid this
277          will hold list of used spectra";
278       list used-wavelengths {
279         key "index";
280         uses org-openroadm-network-types:wavelengths;
281       }
282     }
283     container pp-attributes {
284       when "../cnet:tp-type = 'SRG-TXRX-PP' or ../cnet:tp-type = 'SRG-TX-PP' or ../cnet:tp-type = 'SRG-RX-PP' ";
285       description
286         "This list is created to accommodate fixed grid (1.2.1) as well as flex grid (2.0 above). In case of fixed grid
287          index number will refer to one of the 96 WL defined in the wavelength map file. In case of flex grid this
288          will hold list of used spectra";
289       list used-wavelength {
290         key "index";
291         uses org-openroadm-network-types:wavelengths;
292       }
293     }
294     leaf eqpt-srg-id {
295       when
296         "../cnet:tp-type = 'XPONDER-CLIENT' or ../cnet:tp-type = 'XPONDER-NETWORK' or ../cnet:tp-type = 'EXT-PLUGGABLE-TP' or
297          ../cnet:tp-type = 'XPONDER-PORT'";
298       type uint32;
299       status deprecated;
300       description
301         "Shared Risk Group identifier. All ports in a circuit-pack will have same srg-id";
302     }
303     container xpdr-client-attributes {
304       when "../../topo:node-type = 'TPDR' and ../cnet:tp-type = 'XPONDER-CLIENT'";
305       description
306         "Topology layer will allow client TPs only for Transponder nodes";
307       uses xpdr:xpdr-connection-attributes;
308       uses xpdr:xpdr-port-connection-attributes;
309     }
310     container xpdr-network-attributes {
311       when "../cnet:tp-type = 'XPONDER-NETWORK'";
312       uses xpdr:xpdr-connection-attributes;
313       uses xpdr:xpdr-port-connection-attributes;
314     }
315     container xpdr-port-attributes {
316       when "../cnet:tp-type = 'XPONDER-PORT'";
317       uses xpdr:xpdr-connection-attributes;
318       uses xpdr:xpdr-port-connection-attributes;
319     }
320     container ext-pluggable-attributes {
321       when "../cnet:tp-type = 'EXT-PLUGGABLE-TP'";
322       uses plg:pluggable-tp-attributes;
323     }
324   }
325   augment "/nd:networks/nd:network/nwt:link" {
326     when "../nd:network-types/cnet:openroadm-common-network/openroadm-topology";
327     description
328       "This augmentation defines ROADM link types in the ROADM topology";
329     leaf link-type {
330       type org-openroadm-network-types:openroadm-link-type;
331       must
332         "(../link-type = 'ROADM-TO-ROADM' or ../link-type = 'ADD-LINK' or ../link-type = 'DROP-LINK' or
333           ../link-type = 'EXPRESS-LINK' or ../link-type = 'XPONDER-INPUT' or ../link-type = 'XPONDER-OUTPUT')" {
334         error-message "Invalid link type for openroadm-topology";
335       }
336       status deprecated;
337     }
338     leaf link-length {
339       type decimal64 {
340         fraction-digits 2;
341       }
342       status deprecated;
343     }
344     leaf administrative-group {
345       type uint32;
346       status deprecated;
347       description
348         "according to RFC 3630 definition";
349     }
350     leaf operational-state {
351       type org-openroadm-common-state-types:state;
352       status deprecated;
353     }
354     leaf administrative-state {
355       type org-openroadm-common-state-types:state;
356       status deprecated;
357     }
358     leaf link-latency {
359       type uint32;
360       status deprecated;
361       description
362         "Latency of a link";
363     }
364     leaf amplified {
365       when "../cnet:link-type = 'ROADM-TO-ROADM'";
366       type boolean;
367       description
368         "defines whether an ROADM-TO-ROADM Link includes line amplifiers or not";
369     }
370     leaf TE-metric {
371       type uint32;
372       status deprecated;
373       description
374         "defines a Traffic Engineering metric which could be used for any type of link.
375          Supersedes TE-metric originally defined in OMS-attributes grouping";
376     }
377     leaf opposite-link {
378       type leafref {
379         path "../../nwt:link/nwt:link-id";
380       }
381       status deprecated;
382       description
383         "optional - pointer to reverse link in case of bidirectional link. Supersedes opposite-link
384          originally defined in OMS-attributes container, to apply to any kind of link in the topology";
385     }
386     container OMS-attributes {
387       when "../cnet:link-type = 'ROADM-TO-ROADM'";
388       description
389         "";
390       uses link:OMS-attributes;
391       leaf opposite-link {
392         type leafref {
393           path "../../../nwt:link/nwt:link-id";
394         }
395         status deprecated;
396         description
397           "optional - pointer to reverse link in case of bidirectional link";
398       }
399       container span {
400         when "../../amplified = 'false'";
401         description
402           "";
403         uses link:span-attributes;
404       }
405       container amplified-link {
406         when "../../amplified = 'true'";
407         description
408           "when amplified is set to true, rather than a simple OMS section
409            we have an amplified link";
410         uses link:amplified-link-attributes;
411       }
412     }
413   }
414 }