Update docs conf.yaml version to Sulfur
[transportpce.git] / ordmodels / device / src / main / yang / org-openroadm-rstp@2020-05-29.yang
1 module org-openroadm-rstp {
2   namespace "http://org/openroadm/rstp";
3   prefix org-openroadm-rstp;
4
5   import org-openroadm-device {
6     prefix org-openroadm-device;
7     revision-date 2020-05-29;
8   }
9   import org-openroadm-resource-types {
10     prefix org-openroadm-resource-types;
11     revision-date 2019-11-29;
12   }
13
14   organization
15     "Open ROADM MSA";
16   contact
17     "OpenROADM.org";
18   description
19     "YANG definitions for rstp protocol.
20
21
22      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
23      All other rights reserved.
24
25      Redistribution and use in source and binary forms, with or without modification,
26      are permitted provided that the following conditions are met:
27
28      * Redistributions of source code must retain the above copyright notice, this
29        list of conditions and the following disclaimer.
30      * Redistributions in binary form must reproduce the above copyright notice,
31        this list of conditions and the following disclaimer in the documentation and/or
32        other materials provided with the distribution.
33      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
34        contributors may be used to endorse or promote products derived from this software
35        without specific prior written permission.
36
37      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
38      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
39      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
40      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
41      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
42      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
43      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
44      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
45      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
46      POSSIBILITY OF SUCH DAMAGE.";
47
48   revision 2020-05-29 {
49     description
50       "Version 7.1.0";
51   }
52   revision 2020-03-27 {
53     description
54       "Version 7.0.0";
55   }
56   revision 2019-11-29 {
57     description
58       "Version 6.1.0";
59   }
60   revision 2019-09-27 {
61     description
62       "Version 6.0.0";
63   }
64   revision 2019-05-31 {
65     description
66       "Version 5.1.0";
67   }
68   revision 2019-03-29 {
69     description
70       "Version 5.0.0";
71   }
72   revision 2018-11-30 {
73     description
74       "Version 4.1.0";
75   }
76   revision 2018-09-28 {
77     description
78       "Version 4.0.0";
79   }
80   revision 2018-05-30 {
81     description
82       "Version 3.1.0";
83   }
84   revision 2018-03-30 {
85     description
86       "Version 3.0.0";
87   }
88   revision 2017-12-15 {
89     description
90       "Version 2.2";
91   }
92   revision 2017-09-29 {
93     description
94       "Version 2.1";
95   }
96   revision 2017-07-28 {
97     description
98       "Version 2.0.1 - added revision-date to imports";
99   }
100   revision 2017-06-26 {
101     description
102       "Version 2.0";
103   }
104   revision 2016-10-14 {
105     description
106       "Version 1.2";
107   }
108
109   typedef bridge-id-type {
110     type string;
111     description
112       "Unique Bridge Identifier";
113   }
114
115   grouping rstp-common-bridge-config {
116     leaf bridge-priority {
117       type uint32 {
118         range "0..61440";
119       }
120       default "32768";
121       description
122         "Bridge Priority Value";
123     }
124     leaf shutdown {
125       type empty;
126       description
127         "Bridge admin state";
128     }
129     leaf hold-time {
130       type uint32 {
131         range "1..10";
132       }
133       default "2";
134       description
135         "The time interval during which no more than two
136             BPDUs transmitted by this node in seconds - not used in rstp mode (in seconds)";
137     }
138     leaf hello-time {
139       type uint32 {
140         range "1..2";
141       }
142       default "2";
143       description
144         "The time between the transmission of BPDU's by this node on any
145             port, when role is root (in seconds)";
146     }
147     leaf max-age {
148       type uint32 {
149         range "6..40";
150       }
151       default "20";
152       description
153         "The value that all bridges use for MaxAge when this bridge
154             is acting as the root";
155     }
156     leaf forward-delay {
157       type uint32 {
158         range "4..30";
159       }
160       default "15";
161       description
162         "The port on the Switch spends this time in the listening
163             state while moving from the blocking state to the forwarding state (in seconds)";
164     }
165     leaf transmit-hold-count {
166       type uint32 {
167         range "1..10";
168       }
169       default "2";
170       description
171         "Maximum BPDU transmission rate";
172     }
173   }
174
175   grouping rstp-root-bridge-attr {
176     leaf root-bridge-port {
177       type uint32;
178       description
179         "Port id of the root port";
180     }
181     leaf root-path-cost {
182       type uint32;
183       description
184         "The cost of the path to the root as
185                seen from this bridge";
186     }
187     leaf root-bridge-priority {
188       type uint32;
189       description
190         "Root Bridge Priority Value";
191     }
192     leaf root-bridge-id {
193       type bridge-id-type;
194       description
195         "Root Bridge identifier";
196     }
197     leaf root-hold-time {
198       type uint32;
199       description
200         "The time interval during which no more than two
201                BPDUs transmitted by this node in seconds at root node (in seconds)";
202     }
203     leaf root-hello-time {
204       type uint32;
205       description
206         "The time between the transmission of BPDU's used at root node (in seconds)";
207     }
208     leaf root-max-age {
209       type uint32;
210       description
211         "The value that all bridges use for MaxAge used at root node";
212     }
213     leaf root-forward-delay {
214       type uint32;
215       description
216         "The time in seconds spent on the listening state used at root node (in seconds)";
217     }
218   }
219
220   grouping rstp-bridge-port-state-attr {
221     list rstp-bridge-port-table {
222       key "ifname";
223       max-elements 15;
224       description
225         "This table contains port-specific information for rstp state attributes";
226       leaf ifname {
227         type string {
228           length "1..255";
229         }
230         description
231           "Interface name of the port";
232       }
233       leaf bridge-port-state {
234         type enumeration {
235           enum discarding;
236           enum blocked;
237           enum learning;
238           enum forwarding;
239           enum unknown;
240         }
241         description
242           "The port's current state";
243       }
244       leaf bridge-port-role {
245         type enumeration {
246           enum designated;
247           enum root;
248           enum alternate;
249           enum disabled;
250           enum backup;
251           enum unknown;
252         }
253         description
254           "The role payed by this port in the bridge";
255       }
256       leaf bridge-port-id {
257         type uint32;
258         description
259           "Unique port id of this port";
260       }
261       leaf oper-edge-bridge-port {
262         type empty;
263         description
264           "The operational value of the Edge Port parameter";
265       }
266       leaf designated-bridge-port {
267         type uint32;
268         description
269           "Port id of the designated port";
270       }
271       leaf designated-bridgeid {
272         type bridge-id-type;
273         description
274           "The Bridge Identifier of the bridge that this port considers
275            to be the Designated Bridge for this port's segment";
276       }
277     }
278   }
279
280   grouping rstp-bridge-port-attr {
281     list rstp-bridge-port-table {
282       key "ifname";
283       max-elements 15;
284       description
285         "Table contains port-specific information for rstp config";
286       leaf ifname {
287         type leafref {
288           path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
289         }
290         description
291           "Interface name of the port";
292       }
293       leaf cost {
294         type uint32 {
295           range "2000..200000";
296         }
297         default "20000";
298         description
299           "The contribution of this port to the path cost of
300                  paths towards the spanning tree root which include this port also";
301       }
302       leaf priority {
303         type uint32 {
304           range "0..240";
305         }
306         description
307           "The value of the priority field";
308       }
309     }
310   }
311
312   grouping rstp-container {
313     container rstp {
314       description
315         "Open ROADM RSTP top level";
316       leaf max-bridge-instances {
317         type uint32;
318         config false;
319         description
320           "Number of bridge instances supported";
321       }
322       list rstp-bridge-instance {
323         key "bridge-name";
324         description
325           "rstp bridge instance";
326         leaf bridge-name {
327           type string {
328             length "1..255";
329           }
330           description
331             "unique name of the bridge";
332         }
333         container rstp-config {
334           description
335             "Collection of rstp configuration attributes";
336           uses rstp-common-bridge-config;
337           uses rstp-bridge-port-attr;
338         }
339         container rstp-state {
340           config false;
341           description
342             "Collection of rstp operational attributes";
343           container rstp-bridge-attr {
344             description
345               "Collection of operational rstp bridge attributes";
346             uses rstp-root-bridge-attr;
347             leaf bridge-id {
348               type bridge-id-type;
349               description
350                 "Bridge identifier of the bridge";
351             }
352             leaf topo-change-count {
353               type uint32;
354               description
355                 "The total number of topology changes";
356             }
357             leaf time-since-topo-change {
358               type uint32;
359               description
360                 "Time since last topology changes occurred (in seconds)";
361             }
362           }
363           container rstp-bridge-port-attr {
364             description
365               "Collection of operational rstp port related attributes";
366             uses rstp-bridge-port-state-attr;
367           }
368         }
369       }
370     }
371   }
372
373   notification rstp-topology-change {
374     description
375       "RSTP: A topologyChange event is sent by a bridge when any of
376        its configured ports transitions from the Learning state
377        to the Forwarding state, or from the Forwarding state to
378        the Blocking state. The event is not sent if a rstp-new-root
379        event is sent for the same transition";
380     uses org-openroadm-resource-types:device-id;
381   }
382
383   notification rstp-new-root {
384     description
385       "RSTP:The rstp-new-root event indicates that the sending agent has
386        become the new root of the Spanning Tree ";
387     uses org-openroadm-resource-types:device-id;
388   }
389
390   augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:protocols" {
391     when "/org-openroadm-device:org-openroadm-device/org-openroadm-device:info/org-openroadm-device:node-type='rdm' or /org-openroadm-device:org-openroadm-device/org-openroadm-device:info/org-openroadm-device:node-type='ila'";
392     uses rstp-container;
393   }
394 }