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