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