Upgrade to OpenROADM 7.1.0 network models
[transportpce.git] / ordmodels / network / src / main / yang / org-openroadm-otn-network-topology@2020-05-29.yang
1 module org-openroadm-otn-network-topology {
2   yang-version 1.1;
3   namespace "http://org/openroadm/otn/network/topology";
4   prefix otn-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-network-topology-types {
19     prefix org-openroadm-network-topology-types;
20     revision-date 2020-03-27;
21   }
22   import org-openroadm-xponder {
23     prefix xpdr;
24     revision-date 2020-05-29;
25   }
26   import org-openroadm-common-network {
27     prefix cnet;
28     revision-date 2020-05-29;
29   }
30
31   organization
32     "OPEN ROADM MSA";
33   contact
34     "OpenROADM.org.";
35   description
36     "YANG definitions for network view of a ROADM
37
38      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
39      All other rights reserved.
40
41      Redistribution and use in source and binary forms, with or without modification,
42      are permitted provided that the following conditions are met:
43
44      * Redistributions of source code must retain the above copyright notice, this
45        list of conditions and the following disclaimer.
46      * Redistributions in binary form must reproduce the above copyright notice,
47        this list of conditions and the following disclaimer in the documentation and/or
48        other materials provided with the distribution.
49      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
50        contributors may be used to endorse or promote products derived from this software
51        without specific prior written permission.
52
53      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
54      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
55      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
56      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
57      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
58      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
59      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
60      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
61      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
62      POSSIBILITY OF SUCH DAMAGE.";
63
64   revision 2020-05-29 {
65     description
66       "Version 7.1.0";
67   }
68   revision 2020-03-27 {
69     description
70       "Version 7.0.0";
71   }
72   revision 2019-11-29 {
73     description
74       "Version 6.1.0";
75   }
76   revision 2019-09-27 {
77     description
78       "Version 6.0.0";
79   }
80   revision 2019-05-31 {
81     description
82       "Version 5.1.0";
83   }
84   revision 2019-03-29 {
85     description
86       "Version 5.0.0";
87   }
88   revision 2018-11-30 {
89     description
90       "Version 4.1.0";
91   }
92   revision 2018-09-28 {
93     description
94       "Version 4.0.0";
95   }
96   revision 2018-05-30 {
97     description
98       "Version 3.1.0";
99   }
100   revision 2018-03-30 {
101     description
102       "Version 3.0.0";
103   }
104   revision 2017-12-15 {
105     description
106       "Version 2.2";
107   }
108   revision 2017-09-29 {
109     description
110       "Version 2.1";
111   }
112
113   deviation "/nd:networks/nd:network/nd:node/cnet:node-type" {
114     deviate add {
115       must "(not /nd:network/nd:network-types/cnet:openroadm-common-network/otn-topology) or
116             (/nd:network/nd:network-types/cnet:openroadm-common-network/otn-topology and
117             (../cnet:node-type = 'SWITCH' or ../cnet:node-type = 'MUXPDR' or ../cnet:node-type = 'TPDR' or
118              ../cnet:node-type = 'REGEN' or ../cnet:node-type = 'REGEN-UNI'))" {
119           error-message "Invalid node type for otn-topology";
120           description
121             "The type of a node in the OTN topology";
122       }
123     }
124   }
125
126   deviation "/nd:networks/nd:network/nd:node/nwt:termination-point/cnet:tp-type" {
127     description
128       "Defines which TP types can be instantiated on which Node types";
129     deviate add {
130       must "(/nd:network/nd:node/cnet:node-type != 'MUXPDR' and ../../cnet:node-type != 'SWITCH' and ../../cnet:node-type != 'TPDR'
131             and ../cnet:node-type != 'REGEN' and ../cnet:node-type != 'REGEN-UNI') or
132             ((../../cnet:node-type = 'MUXPDR' or ../../cnet:node-type = 'SWITCH' or ../../cnet:node-type = 'TPDR' or
133             ../cnet:node-type = 'REGEN' or ../cnet:node-type = 'REGEN-UNI') and
134             (../cnet:tp-type = 'XPONDER-NETWORK' or ../cnet:tp-type = 'XPONDER-CLIENT' or ../cnet:tp-type = 'XPONDER-PORT'))" {
135           error-message "Invalid TP for node type Xponder";
136       }
137     }
138   }
139
140   deviation "/nd:networks/nd:network/nwt:link/cnet:link-type" {
141     deviate add {
142       must "(not /nd:network/nd:network-types/cnet:openroadm-common-network/otn-topology) or
143             (/nd:network/nd:network-types/cnet:openroadm-common-network/otn-topology and ../cnet:link-type = 'OTN-LINK')" {
144           error-message "Invalid link type for otn-topology";
145           description
146             "The valid link type in the OTN topology is 'OTN-LINK'";
147       }
148     }
149   }
150
151   augment "/nd:networks/nd:network/nd:network-types/cnet:openroadm-common-network" {
152     description
153       "Introduce new network type for the Open ROADM OTN network topology";
154     container otn-topology {
155       presence "indicates OTN topology for Transponder, Muxponder, Switchponder and OTN-switch";
156     }
157   }
158
159   augment "/nd:networks/nd:network/nd:node" {
160     when '../nd:network-types/cnet:openroadm-common-network/otn-topo:otn-topology';
161     description
162       "This augmentations adds the OTN Node type to the generic node
163        definition and defines node-specific attributes for each node type
164        in the OTN Topology.";
165     container tp-bandwidth-sharing {
166       when "../cnet:node-type = 'MUXPDR' or ../cnet:node-type = 'SWITCH' or ../cnet:node-type = 'TPDR'";
167       uses org-openroadm-network-topology-types:xpdr-tp-bandwidth-sharing;
168     }
169     container switching-pools {
170       when "../cnet:node-type = 'MUXPDR' or ../cnet:node-type = 'SWITCH' or ../cnet:node-type = 'TPDR'";
171       description
172         "ODU Switching pool";
173       uses org-openroadm-network-topology-types:xpdr-odu-switching-pools;
174     }
175     container xpdr-attributes {
176       when "../cnet:node-type = 'MUXPDR' or ../cnet:node-type = 'SWITCH' or ../cnet:node-type = 'TPDR' or
177             ../cnet:node-type = 'REGEN' or ../cnet:node-type = 'REGEN-UNI'";
178       description
179         "Topology-related attributes for Xponder nodes";
180       uses xpdr:xpdr-topo-node-attributes;
181     }
182   }
183
184   augment "/nd:networks/nd:network/nd:node/nwt:termination-point" {
185     when '../../nd:network-types/cnet:openroadm-common-network/otn-topo:otn-topology';
186     description
187       "Defines the type of a termination point in the OTN topology and
188        TP-specific attributes for each termination point type.";
189     container tp-supported-interfaces {
190       when "../cnet:tp-type = 'XPONDER-NETWORK' or ../cnet:tp-type = 'XPONDER-CLIENT' or ../cnet:tp-type = 'XPONDER-PORT'";
191       description
192         "Supported interface capability on the port.";
193       uses org-openroadm-network-types:xpdr-tp-supported-interfaces;
194     }
195     container xpdr-tp-port-connection-attributes {
196       when "../cnet:tp-type = 'XPONDER-NETWORK' or ../cnet:tp-type = 'XPONDER-CLIENT' or ../cnet:tp-type = 'XPONDER-PORT'";
197       description
198         "Topology-related attributes for Xpdr nodes";
199       uses xpdr:xpdr-otn-tp-attributes;
200       uses xpdr:xpdr-port-connection-attributes;
201       uses org-openroadm-network-topology-types:xpdr-otn-tail-attributes;
202       uses xpdr:supported-client-services;
203     }
204   }
205
206   augment "/nd:networks/nd:network/nwt:link" {
207     when '../nd:network-types/cnet:openroadm-common-network/otn-topo:otn-topology';
208     description
209       "This augmentation defines Logical link types in the OTN topology connecting OTN elements";
210     leaf available-bandwidth {
211       type uint32;
212       description
213         "Available bandwidth between OTN elements";
214     }
215     leaf used-bandwidth {
216       type uint32;
217       description
218         "Used bandwidth between OTN elements";
219     }
220     leaf ODU-protected {
221       type boolean;
222       description
223         "ODU protection flag";
224     }
225   }
226 }