Sync Common folder
[transportpce.git] / ordmodels / device / src / main / yang / org-openroadm-prot-otn-linear-aps@2017-12-15.yang
1 module org-openroadm-prot-otn-linear-aps {
2   namespace "http://org/openroadm/prot/otn-linear-aps";
3   prefix org-openroadm-prot-otn-linear-aps;
4
5   import org-openroadm-device {
6     prefix org-openroadm-device;
7     revision-date 2017-12-15;
8   }
9   import org-openroadm-common-types {
10     prefix org-openroadm-common-types;
11     revision-date 2017-12-15;
12   }
13
14   organization
15     "Open ROADM MSA";
16   contact
17     "OpenROADM.org";
18   description
19     "YANG definitions for device facility OTN linear APS protection groups.
20      
21      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
22      AT&T Intellectual Property.  All other rights reserved.
23      
24      Redistribution and use in source and binary forms, with or without modification, 
25      are permitted provided that the following conditions are met:
26      
27      * Redistributions of source code must retain the above copyright notice, this 
28        list of conditions and the following disclaimer.
29      * Redistributions in binary form must reproduce the above copyright notice, 
30        this list of conditions and the following disclaimer in the documentation and/or 
31        other materials provided with the distribution.
32      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
33        contributors may be used to endorse or promote products derived from this software 
34        without specific prior written permission.
35      
36      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
37      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
38      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
39      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
40      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
41      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
42      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
43      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
44      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
45      POSSIBILITY OF SUCH DAMAGE.
46      
47      Also contains code components extracted from IETF Interfaces.  These code components
48      are copyrighted and licensed as follows:
49      
50      Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
51      All rights reserved.
52      
53      This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
54      to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
55      publication of this document. Please review these documents carefully, as they
56      describe your rights and restrictions with respect to this document. Code Components
57      extracted from this document must include Simplified BSD License text as described in
58      Section 4.e of the Trust Legal Provisions and are provided without warranty as
59      described in the Simplified BSD License.";
60
61   revision 2017-12-15 {
62     description
63       "Version 2.2";
64   }
65   revision 2017-09-29 {
66     description
67       "Version 2.1";
68   }
69   revision 2017-07-28 {
70     description
71       "Version 2.0.1 - added revision-date to imports";
72   }
73   revision 2017-06-26 {
74     description
75       "Version 2.0";
76   }
77
78   identity otn-protection-type {
79     description
80       "OTN base protection identity from which
81          specific protection types are derived.";
82   }
83
84   identity odu-one-plus-one {
85     base otn-protection-type;
86     description
87       "ODU Linear Protection 1+1 permanant bridge";
88   }
89
90   grouping odu-sncp-protection-grps {
91     list odu-sncp-pg {
92       key "name";
93       leaf name {
94         type string;
95         description
96           "The odu-sncp-protection-group name";
97       }
98       leaf level {
99         type enumeration {
100           enum "line" {
101             value 1;
102           }
103           enum "path" {
104             value 2;
105           }
106         }
107         mandatory true;
108         description
109           "Designates protection group as Line or Path";
110       }
111       leaf prot-type {
112         type identityref {
113           base otn-protection-type;
114         }
115         default "odu-one-plus-one";
116         description
117           "The type of the protection group.";
118       }
119       leaf switching-direction {
120         type enumeration {
121           enum "unidirectional-switching" {
122             value 1;
123           }
124           enum "bidirectional-switching" {
125             value 2;
126           }
127         }
128         default "unidirectional-switching";
129         description
130           "Bidirectional refers to APS signaling enabled (G.873.1 Table 7-1 Table 8-1).";
131       }
132       leaf revertive {
133         type boolean;
134         default "false";
135         description
136           "Sets reversion behavior.";
137       }
138       leaf mode {
139         type enumeration {
140           enum "SNC/Ne" {
141             value 1;
142             description
143               "applicable to line or path switching";
144           }
145           enum "SNC/Ns" {
146             value 2;
147             description
148               "applicable to line or path switching";
149           }
150           enum "SNC/S" {
151             value 3;
152             description
153               "applicable to line or path switching";
154           }
155           enum "SNC/I" {
156             value 4;
157             description
158               "applicable to line switching only";
159           }
160           enum "CL-SNCG/I" {
161             value 5;
162             description
163               "applicable to line switching only";
164           }
165         }
166         mandatory true;
167         description
168           "Sets the protection mode";
169       }
170       leaf protection-trigger-level {
171         type enumeration {
172           enum "OTUk/ODUkA-SSF-SSD" {
173             value 1;
174             description
175               "applicable to SNC/I";
176           }
177           enum "ODUkP/ODUjA-SSF-SSD" {
178             value 2;
179             description
180               "applicable to CL-SNCG/I";
181           }
182           enum "ODUP-SSF-SSD" {
183             value 3;
184             description
185               "applicable to SNC/Ne";
186           }
187           enum "ODUT1" {
188             value 4;
189             description
190               "applicable to SNC/Ns or SNC/S";
191           }
192           enum "ODUT2" {
193             value 5;
194             description
195               "applicable to SNC/Ns or SNC/S";
196           }
197           enum "ODUT3" {
198             value 6;
199             description
200               "applicable to SNC/Ns or SNC/S";
201           }
202           enum "ODUT4" {
203             value 7;
204             description
205               "applicable to SNC/Ns or SNC/S";
206           }
207           enum "ODUT5" {
208             value 8;
209             description
210               "applicable to SNC/Ns or SNC/S";
211           }
212           enum "ODUT6" {
213             value 9;
214             description
215               "applicable to SNC/Ns or SNC/S";
216           }
217         }
218         description
219           "Indicates switch trigger.";
220       }
221       leaf wait-to-restore {
222         when "../revertive = 'true'";
223         type uint8 {
224           range "1..12";
225         }
226         units "minutes";
227         default "5";
228         description
229           "Wait to restore time in minutes";
230       }
231       container holdoff-timer {
232         leaf holdoff {
233           type uint8 {
234             range "0 | 20 | 100";
235           }
236           units "milliseconds";
237           default "0";
238           description
239             "switch hold-off time in milliseconds";
240         }
241         leaf holdoff-multiplier {
242           when "../holdoff= 100";
243           type uint8 {
244             range "1 .. 100";
245           }
246           default "1";
247           description
248             "switch holdoff time multiplier x100 milliseconds";
249         }
250       }
251       leaf working-if {
252         type leafref {
253           path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
254         }
255         mandatory true;
256         description
257           "Designated work interface";
258       }
259       leaf-list pg-interfaces {
260         type leafref {
261           path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
262         }
263         min-elements 1;
264         description
265           "List of interfaces in the PG";
266       }
267       leaf active-if {
268         type leafref {
269           path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
270         }
271         config false;
272         description
273           "Active interface in the PG";
274       }
275     }
276   }
277
278   rpc odu-sncp-protection-switch {
279     description
280       "ODU SNCP Protection Switch RPC with synchronous implementation";
281     input {
282       leaf protection-group {
283         type leafref {
284           path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:protection-grps/org-openroadm-prot-otn-linear-aps:odu-sncp-pg/org-openroadm-prot-otn-linear-aps:name";
285         }
286         mandatory true;
287         description
288           "Target protection group";
289       }
290       leaf pg-interface {
291         type leafref {
292           path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
293         }
294         mandatory true;
295         description
296           "Target protection group interface";
297       }
298       leaf switch-command {
299         type enumeration {
300           enum "Lock-Out-Protect" {
301             value 1;
302           }
303           enum "Force-Switch" {
304             value 2;
305           }
306           enum "Manual-Switch" {
307             value 3;
308           }
309           enum "Release" {
310             value 4;
311           }
312         }
313       }
314     }
315     output {
316       uses org-openroadm-common-types:rpc-response-status;
317     }
318   }
319   notification odu-sncp-pg-switch-event {
320     leaf switch-status {
321       type enumeration {
322         enum "switched-to-protect" {
323           value 1;
324         }
325         enum "switched-back-to-working" {
326           value 2;
327         }
328       }
329       description
330         "Completed protection switch";
331     }
332     leaf odu-sncp-pg-name {
333       type string;
334       description
335         "The odu-sncp-protection-group name";
336     }
337   }
338   augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:protection-grps" {
339     uses odu-sncp-protection-grps;
340   }
341 }