Upgrade to OpenROADM 7.1.0 network models
[transportpce.git] / ordmodels / network / src / main / yang / org-openroadm-network-topology@2020-05-29.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 2020-05-29;
17   }
18   import org-openroadm-srg {
19     prefix srg;
20     revision-date 2020-05-29;
21   }
22   import org-openroadm-degree {
23     prefix dgr;
24     revision-date 2020-05-29;
25   }
26   import org-openroadm-xponder {
27     prefix xpdr;
28     revision-date 2020-05-29;
29   }
30   import org-openroadm-external-pluggable {
31     prefix plg;
32     revision-date 2020-05-29;
33   }
34   import org-openroadm-link {
35     prefix link;
36     revision-date 2020-05-29;
37   }
38   import org-openroadm-common-network {
39     prefix cnet;
40     revision-date 2020-05-29;
41   }
42
43   organization
44     "OPEN ROADM MSA";
45   contact
46     "OpenROADM.org.";
47   description
48     "YANG definitions for network view of a ROADM
49
50      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
51      All other rights reserved.
52
53      Redistribution and use in source and binary forms, with or without modification,
54      are permitted provided that the following conditions are met:
55
56      * Redistributions of source code must retain the above copyright notice, this
57        list of conditions and the following disclaimer.
58      * Redistributions in binary form must reproduce the above copyright notice,
59        this list of conditions and the following disclaimer in the documentation and/or
60        other materials provided with the distribution.
61      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
62        contributors may be used to endorse or promote products derived from this software
63        without specific prior written permission.
64
65      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
66      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
67      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
68      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
69      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
70      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
71      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
72      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
73      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
74      POSSIBILITY OF SUCH DAMAGE.";
75
76   revision 2020-05-29 {
77     description
78       "Version 7.1.0";
79   }
80   revision 2020-03-27 {
81     description
82       "Version 7.0.0";
83   }
84   revision 2019-11-29 {
85     description
86       "Version 6.1.0";
87   }
88   revision 2019-09-27 {
89     description
90       "Version 6.0.0";
91   }
92   revision 2019-05-31 {
93     description
94       "Version 5.1.0";
95   }
96   revision 2019-03-29 {
97     description
98       "Version 5.0.0";
99   }
100   revision 2018-11-30 {
101     description
102       "Version 4.1.0";
103   }
104   revision 2018-09-28 {
105     description
106       "Version 4.0.0";
107   }
108   revision 2018-05-30 {
109     description
110       "Version 3.1.0";
111   }
112   revision 2018-03-30 {
113     description
114       "Version 3.0.0";
115   }
116   revision 2017-12-15 {
117     description
118       "Version 2.2";
119   }
120   revision 2017-09-29 {
121     description
122       "Version 2.1";
123   }
124   revision 2017-07-28 {
125     description
126       "Version 2.0.1 - added revision-date to imports";
127   }
128   revision 2017-06-26 {
129     description
130       "Version 2.0";
131   }
132
133   deviation "/nd:networks/nd:network/nd:node/cnet:node-type" {
134     deviate add {
135       must "(not /nd:networks/nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-topology) or
136             (/nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-topology and
137             (../cnet:node-type = 'DEGREE' or ../cnet:node-type = 'SRG' or ../cnet:node-type = 'TPDR' or ../cnet:node-type = 'SWITCH' or
138              ../cnet:node-type = 'REGEN' or ../cnet:node-type = 'REGEN-UNI' or ../cnet:node-type = 'EXT-PLUGGABLE' or
139              ../cnet:node-type = 'MUXPDR'))" {
140           error-message "Invalid node type for openroadm-topology";
141           description
142             "The valid node types in the ROADM topology are 'SRG', 'DEGREE',
143              'TPDR', 'SWITCH', 'REGEN', 'REGEN-UNI', 'EXT-PLUGGABLE' and 'MUXPDR'";
144       }
145     }
146   }
147
148   deviation "/nd:networks/nd:network/nd:node/nwt:termination-point/cnet:tp-type" {
149     description
150       "Defines which TP types can be instantiated on which Node types";
151     deviate add {
152       must "/nd:network/nd:node/cnet:node-type != 'DEGREE' or (../../cnet:node-type = 'DEGREE'  and
153             (../cnet:tp-type = 'DEGREE-TX-TTP' or ../cnet:tp-type = 'DEGREE-RX-TTP' or  ../cnet:tp-type = 'DEGREE-TXRX-TTP' or
154             ../cnet:tp-type = 'DEGREE-TX-CTP' or ../cnet:tp-type = 'DEGREE-RX-CTP' or ../cnet:tp-type = 'DEGREE-TXRX-CTP'))" {
155           error-message "Invalid TP for node type 'DEGREE'";
156       }
157       must "/nd:network/nd:node/cnet:node-type != 'SRG' or (../../cnet:node-type = 'SRG' and
158             (../cnet:tp-type = 'SRG-TX-CP' or ../cnet:tp-type = 'SRG-RX-CP' or ../cnet:tp-type = 'SRG-TXRX-CP' or
159             ../cnet:tp-type = 'SRG-RX-PP' or ../cnet:tp-type = 'SRG-TX-PP' or ../cnet:tp-type = 'SRG-TXRX-PP'))" {
160           error-message "Invalid TP for node type 'SRG'";
161       }
162       must " (/nd:network/nd:node/cnet:node-type != 'TPDR' and ../../cnet:node-type != 'MUXPDR' and ../../cnet:node-type != 'REGEN' and
163             ../../cnet:node-type != 'REGEN-UNI' and ../../cnet:node-type != 'SWITCH')
164             or ((../../cnet:node-type = 'TPDR' or ../../cnet:node-type = 'MUXPDR' or ../../cnet:node-type = 'REGEN' or
165             ../../cnet:node-type = 'REGEN-UNI' or ../../cnet:node-type = 'SWITCH') and
166             (../cnet:tp-type = 'XPONDER-NETWORK' or ../cnet:tp-type = 'XPONDER-CLIENT' or ../cnet:tp-type = 'XPONDER-PORT'))" {
167           error-message "Invalid TP for node type 'XPONDER'";
168       }
169       must "/nd:network/nd:node/cnet:node-type != 'EXT-PLUGGABLE' or (../../cnet:node-type = 'EXT-PLUGGABLE' and ../cnet:tp-type = 'EXT-PLUGGABLE-TP')" {
170         error-message "Invalid TP for node type 'EXT-PLUGGABLE'";
171       }
172     }
173   }
174
175   deviation "/nd:networks/nd:network/nwt:link/cnet:link-type" {
176     deviate add {
177       must "(not /nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-topology) or
178             (/nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-topology and
179             (../cnet:link-type = 'ROADM-TO-ROADM' or ../cnet:link-type = 'ADD-LINK' or ../cnet:link-type = 'DROP-LINK' or
180              ../cnet:link-type = 'EXPRESS-LINK' or ../cnet:link-type = 'XPONDER-INPUT' or ../cnet:link-type = 'XPONDER-OUTPUT'))" {
181           error-message "Invalid link type for openroadm-topology";
182           description
183             "The valid link types in the ROADM topology are 'ROADM-TO-ROADM', 'ADD-LINK',
184              'DROP-LINK', 'EXPRESS-LINK', 'XPONDER-INPUT', 'XPONDER-OUTPUT'";
185       }
186     }
187   }
188
189   augment "/nd:networks/nd:network/nd:network-types/cnet:openroadm-common-network" {
190     description
191       "Introduce new network type for the Open ROADM optical
192        `     network topology";
193     container openroadm-topology {
194       presence "indicates optical network topology for Open ROADMs";
195     }
196   }
197
198   augment "/nd:networks/nd:network/nd:node" {
199     when '../nd:network-types/cnet:openroadm-common-network/topo:openroadm-topology';
200     description
201       "This augmentations adds the ROADM Node type to the generic node
202        definition and defines node-specific attributes for each node type
203        in the ROADM Topology.";
204     container srg-attributes {
205       when "../cnet:node-type = 'SRG'";
206       description
207         "Topology-related attributes for SRG nodes";
208       uses srg:srg-node-attributes;
209       uses org-openroadm-network-types:available-freq-map;
210       uses org-openroadm-network-types:type-variety-grp;
211     }
212     container degree-attributes {
213       when "../cnet:node-type = 'DEGREE'";
214       description
215         "Topology-related attributes for degree nodes";
216       uses dgr:degree-node-attributes;
217       uses org-openroadm-network-types:available-freq-map;
218       uses org-openroadm-network-types:type-variety-grp;
219     }
220     container xpdr-attributes {
221       when "../cnet:node-type = 'TPDR' or ../cnet:node-type = 'MUXPDR' or ../cnet:node-type = 'REGEN' or
222             ../cnet:node-type = 'REGEN-UNI' or ../cnet:node-type = 'SWITCH'";
223       description
224         "Topology-related attributes for Xponder nodes";
225       uses xpdr:xpdr-topo-node-attributes;
226     }
227   }
228
229   augment "/nd:networks/nd:network/nd:node/nwt:termination-point" {
230     when '../../nd:network-types/cnet:openroadm-common-network/topo:openroadm-topology';
231     description
232       "Defines the type of a termination point in the ROADM topology and
233        TP-specific attributes for each termination point type.";
234     container tx-ttp-attributes {
235       when "../cnet:tp-type = 'DEGREE-TX-TTP' or ../cnet:tp-type = 'DEGREE-TXRX-TTP'";
236       description
237         "There must be only one TP of type DEGREE-TX-TTP in any given
238          degree node";
239       uses dgr:degree-used-wavelengths;
240       uses org-openroadm-network-types:available-freq-map;
241     }
242     container rx-ttp-attributes {
243       when "../cnet:tp-type = 'DEGREE-RX-TTP'";
244       description
245         "There must be only one TP of type DEGREE-RX-TTP in any given
246          degree node";
247       uses dgr:degree-used-wavelengths;
248       uses org-openroadm-network-types:available-freq-map;
249     }
250     container ctp-attributes {
251       when "../cnet:tp-type = 'DEGREE-TX-CTP' or ../cnet:tp-type = 'DEGREE-RX-CTP' or ../cnet:tp-type = 'DEGREE-TXRX-CTP'";
252       uses org-openroadm-network-types:available-freq-map;
253     }
254     container cp-attributes {
255       when "../cnet:tp-type = 'SRG-TX-CP' or ../cnet:tp-type = 'SRG-RX-CP' or ../cnet:tp-type = 'SRG-TXRX-CP'";
256       description
257         "This list is created to accommodate fixed grid (1.2.1) as well as flex grid (2.0 above). In case of fixed grid
258          index number will refer to one of the 96 WL defined in the wavelength map file. In case of flex grid this
259          will hold list of used spectra";
260       uses org-openroadm-network-types:available-freq-map;
261     }
262     container pp-attributes {
263       when "../cnet:tp-type = 'SRG-TXRX-PP' or ../cnet:tp-type = 'SRG-TX-PP' or ../cnet:tp-type = 'SRG-RX-PP' ";
264       description
265         "This list is created to accommodate fixed grid (1.2.1) as well as flex grid (2.0 above). In case of fixed grid
266          index number will refer to one of the 96 WL defined in the wavelength map file. In case of flex grid this
267          will hold list of used spectra";
268       list used-wavelength {
269         key "index";
270         uses org-openroadm-network-types:wavelengths;
271       }
272       uses org-openroadm-network-types:available-freq-map;
273     }
274     container xpdr-client-attributes {
275       when "../../cnet:node-type = 'TPDR' and ../cnet:tp-type = 'XPONDER-CLIENT'";
276       description
277         "Topology layer will allow client TPs only for Transponder nodes";
278       uses xpdr:xpdr-connection-attributes;
279       uses xpdr:xpdr-port-connection-attributes;
280       uses xpdr:supported-client-services;
281     }
282     container xpdr-network-attributes {
283       when "../cnet:tp-type = 'XPONDER-NETWORK'";
284       uses xpdr:xpdr-connection-attributes;
285       uses xpdr:xpdr-port-connection-attributes;
286       uses xpdr:xpdr-mode-attributes;
287       uses org-openroadm-network-types:type-variety-grp;
288     }
289     container xpdr-port-attributes {
290       when "../cnet:tp-type = 'XPONDER-PORT'";
291       uses xpdr:xpdr-connection-attributes;
292       uses xpdr:xpdr-port-connection-attributes;
293       uses xpdr:xpdr-mode-attributes;
294       uses org-openroadm-network-types:type-variety-grp;
295     }
296     container ext-pluggable-attributes {
297       when "../cnet:tp-type = 'EXT-PLUGGABLE-TP'";
298       uses plg:pluggable-tp-attributes;
299       uses xpdr:xpdr-port-connection-attributes;
300       uses xpdr:xpdr-mode-attributes;
301       uses org-openroadm-network-types:type-variety-grp;
302     }
303   }
304
305   augment "/nd:networks/nd:network/nwt:link" {
306     when '../nd:network-types/cnet:openroadm-common-network/topo:openroadm-topology';
307     description
308       "This augmentation defines ROADM link types in the ROADM topology";
309     leaf amplified {
310       when "../cnet:link-type = 'ROADM-TO-ROADM'";
311       type boolean;
312       description
313         "defines whether an ROADM-TO-ROADM Link includes line amplifiers or not";
314     }
315     container OMS-attributes {
316       when "../cnet:link-type = 'ROADM-TO-ROADM'";
317       description
318         "";
319       container span {
320         when "../../amplified = 'false'";
321         description
322           "";
323         uses link:span-attributes;
324       }
325       container amplified-link {
326         when "../../amplified = 'true'";
327         description
328           "when amplified is set to true, rather than a simple OMS section
329            we have an amplified link";
330         uses link:amplified-link-attributes;
331       }
332     }
333   }
334 }