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