7b70b45a8661199d20980ca31c13ec9959076207
[transportpce.git] / tests / honeynode / 2.2.1 / honeynode-plugin-impl / src / main / resources / honeycomb-minimal-resources / config / yang / devices / org-openroadm-rstp@2018-10-19.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 2018-10-19;
8   }
9   import org-openroadm-resource-types {
10     prefix org-openroadm-resource-types;
11     revision-date 2018-10-19;
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      AT&T Intellectual Property.  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 2018-10-19 {
49     description
50       "Version 2.2.1";
51   }
52   revision 2017-12-15 {
53     description
54       "Version 2.2";
55   }
56   revision 2017-09-29 {
57     description
58       "Version 2.1";
59   }
60   revision 2017-07-28 {
61     description
62       "Version 2.0.1 - added revision-date to imports";
63   }
64   revision 2017-06-26 {
65     description
66       "Version 2.0";
67   }
68   revision 2016-10-14 {
69     description
70       "Version 1.2";
71   }
72
73   typedef bridge-id-type {
74     type string;
75     description
76       "Unique Bridge Identifier";
77   }
78
79   grouping rstp-common-bridge-config {
80     leaf bridge-priority {
81       type uint32 {
82         range "0..61440";
83       }
84       default "32768";
85       description
86         "Bridge Priority Value";
87     }
88     leaf shutdown {
89       type empty;
90       description
91         "Bridge admin state";
92     }
93     leaf hold-time {
94       type uint32 {
95         range "1..10";
96       }
97       default "2";
98       description
99         "The time interval during which no more than two
100             BPDUs transmitted by this node in seconds - not used in rstp mode (in seconds)";
101     }
102     leaf hello-time {
103       type uint32 {
104         range "1..2";
105       }
106       default "2";
107       description
108         "The time between the transmission of BPDU's by this node on any
109             port, when role is root (in seconds)";
110     }
111     leaf max-age {
112       type uint32 {
113         range "6..40";
114       }
115       default "20";
116       description
117         "The value that all bridges use for MaxAge when this bridge
118             is acting as the root";
119     }
120     leaf forward-delay {
121       type uint32 {
122         range "4..30";
123       }
124       default "15";
125       description
126         "The port on the Switch spends this time in the listening
127             state while moving from the blocking state to the forwarding state (in seconds)";
128     }
129     leaf transmit-hold-count {
130       type uint32 {
131         range "1..10";
132       }
133       default "2";
134       description
135         "Maximum BPDU transmission rate";
136     }
137   }
138
139   grouping rstp-root-bridge-attr {
140     leaf root-bridge-port {
141       type uint32;
142       description
143         "Port id of the root port";
144     }
145     leaf root-path-cost {
146       type uint32;
147       description
148         "The cost of the path to the root as
149                seen from this bridge";
150     }
151     leaf root-bridge-priority {
152       type uint32;
153       description
154         "Root Bridge Priority Value";
155     }
156     leaf root-bridge-id {
157       type bridge-id-type;
158       description
159         "Root Bridge identifier";
160     }
161     leaf root-hold-time {
162       type uint32;
163       description
164         "The time interval during which no more than two
165                BPDUs transmitted by this node in seconds at root node (in seconds)";
166     }
167     leaf root-hello-time {
168       type uint32;
169       description
170         "The time between the transmission of BPDU's used at root node (in seconds)";
171     }
172     leaf root-max-age {
173       type uint32;
174       description
175         "The value that all bridges use for MaxAge used at root node";
176     }
177     leaf root-forward-delay {
178       type uint32;
179       description
180         "The time in seconds spent on the listening state used at root node (in seconds)";
181     }
182   }
183
184   grouping rstp-bridge-port-state-attr {
185     list rstp-bridge-port-table {
186       key "ifname";
187       max-elements "15";
188       description
189         "This table contains port-specific information for rstp state attributes";
190       leaf ifname {
191         type string {
192           length "1..255";
193         }
194         description
195           "Interface name of the port";
196       }
197       leaf bridge-port-state {
198         type enumeration {
199           enum "discarding";
200           enum "blocked";
201           enum "learning";
202           enum "forwarding";
203           enum "unknown";
204         }
205         description
206           "The port's current state";
207       }
208       leaf bridge-port-role {
209         type enumeration {
210           enum "designated";
211           enum "root";
212           enum "alternate";
213           enum "disabled";
214           enum "backup";
215           enum "unknown";
216         }
217         description
218           "The role payed by this port in the bridge";
219       }
220       leaf bridge-port-id {
221         type uint32;
222         description
223           "Unique port id of this port";
224       }
225       leaf oper-edge-bridge-port {
226         type empty;
227         description
228           "The operational value of the Edge Port parameter";
229       }
230       leaf designated-bridge-port {
231         type uint32;
232         description
233           "Port id of the designated port";
234       }
235       leaf designated-bridgeid {
236         type bridge-id-type;
237         description
238           "The Bridge Identifier of the bridge that this port considers
239            to be the Designated Bridge for this port's segment";
240       }
241     }
242   }
243
244   grouping rstp-bridge-port-attr {
245     list rstp-bridge-port-table {
246       key "ifname";
247       max-elements "15";
248       description
249         "Table contains port-specific information for rstp config";
250       leaf ifname {
251         type leafref {
252           path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
253         }
254         description
255           "Interface name of the port";
256       }
257       leaf cost {
258         type uint32 {
259           range "2000..200000";
260         }
261         default "20000";
262         description
263           "The contribution of this port to the path cost of
264                  paths towards the spanning tree root which include this port also";
265       }
266       leaf priority {
267         type uint32 {
268           range "0..240";
269         }
270         description
271           "The value of the priority field";
272       }
273     }
274   }
275
276   grouping rstp-container {
277     container rstp {
278       description
279         "Open ROADM RSTP top level";
280       list rstp-bridge-instance {
281         key "bridge-name";
282         max-elements "1";
283         description
284           "rstp bridge instance, max instance = 1";
285         leaf bridge-name {
286           type string {
287             length "1..255";
288           }
289           description
290             "unique name of the bridge";
291         }
292         container rstp-config {
293           description
294             "Collection of rstp configuration attributes";
295           uses rstp-common-bridge-config;
296           uses rstp-bridge-port-attr;
297         }
298         container rstp-state {
299           config false;
300           description
301             "Collection of rstp operational attributes";
302           container rstp-bridge-attr {
303             description
304               "Collection of operational rstp bridge attributes";
305             uses rstp-root-bridge-attr;
306             leaf bridge-id {
307               type bridge-id-type;
308               description
309                 "Bridge identifier of the bridge";
310             }
311             leaf topo-change-count {
312               type uint32;
313               description
314                 "The total number of topology changes";
315             }
316             leaf time-since-topo-change {
317               type uint32;
318               description
319                 "Time since last topology changes occurred (in seconds)";
320             }
321           }
322           container rstp-bridge-port-attr {
323             description
324               "Collection of operational rstp port related attributes";
325             uses rstp-bridge-port-state-attr;
326           }
327         }
328       }
329     }
330   }
331
332   notification rstp-topology-change {
333     description
334       "RSTP: A topologyChange event is sent by a bridge when any of
335        its configured ports transitions from the Learning state
336        to the Forwarding state, or from the Forwarding state to
337        the Blocking state. The event is not sent if a rstp-new-root
338        event is sent for the same transition";
339     uses org-openroadm-resource-types:device-id;
340   }
341   notification rstp-new-root {
342     description
343       "RSTP:The rstp-new-root event indicates that the sending agent has
344        become the new root of the Spanning Tree ";
345     uses org-openroadm-resource-types:device-id;
346   }
347   augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:protocols" {
348     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'";
349     uses rstp-container;
350   }
351 }