Sync Common folder
[transportpce.git] / ordmodels / device / src / main / yang / org-openroadm-lldp@2017-12-15.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 2017-12-15;
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 2017-12-15;
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      AT&T Intellectual Property.  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 2017-12-15 {
60     description
61       "Version 2.2";
62   }
63   revision 2017-09-29 {
64     description
65       "Version 2.1";
66   }
67   revision 2017-07-28 {
68     description
69       "Version 2.0.1 - added revision-date to imports";
70   }
71   revision 2017-06-26 {
72     description
73       "Version 2.0";
74   }
75   revision 2016-10-14 {
76     description
77       "Version 1.2";
78   }
79
80   grouping nbr-info-grp {
81     description
82       "Display LLDP Neighbour ";
83     leaf remoteSysName {
84       type string;
85       description
86         "remote neighbour system name";
87     }
88     leaf remoteMgmtAddressSubType {
89       type ianaaf:address-family;
90       description
91         "remote neighbour Management Address Subtype Enumeration";
92     }
93     leaf remoteMgmtAddress {
94       type inet:ip-address;
95       description
96         "remote neighbour management address";
97     }
98     leaf remotePortIdSubType {
99       type enumeration {
100         enum "other" {
101           value 0;
102           description
103             "reserved";
104         }
105         enum "ifalias" {
106           value 1;
107           description
108             "Interface Alias (IfAlias - IETF RFC 2863) ";
109         }
110         enum "portcomponent" {
111           value 2;
112           description
113             "Port component (EntPhysicalAlias IETF RFC 4133)";
114         }
115         enum "macaddress" {
116           value 3;
117           description
118             "MAC address (IEEE Std 802) ";
119         }
120         enum "networkaddress" {
121           value 4;
122           description
123             "Network Address";
124         }
125         enum "ifname" {
126           value 5;
127           description
128             "Interface Name (ifName - IETF RFC 2863)";
129         }
130         enum "agentcircuitid" {
131           value 6;
132           description
133             "Agent Circuit Id (IETF RFC 3046)";
134         }
135         enum "local" {
136           value 7;
137           description
138             "Locally assigned";
139         }
140       }
141       description
142         "remote neighbour Port ID Subtype Enumeration";
143     }
144     leaf remotePortId {
145       type string;
146       description
147         "remote neighbour port Id";
148     }
149     leaf remoteChassisIdSubType {
150       type enumeration {
151         enum "reserved" {
152           value 0;
153           description
154             "reserved";
155         }
156         enum "chassiscomponent" {
157           value 1;
158           description
159             "Chassis component (EntPhysicalAlias IETF RFC 4133)";
160         }
161         enum "ifalias" {
162           value 2;
163           description
164             "Interface Alias (IfAlias - IETF RFC 2863) ";
165         }
166         enum "portcomponent" {
167           value 3;
168           description
169             "Port component (EntPhysicalAlias IETF RFC 4133)";
170         }
171         enum "macaddress" {
172           value 4;
173           description
174             "MAC address (IEEE Std 802) ";
175         }
176         enum "networkaddress" {
177           value 5;
178           description
179             "Network Address";
180         }
181         enum "ifname" {
182           value 6;
183           description
184             "Interface Name (ifName - IETF RFC 2863)";
185         }
186         enum "local" {
187           value 7;
188           description
189             "Locally assigned";
190         }
191       }
192       description
193         "Chassis ID Subtype Enumeration";
194     }
195     leaf remoteChassisId {
196       type string;
197       description
198         "remote neighbour Chassis Id";
199     }
200   }
201
202   grouping lldp-container {
203     container lldp {
204       description
205         "LLDP configurable and retrievable";
206       container global-config {
207         description
208           "LLDP global configurations";
209         leaf adminStatus {
210           type enumeration {
211             enum "disable" {
212               value 0;
213               description
214                 "Disable the LLDP feature per NE";
215             }
216             enum "enable" {
217               value 1;
218               description
219                 "Enable the LLDP feature per NE";
220             }
221           }
222           default "enable";
223           description
224             "LLDP feature Enable/Disable per NE";
225         }
226         leaf msgTxInterval {
227           type uint16 {
228             range "5..32768";
229           }
230           default "30";
231           description
232             "LLDP frame Retransmit Interval in seconds";
233         }
234         leaf msgTxHoldMultiplier {
235           type uint8 {
236             range "2..10";
237           }
238           default "4";
239           description
240             "TTL value for the TLVs transmitter over wire in seconds";
241         }
242       }
243       list port-config {
244         key "ifName";
245         description
246           "LLDP port configurations";
247         leaf ifName {
248           type leafref {
249             path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
250           }
251           description
252             "Ethernet interface name where LLDP runs";
253         }
254         leaf adminStatus {
255           type enumeration {
256             enum "disable" {
257               value 0;
258               description
259                 "Disables the LLDP frames transmit and receive on specific interface";
260             }
261             enum "txandrx" {
262               value 1;
263               description
264                 "Enable Transmit and Receive LLDP frames on specific interface";
265             }
266           }
267           default "txandrx";
268           description
269             "LLDP enable per port basis";
270         }
271       }
272       container nbr-list {
273         config false;
274         description
275           "LLDP Oper data - Neighbour List information";
276         list if-name {
277           key "ifName";
278           leaf ifName {
279             type string;
280             description
281               "Ethernet interface name where LLDP runs";
282           }
283           uses nbr-info-grp;
284         }
285       }
286     }
287   }
288
289   notification lldp-nbr-info-change {
290     description
291       "LLDP: Neighbor Information Changed
292        remoteSysName
293        remoteSysMgmtAddressSubType
294        remoteSysMgmtAddress
295        remotePortIdSubType
296        remotePortId
297        remoteChassisIdSubType
298        remoteChassisId
299        All of the above attributes are sent in event";
300     leaf notification-type {
301       type org-openroadm-resource-types:resource-notification-type;
302     }
303     leaf resource-type {
304       type org-openroadm-resource-types:resource-type-enum;
305       description
306         "resource-type for this notification is interface";
307     }
308     leaf resource {
309       type string;
310       description
311         "resource interface-name";
312     }
313     container nbr-info {
314       uses nbr-info-grp;
315     }
316     leaf event-time {
317       type yang:date-and-time;
318     }
319   }
320   augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:protocols" {
321     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'";
322     uses lldp-container;
323   }
324 }