Merge "Fix bug when creating SRG termination points"
[transportpce.git] / ordmodels / device / src / main / yang / org-openroadm-prot-otn-linear-aps@2020-05-29.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 2020-05-29;
8   }
9   import org-openroadm-common-types {
10     prefix org-openroadm-common-types;
11     revision-date 2020-05-29;
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      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 2020-05-29 {
62     description
63       "Version 7.1.0";
64   }
65   revision 2020-03-27 {
66     description
67       "Version 7.0.0";
68   }
69   revision 2019-11-29 {
70     description
71       "Version 6.1.0";
72   }
73   revision 2019-09-27 {
74     description
75       "Version 6.0.0";
76   }
77   revision 2019-05-31 {
78     description
79       "Version 5.1.0";
80   }
81   revision 2019-03-29 {
82     description
83       "Version 5.0.0";
84   }
85   revision 2018-11-30 {
86     description
87       "Version 4.1.0";
88   }
89   revision 2018-09-28 {
90     description
91       "Version 4.0.0";
92   }
93   revision 2018-05-30 {
94     description
95       "Version 3.1.0";
96   }
97   revision 2018-03-30 {
98     description
99       "Version 3.0";
100   }
101   revision 2017-12-15 {
102     description
103       "Version 2.2";
104   }
105   revision 2017-09-29 {
106     description
107       "Version 2.1";
108   }
109   revision 2017-07-28 {
110     description
111       "Version 2.0.1 - added revision-date to imports";
112   }
113   revision 2017-06-26 {
114     description
115       "Version 2.0";
116   }
117
118   identity odu-one-plus-one {
119     base org-openroadm-common-types:otn-protection-type;
120     description
121       "ODU Linear Protection 1+1 permanent bridge";
122   }
123
124   grouping odu-sncp-protection-grps {
125     list odu-sncp-pg {
126       key "name";
127       leaf name {
128         type string;
129         description
130           "The odu-sncp-protection-group name";
131       }
132       leaf level {
133         type enumeration {
134           enum line {
135             value 1;
136           }
137           enum path {
138             value 2;
139           }
140         }
141         mandatory true;
142         description
143           "Designates protection group as Line or Path";
144       }
145       leaf prot-type {
146         type identityref {
147           base org-openroadm-common-types:otn-protection-type;
148         }
149         default "odu-one-plus-one";
150         description
151           "The type of the protection group.";
152       }
153       leaf switching-direction {
154         type enumeration {
155           enum unidirectional-switching {
156             value 1;
157           }
158           enum bidirectional-switching {
159             value 2;
160           }
161         }
162         default "unidirectional-switching";
163         description
164           "Bidirectional refers to APS signaling enabled (G.873.1 Table 7-1 Table 8-1).";
165       }
166       leaf revertive {
167         type boolean;
168         default "false";
169         description
170           "Sets reversion behavior.";
171       }
172       leaf mode {
173         type enumeration {
174           enum SNC/Ne {
175             value 1;
176             description
177               "applicable to line or path switching";
178           }
179           enum SNC/Ns {
180             value 2;
181             description
182               "applicable to line or path switching";
183           }
184           enum SNC/S {
185             value 3;
186             description
187               "applicable to line or path switching";
188           }
189           enum SNC/I {
190             value 4;
191             description
192               "applicable to line switching only";
193           }
194           enum CL-SNCG/I {
195             value 5;
196             description
197               "applicable to line switching only";
198           }
199         }
200         mandatory true;
201         description
202           "Sets the protection mode";
203       }
204       leaf protection-trigger-level {
205         type enumeration {
206           enum OTUk/ODUkA-SSF-SSD {
207             value 1;
208             description
209               "applicable to SNC/I";
210           }
211           enum ODUkP/ODUjA-SSF-SSD {
212             value 2;
213             description
214               "applicable to CL-SNCG/I";
215           }
216           enum ODUP-SSF-SSD {
217             value 3;
218             description
219               "applicable to SNC/Ne";
220           }
221           enum ODUT1 {
222             value 4;
223             description
224               "applicable to SNC/Ns or SNC/S";
225           }
226           enum ODUT2 {
227             value 5;
228             description
229               "applicable to SNC/Ns or SNC/S";
230           }
231           enum ODUT3 {
232             value 6;
233             description
234               "applicable to SNC/Ns or SNC/S";
235           }
236           enum ODUT4 {
237             value 7;
238             description
239               "applicable to SNC/Ns or SNC/S";
240           }
241           enum ODUT5 {
242             value 8;
243             description
244               "applicable to SNC/Ns or SNC/S";
245           }
246           enum ODUT6 {
247             value 9;
248             description
249               "applicable to SNC/Ns or SNC/S";
250           }
251         }
252         description
253           "Indicates switch trigger.";
254       }
255       leaf wait-to-restore {
256         when "../revertive = 'true'";
257         type uint8 {
258           range "1..12";
259         }
260         units "minutes";
261         default "5";
262         description
263           "Wait to restore time in minutes";
264       }
265       container holdoff-timer {
266         leaf holdoff {
267           type uint8 {
268             range "0 | 20 | 100";
269           }
270           units "milliseconds";
271           default "0";
272           description
273             "switch hold-off time in milliseconds";
274         }
275         leaf holdoff-multiplier {
276           when '../holdoff= 100';
277           type uint8 {
278             range "1 .. 100";
279           }
280           default "1";
281           description
282             "switch holdoff time multiplier x100 milliseconds";
283         }
284       }
285       leaf working-if {
286         type leafref {
287           path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
288         }
289         mandatory true;
290         description
291           "Designated work interface";
292       }
293       leaf-list pg-interfaces {
294         type leafref {
295           path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
296         }
297         min-elements 1;
298         description
299           "List of interfaces in the PG";
300       }
301       leaf active-if {
302         type leafref {
303           path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
304         }
305         config false;
306         description
307           "Active interface in the PG";
308       }
309     }
310   }
311
312   rpc odu-sncp-protection-switch {
313     description
314       "ODU SNCP Protection Switch RPC with synchronous implementation";
315     input {
316       leaf protection-group {
317         type leafref {
318           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";
319         }
320         mandatory true;
321         description
322           "Target protection group";
323       }
324       leaf pg-interface {
325         type leafref {
326           path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
327         }
328         mandatory true;
329         description
330           "Target protection group interface";
331       }
332       leaf switch-command {
333         type enumeration {
334           enum Lock-Out-Protect {
335             value 1;
336           }
337           enum Force-Switch {
338             value 2;
339           }
340           enum Manual-Switch {
341             value 3;
342           }
343           enum Release {
344             value 4;
345           }
346         }
347       }
348     }
349     output {
350       uses org-openroadm-common-types:rpc-response-status;
351     }
352   }
353
354   notification odu-sncp-pg-switch-event {
355     leaf switch-status {
356       type enumeration {
357         enum switched-to-protect {
358           value 1;
359         }
360         enum switched-back-to-working {
361           value 2;
362         }
363       }
364       description
365         "Completed protection switch";
366     }
367     leaf odu-sncp-pg-name {
368       type string;
369       description
370         "The odu-sncp-protection-group name";
371     }
372   }
373
374   augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:protection-grps" {
375     uses odu-sncp-protection-grps;
376   }
377 }