Upgrade openroadm network models to 10.1
[transportpce.git] / api / src / main / yang / transportpce-portmapping@2022-01-14.yang
1 module transportpce-portmapping {
2   yang-version 1;
3   namespace "http://org/opendaylight/transportpce/portmapping";
4   prefix org-opendaylight-transportpce-portmapping;
5
6   import ietf-inet-types {
7     prefix ietf-inet-types;
8     revision-date 2013-07-15;
9   }
10   import org-openroadm-common-optical-channel-types {
11     prefix org-openroadm-common-optical-channel-types;
12     revision-date 2020-05-29;
13   }
14   import org-openroadm-device-types {
15      prefix org-openroadm-device-types;
16      revision-date 2019-11-29;
17   }
18   import org-openroadm-otn-common-types {
19       prefix org-openroadm-otn-common-types;
20       revision-date 2020-03-27;
21   }
22   import org-openroadm-switching-pool-types {
23     prefix org-openroadm-switching-pool-types;
24     revision-date 2019-11-29;
25   }
26   import org-openroadm-port-types {
27     prefix org-openroadm-port-types;
28     revision-date 2020-03-27;
29   }
30
31
32   organization
33     "transportPCE";
34   contact
35     "transportPCE committers - ODL";
36   description
37     "YANG definitions for defining port mapping in TransportPCE.
38      Copyright (c) 2017 AT&T and others. All rights reserved.
39      authors: Dhruv Bhardwaj ( db929a@att.com ) Shweta Vachhani ( sv111y@att.com )
40               Balagangadhar Bathula ( bb4341@att.com )";
41
42   revision 2022-01-14 {
43         description
44         "Modify the container names for ODUCn and OTUCn supporting interfaces";
45   }
46   revision 2021-09-27 {
47       description
48       "Add supporting-otu interface in mapping";
49   }
50   revision 2021-04-26 {
51       description
52       "Adding mux-profile information to support 400G Muxponder";
53   }
54   revision 2021-04-25 {
55       description
56       "OpenROADM version fix 7.1.0 -> 7.1";
57   }
58   revision 2021-03-15 {
59     description
60       "Refacto model to use grouping";
61   }
62   revision 2021-03-10 {
63     description
64       "Add operational and administrative state of device port
65        in mapping";
66   }
67   revision 2020-10-12 {
68     description
69       "Upgrading imported models to 7.1.0";
70   }
71   revision 2020-08-27 {
72     description
73       "Add support to differentiate flexible and fixed
74        grid capabilities with mc-capabilities";
75   }
76   revision 2020-04-29 {
77     description
78       "Add SAPI/DAPI lcp hash value";
79   }
80   revision 2020-01-28 {
81     description
82       "Add necessary parameters to consolidate OTN
83        and address ONAP MDONS use case";
84   }
85   revision 2020-01-13 {
86     description
87       "Add OTN data from device and necessary
88        to build node inside otn topology";
89   }
90   revision 2019-11-15 {
91     description
92       "OTN support";
93   }
94   revision 2019-07-02 {
95     description
96       "Version 2. To manage device 2.2.1";
97   }
98   revision 2017-02-28 {
99     description
100       "Initial revision of port mapping model";
101   }
102
103   typedef openroadm-node-version {
104     type enumeration {
105       enum 1.2.1 {
106         value 1;
107         description
108           "Version 1.2.1";
109       }
110       enum 2.2.1 {
111         value 2;
112         description
113           "Version 2.2.1";
114       }
115       enum 7.1 {
116         value 3;
117         description
118           "Version 7.1";
119       }
120     }
121     description
122         "YANG enumerations for OpenROADM models;
123          enums should be same as OpenROADM models
124          defined in org-openroadm-common-types";
125   }
126
127   grouping node-info {
128     leaf node-type {
129       type org-openroadm-device-types:node-types;
130       description
131         "Identifier for node-type e.g Roadm, xponder";
132     }
133     leaf openroadm-version {
134       type openroadm-node-version;
135     }
136     leaf node-clli {
137       type string;
138       description
139         "Common Language Location Identifier.";
140     }
141     leaf node-vendor {
142       type string;
143       description
144         "Vendor of the equipment";
145     }
146     leaf node-model {
147       type string;
148       description
149         "Physical resource model information.";
150     }
151     leaf node-ip-address {
152       type ietf-inet-types:ip-address;
153       description
154         "Current IP Address of device";
155     }
156   }
157
158   grouping mapping {
159     list mapping {
160       key "logical-connection-point";
161       description
162         "Mapping for Physical circuit pack/port/parent interfaces corresponding
163          to each logical connection point present in the node.";
164       leaf logical-connection-point {
165         type string;
166       }
167       leaf supporting-circuit-pack-name {
168         type string;
169         description
170           "Circuit pack where the logical connection point is located";
171       }
172       leaf supporting-port {
173         type string;
174         description
175           "Port where the logical connection point is located";
176       }
177       leaf supporting-oms {
178         type string;
179         description
180           "OMS interface provisioned on the port";
181       }
182       leaf supporting-ots {
183         type string;
184         description
185           "OTS interface provisioned on the port";
186       }
187       leaf port-direction {
188         type string;
189         description
190           "Useful for line port of XPDR, for which there is no indication
191            in its logical-termination-point naming";
192       }
193       leaf port-qual {
194         type string;
195         description
196           "Useful to identify from portmapping client from network ports
197            of XPDR";
198       }
199       leaf port-admin-state {
200         type string;
201         description
202           "admin-state of port";
203       }
204       leaf port-oper-state {
205         type string;
206         description
207           "operational-state of port";
208       }
209       leaf supporting-ethernet {
210         type string;
211         description
212           "Ethernet interface provisioned on the port";
213       }
214       leaf supporting-otu4 {
215           type string;
216           description
217             "OTU4 interface provisioned on the port";
218         }
219       leaf supporting-otucn {
220           type string;
221           description
222             "OTUCn interface provisioned on the port for B100G support. This includes
223             OTUC2, OTUC3, OTUC4";
224         }
225       leaf supporting-odu4 {
226           type string;
227           description
228             "ODU4 interface provisioned on the port";
229         }
230       leaf supporting-oducn {
231         type string;
232         description
233           "ODUCn interface provisioned on the port for B100G support. This includes
234            ODUC2, ODUC3, ODUC4";
235       }
236       leaf rate {
237         type string;
238         description
239           "Rate supported by the port";
240       }
241       leaf-list supported-interface-capability {
242         type identityref {
243           base org-openroadm-port-types:supported-if-capability;
244         }
245       }
246       uses mpdr-restrictions-grp;
247       leaf xponder-type {
248         type org-openroadm-device-types:xpdr-node-types;
249       }
250       leaf connection-map-lcp {
251         type string;
252         description
253           "For XPDR, associate two logical-connection-points from device/connnection-map
254            data";
255       }
256       leaf partner-lcp {
257         type string;
258         description
259           "For XPDR unidirectional NETWORK port, associate two logical-connection-points
260            from device/partner port data";
261       }
262       leaf lcp-hash-val {
263         type string;
264         description
265           "Hash value generated from node-id and lcp. This value will be used to map-
266            back SAPI and DAPI resource";
267       }
268     }
269   }
270
271   grouping mpdr-restrictions-grp {
272     container mpdr-restrictions {
273       when "../port-qual = 'switch-client' and ../../node-info/openroadm-version = '7.1'";
274       description
275         "This container provides the information about multiplexing of LO ODUs to HO ODUs
276         Caveat: If port advertizes multiple rates, this container does not work and results could
277         be wrong, meaning if the supported-interface-capabilities include, if-100GE-ODU4, if-OTU4-ODU4,
278         if-200GE-oduflexcbr, then min/max-trib-slot could be different";
279       leaf min-trib-slot {
280           type org-openroadm-otn-common-types:opucn-trib-slot-def;
281           description
282               "Minimum OPUCn 5G trib slots in the form of TS #A.B (G.709)";
283       }
284       leaf max-trib-slot {
285           type org-openroadm-otn-common-types:opucn-trib-slot-def;
286           description
287               "Maximum OPUCn 5G trib slots in the form of TS #A.B (G.709)";
288       }
289     }
290   }
291
292   grouping mc-capabilities {
293     list mc-capabilities {
294       key "mc-node-name";
295       description
296         "Capabilities of the media channel associated with a degree SRG, or
297         XPDR (7.1 and above). ";
298       leaf mc-node-name {
299         type string;
300         description
301           "Name of the node, it has the format of DEGi-TTP or SRGj-PP
302            Where i, and j are the degree and SRG numbers respectively.
303            For XPDR type it will have one element in the leaf-list,
304            with name XPDR-mcprofile";
305       }
306       leaf slot-width-granularity {
307         type org-openroadm-common-optical-channel-types:frequency-GHz;
308         default "50";
309         description
310           "Width of a slot measured in GHz.";
311      }
312       leaf center-freq-granularity {
313         type org-openroadm-common-optical-channel-types:frequency-GHz;
314         default "50";
315         description
316           "Width of a slot measured in GHz.";
317       }
318     }
319   }
320
321   grouping cp-to-degree {
322     list cp-to-degree {
323       key "circuit-pack-name";
324       description
325         "This mapping helps locate degree number of the circuitpack that
326          does lldp protocol management";
327       leaf circuit-pack-name {
328         type string;
329       }
330       leaf degree-number {
331         type uint32;
332       }
333       leaf interface-name {
334         type string;
335       }
336     }
337   }
338
339   grouping switching-pool-lcp {
340     list switching-pool-lcp {
341       key "switching-pool-number";
342       description
343         "For MUXPDR and SWITCH, associates from device/odu-switching-pools data,
344          the logical-connection-points";
345       leaf switching-pool-number {
346         type uint16;
347         description
348           "Unique identifier for this odu-switching-pool";
349       }
350       leaf switching-pool-type {
351         type org-openroadm-switching-pool-types:switching-pool-types;
352       }
353       list non-blocking-list {
354         key "nbl-number";
355         leaf nbl-number {
356           type uint16;
357           description
358             "Identifier for this non-blocking-list. Unique within odu-switching-pool";
359         }
360         leaf interconnect-bandwidth-unit {
361           type uint32;
362           description
363             "Switch fabric interconnect bandwidth unit rate in bits per second.
364              Represents granularity of switch fabric";
365         }
366         leaf interconnect-bandwidth {
367           type uint32;
368           description
369             "Total interconnect bandwidth for a non-blocking element expressed as
370              number of inter-connect-bandwidth units : corresponds to capable-
371              inter-connect bandwidth";
372         }
373         leaf available-interconnect-bandwidth {
374           type uint32;
375           description
376             "Total interconnect bandwidth available for a non-blocking element can use as
377              number of inter-connect-bandwidth units";
378         }
379         leaf-list lcp-list {
380           type string;
381         }
382       }
383     }
384   }
385
386   container network {
387     list nodes {
388       key "node-id";
389       leaf node-id {
390         type string;
391         description
392           "Unique identifier for node in the network";
393       }
394       container node-info {
395         uses node-info;
396       }
397       uses mapping;
398       uses mc-capabilities;
399       uses cp-to-degree;
400       uses switching-pool-lcp;
401     }
402   }
403 }