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