Remove openroadm and tapi models building
[transportpce.git] / ordmodels / device / src / main / yang / org-openroadm-lldp@2020-05-29.yang
1 module org-openroadm-lldp {
2   namespace "http://org/openroadm/lldp";
3   prefix org-openroadm-lldp;
4
5   import ietf-inet-types {
6     prefix inet;
7     revision-date 2013-07-15;
8   }
9   import org-openroadm-device {
10     prefix org-openroadm-device;
11     revision-date 2020-05-29;
12   }
13   import iana-afn-safi {
14     prefix ianaaf;
15     revision-date 2013-07-04;
16   }
17   import org-openroadm-resource-types {
18     prefix org-openroadm-resource-types;
19     revision-date 2019-11-29;
20   }
21   import ietf-yang-types {
22     prefix yang;
23     revision-date 2013-07-15;
24   }
25
26   organization
27     "Open ROADM MSA";
28   contact
29     "OpenROADM.org";
30   description
31     "YANG definitions for lldp protocol.
32
33      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
34      All other rights reserved.
35
36      Redistribution and use in source and binary forms, with or without modification,
37      are permitted provided that the following conditions are met:
38
39      * Redistributions of source code must retain the above copyright notice, this
40        list of conditions and the following disclaimer.
41      * Redistributions in binary form must reproduce the above copyright notice,
42        this list of conditions and the following disclaimer in the documentation and/or
43        other materials provided with the distribution.
44      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
45        contributors may be used to endorse or promote products derived from this software
46        without specific prior written permission.
47
48      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
49      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
50      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
51      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
52      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
53      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
54      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
55      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
56      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
57      POSSIBILITY OF SUCH DAMAGE.";
58
59   revision 2020-05-29 {
60     description
61       "Version 7.1.0";
62   }
63   revision 2020-03-27 {
64     description
65       "Version 7.0.0";
66   }
67   revision 2019-11-29 {
68     description
69       "Version 6.1.0";
70   }
71   revision 2019-09-27 {
72     description
73       "Version 6.0.0";
74   }
75   revision 2019-05-31 {
76     description
77       "Version 5.1.0";
78   }
79   revision 2019-03-29 {
80     description
81       "Version 5.0.0";
82   }
83   revision 2018-11-30 {
84     description
85       "Version 4.1.0";
86   }
87   revision 2018-09-28 {
88     description
89       "Version 4.0.0";
90   }
91   revision 2018-05-30 {
92     description
93       "Version 3.1.0";
94   }
95   revision 2018-03-30 {
96     description
97       "Version 3.0.0";
98   }
99   revision 2017-12-15 {
100     description
101       "Version 2.2";
102   }
103   revision 2017-09-29 {
104     description
105       "Version 2.1";
106   }
107   revision 2017-07-28 {
108     description
109       "Version 2.0.1 - added revision-date to imports";
110   }
111   revision 2017-06-26 {
112     description
113       "Version 2.0";
114   }
115   revision 2016-10-14 {
116     description
117       "Version 1.2";
118   }
119
120   grouping nbr-info-grp {
121     description
122       "Display LLDP Neighbour ";
123     leaf remoteSysName {
124       type string;
125       description
126         "remote neighbour system name";
127     }
128     leaf remoteMgmtAddressSubType {
129       type ianaaf:address-family;
130       description
131         "remote neighbour Management Address Subtype Enumeration";
132     }
133     leaf remoteMgmtAddress {
134       type inet:ip-address;
135       description
136         "remote neighbour management address";
137     }
138     leaf remotePortIdSubType {
139       type enumeration {
140         enum other {
141           value 0;
142           description
143             "reserved";
144         }
145         enum ifalias {
146           value 1;
147           description
148             "Interface Alias (IfAlias - IETF RFC 2863) ";
149         }
150         enum portcomponent {
151           value 2;
152           description
153             "Port component (EntPhysicalAlias IETF RFC 4133)";
154         }
155         enum macaddress {
156           value 3;
157           description
158             "MAC address (IEEE Std 802) ";
159         }
160         enum networkaddress {
161           value 4;
162           description
163             "Network Address";
164         }
165         enum ifname {
166           value 5;
167           description
168             "Interface Name (ifName - IETF RFC 2863)";
169         }
170         enum agentcircuitid {
171           value 6;
172           description
173             "Agent Circuit Id (IETF RFC 3046)";
174         }
175         enum local {
176           value 7;
177           description
178             "Locally assigned";
179         }
180       }
181       description
182         "remote neighbour Port ID Subtype Enumeration";
183     }
184     leaf remotePortId {
185       type string;
186       description
187         "remote neighbour port Id";
188     }
189     leaf remoteChassisIdSubType {
190       type enumeration {
191         enum reserved {
192           value 0;
193           description
194             "reserved";
195         }
196         enum chassiscomponent {
197           value 1;
198           description
199             "Chassis component (EntPhysicalAlias IETF RFC 4133)";
200         }
201         enum ifalias {
202           value 2;
203           description
204             "Interface Alias (IfAlias - IETF RFC 2863) ";
205         }
206         enum portcomponent {
207           value 3;
208           description
209             "Port component (EntPhysicalAlias IETF RFC 4133)";
210         }
211         enum macaddress {
212           value 4;
213           description
214             "MAC address (IEEE Std 802) ";
215         }
216         enum networkaddress {
217           value 5;
218           description
219             "Network Address";
220         }
221         enum ifname {
222           value 6;
223           description
224             "Interface Name (ifName - IETF RFC 2863)";
225         }
226         enum local {
227           value 7;
228           description
229             "Locally assigned";
230         }
231       }
232       description
233         "Chassis ID Subtype Enumeration";
234     }
235     leaf remoteChassisId {
236       type string;
237       description
238         "remote neighbour Chassis Id";
239     }
240   }
241
242   grouping lldp-container {
243     container lldp {
244       description
245         "LLDP configurable and retrievable";
246       container global-config {
247         description
248           "LLDP global configurations";
249         leaf adminStatus {
250           type enumeration {
251             enum disable {
252               value 0;
253               description
254                 "Disable the LLDP feature per NE";
255             }
256             enum enable {
257               value 1;
258               description
259                 "Enable the LLDP feature per NE";
260             }
261           }
262           default "enable";
263           description
264             "LLDP feature Enable/Disable per NE";
265         }
266         leaf msgTxInterval {
267           type uint16 {
268             range "5..32768";
269           }
270           default "30";
271           description
272             "LLDP frame Retransmit Interval in seconds";
273         }
274         leaf msgTxHoldMultiplier {
275           type uint8 {
276             range "2..10";
277           }
278           default "4";
279           description
280             "TTL value for the TLVs transmitter over wire in seconds";
281         }
282       }
283       list port-config {
284         key "ifName";
285         description
286           "LLDP port configurations";
287         leaf ifName {
288           type leafref {
289             path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
290           }
291           description
292             "Ethernet interface name where LLDP runs";
293         }
294         leaf adminStatus {
295           type enumeration {
296             enum disable {
297               value 0;
298               description
299                 "Disables the LLDP frames transmit and receive on specific interface";
300             }
301             enum txandrx {
302               value 1;
303               description
304                 "Enable Transmit and Receive LLDP frames on specific interface";
305             }
306           }
307           default "txandrx";
308           description
309             "LLDP enable per port basis";
310         }
311       }
312       container nbr-list {
313         config false;
314         description
315           "LLDP Oper data - Neighbour List information";
316         list if-name {
317           key "ifName";
318           leaf ifName {
319             type string;
320             description
321               "Ethernet interface name where LLDP runs";
322           }
323           uses nbr-info-grp;
324         }
325       }
326     }
327   }
328
329   notification lldp-nbr-info-change {
330     description
331       "LLDP: Neighbor Information Changed
332        remoteSysName
333        remoteSysMgmtAddressSubType
334        remoteSysMgmtAddress
335        remotePortIdSubType
336        remotePortId
337        remoteChassisIdSubType
338        remoteChassisId
339        All of the above attributes are sent in event";
340     leaf notification-type {
341       type org-openroadm-resource-types:resource-notification-type;
342     }
343     leaf resource-type {
344       type org-openroadm-resource-types:resource-type-enum;
345       description
346         "resource-type for this notification is interface";
347     }
348     leaf resource {
349       type string;
350       description
351         "resource interface-name";
352     }
353     container nbr-info {
354       uses nbr-info-grp;
355     }
356     leaf event-time {
357       type yang:date-and-time;
358     }
359   }
360
361   augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:protocols" {
362     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'";
363     uses lldp-container;
364   }
365 }