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