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