Sync Common folder
[transportpce.git] / ordmodels / device / src / main / yang / org-openroadm-otn-odu-interfaces@2017-12-15.yang
1 module org-openroadm-otn-odu-interfaces {
2   namespace "http://org/openroadm/otn-odu-interfaces";
3   prefix org-openroadm-otn-odu-interfaces;
4
5   import org-openroadm-device {
6     prefix org-openroadm-device;
7     revision-date 2017-12-15;
8   }
9   import org-openroadm-interfaces {
10     prefix openROADM-if;
11     revision-date 2017-06-26;
12   }
13   import org-openroadm-maintenance-testsignal {
14     prefix org-openroadm-maint-testsignal;
15     revision-date 2017-12-15;
16   }
17   import org-openroadm-otn-common {
18     prefix org-openroadm-otn-common;
19     revision-date 2017-06-26;
20   }
21   import org-openroadm-otn-common-types {
22     prefix org-openroadm-otn-common-types;
23     revision-date 2017-12-15;
24   }
25
26   organization
27     "Open ROADM MSA";
28   contact
29     "OpenROADM.org";
30   description
31     "YANG definitions for device facility otnodu interfaces.
32      
33      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
34      AT&T Intellectual Property.  All other rights reserved.
35      
36      Redistribution and use in source and binary forms, with or without modification, 
37      are permitted provided that the following conditions are met:
38      
39      * Redistributions of source code must retain the above copyright notice, this 
40        list of conditions and the following disclaimer.
41      * Redistributions in binary form must reproduce the above copyright notice, 
42        this list of conditions and the following disclaimer in the documentation and/or 
43        other materials provided with the distribution.
44      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
45        contributors may be used to endorse or promote products derived from this software 
46        without specific prior written permission.
47      
48      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
49      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
50      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
51      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
52      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
53      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
54      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
55      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
56      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
57      POSSIBILITY OF SUCH DAMAGE.
58      
59      Also contains code components extracted from IETF Interfaces.  These code components
60      are copyrighted and licensed as follows:
61      
62      Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
63      All rights reserved.
64      
65      This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating
66      to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
67      publication of this document. Please review these documents carefully, as they
68      describe your rights and restrictions with respect to this document. Code Components
69      extracted from this document must include Simplified BSD License text as described in
70      Section 4.e of the Trust Legal Provisions and are provided without warranty as
71      described in the Simplified BSD License.";
72
73   revision 2017-12-15 {
74     description
75       "Version 2.2";
76   }
77   revision 2017-09-29 {
78     description
79       "Version 2.1";
80   }
81   revision 2017-07-28 {
82     description
83       "Version 2.0.1 - added revision-date to imports";
84   }
85   revision 2017-06-26 {
86     description
87       "Version 2.0";
88   }
89   revision 2016-10-14 {
90     description
91       "Version 1.2";
92   }
93
94   grouping msi-entry {
95     leaf trib-slot {
96       type uint16;
97       description
98         "tributary slot (TS)";
99     }
100     leaf odtu-type {
101       type identityref {
102         base org-openroadm-otn-common-types:odtu-type-identity;
103       }
104       description
105         "ODTU type, part of the MSI (Multiplex Structure Identifier)";
106     }
107     leaf trib-port {
108       type uint16;
109       description
110         "Tributary Port Number (0-based), part of the MSI";
111     }
112     leaf trib-port-payload {
113       type string;
114       description
115         "interface name being mapped to trib-port";
116     }
117   }
118
119   grouping odu-attributes {
120     description
121       "ODU attributes";
122     leaf rate {
123       type identityref {
124         base org-openroadm-otn-common-types:odu-rate-identity;
125       }
126       description
127         "rate identity of the ODU. 'identityref' is used
128          to allow to extend for future higher rates";
129     }
130     leaf odu-function {
131       type identityref {
132         base org-openroadm-otn-common-types:odu-function-identity;
133       }
134       description
135         "function of the ODU interface";
136     }
137     leaf monitoring-mode {
138       type enumeration {
139         enum "not-terminated" {
140           description
141             "Not Terminated: no detection or generation.
142              Overhead is passed through the interface transparently in receive direction";
143         }
144         enum "terminated" {
145           description
146             "Terminated: detection and generation enabled.
147              Overhead is erased (replaced with all zeros) in receive direction";
148         }
149         enum "monitored" {
150           description
151             "Monitored: detection enabled.
152              Overhead is passed through the interface transparently in receive direction";
153         }
154       }
155       description
156         "Monitoring mode of the ODU Overhead";
157     }
158     leaf no-oam-function {
159       type empty;
160       description
161         "No OAM functionality exists for this ODU interface, the entity exists in software only. This entity does not report alarms or PM and does not support TCM, TTI, delay measurement, loopbacks, test signal and other hardware-based functions. This is an optional parameter, only needs to be present when no-oam-function supported for this interface.";
162     }
163     leaf proactive-delay-measurement-enabled {
164       type boolean;
165       description
166         "enable/disable proactive Delay Measurement";
167     }
168     uses parent-odu-allocation;
169     uses org-openroadm-otn-common:trail-trace;
170     uses org-openroadm-otn-common:deg-threshold;
171     list tcm {
172       key "layer tcm-direction";
173       max-elements "6";
174       description
175         "Tandem Connection Management";
176       uses tcm-attributes;
177     }
178     uses opu;
179   }
180
181   grouping parent-odu-allocation {
182     container parent-odu-allocation {
183       when "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface[org-openroadm-device:name = current()/../../org-openroadm-device:supporting-interface]/org-openroadm-device:type = 'openROADM-if:otnOdu'";
184       presence "Explicit assignment of parent ODU trib-slot and trib-port allocation. ";
185       leaf trib-port-number {
186         type uint16 {
187           range "1 .. 80";
188         }
189         mandatory true;
190         description
191           "Assigned tributary port number in parent OPU";
192       }
193       leaf-list trib-slots {
194         type uint16 {
195           range "1 .. 80";
196         }
197         min-elements 1;
198         max-elements "80";
199         description
200           "Assigned trib slots occupied in parent OPU MSI";
201       }
202     }
203   }
204
205   grouping opu {
206     container opu {
207       when "../monitoring-mode = 'terminated' or ../monitoring-mode = 'monitored'";
208       description
209         "Optical Channel Payload Unit (OPU)";
210       leaf payload-type {
211         type org-openroadm-otn-common-types:payload-type-def;
212         description
213           "Payload Type";
214       }
215       leaf rx-payload-type {
216         type org-openroadm-otn-common-types:payload-type-def;
217         description
218           "Received Payload Type";
219       }
220       leaf exp-payload-type {
221         type org-openroadm-otn-common-types:payload-type-def;
222         description
223           "Expected Payload Type";
224       }
225       leaf payload-interface {
226         type string;
227         description
228           "Expected Payload of OPU. It designates client interface name";
229       }
230       container msi {
231         when "../payload-type = '20' or ../payload-type = '21'";
232         list tx-msi {
233           key "trib-slot";
234           description
235             "Transmit MSI";
236           uses msi-entry;
237         }
238         list rx-msi {
239           key "trib-slot";
240           description
241             "Receive MSI";
242           uses msi-entry;
243         }
244         list exp-msi {
245           key "trib-slot";
246           description
247             "Expected MSI";
248           uses msi-entry;
249         }
250       }
251     }
252   }
253
254   grouping tcm-attributes {
255     description
256       "Tandem Connection Monitoring (TCM) attributes";
257     leaf layer {
258       type uint8 {
259         range "1..6";
260       }
261       description
262         "TCM layer";
263     }
264     leaf monitoring-mode {
265       type enumeration {
266         enum "not-terminated" {
267           description
268             "Not Terminated: no detection or generation.
269              Overhead is passed through the interface transparently in receive direction 
270              unless extension is set for erase";
271         }
272         enum "terminated" {
273           description
274             "Terminated: detection and generation enabled.
275              Overhead is erased (replaced with all zeros) in receive direction, unless
276              extension is set to passthrough";
277         }
278         enum "monitored" {
279           description
280             "Monitored: detection enabled.
281              Overhead is passed through the interface transparently in receive direction 
282              unless extension is set for erase";
283         }
284       }
285       description
286         "Monitoring mode of the TCM layer";
287     }
288     leaf ltc-act-enabled {
289       type boolean;
290       description
291         "enable/disable alarm transfer on detection of Loss of Tandem Connection (LTC)";
292     }
293     leaf proactive-delay-measurement-enabled {
294       type boolean;
295       description
296         "enable/disable proactive Delay Measurement for TCM";
297     }
298     leaf tcm-direction {
299       type enumeration {
300         enum "up-tcm" {
301           description
302             "TCM termination direction faces the switch fabric.";
303         }
304         enum "down-tcm" {
305           description
306             "TCM termination direction faces the facility";
307         }
308       }
309       description
310         "Direction of TCM.";
311     }
312     uses org-openroadm-otn-common:trail-trace;
313     uses org-openroadm-otn-common:deg-threshold;
314   }
315
316   grouping odu-container {
317     container odu {
318       presence "Attribute Nodes for Optical Data Unit (ODU)";
319       description
320         "Optical Channel Data Unit (ODU)";
321       uses odu-attributes {
322         refine "opu/rx-payload-type" {
323           config false;
324         }
325         refine "opu/msi" {
326           config false;
327         }
328         refine "no-oam-function" {
329           config false;
330         }
331       }
332       uses org-openroadm-maint-testsignal:maint-testsignal;
333     }
334   }
335
336   augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface" {
337     when "org-openroadm-device:type = 'openROADM-if:otnOdu'";
338     uses odu-container;
339   }
340 }