Delete netconf
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / resources / modules / ietf-interfaces@2013-07-04.yang
1 module ietf-interfaces {
2
3   namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces";
4   prefix if;
5
6   import ietf-yang-types {
7     prefix yang;
8   }
9   import iana-if-type {
10     prefix ianaift;
11   }
12
13   organization
14     "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
15
16   contact
17     "WG Web:   <http://tools.ietf.org/wg/netmod/>
18      WG List:  <mailto:netmod@ietf.org>
19
20      WG Chair: David Kessens
21                <mailto:david.kessens@nsn.com>
22
23      WG Chair: Juergen Schoenwaelder
24                <mailto:j.schoenwaelder@jacobs-university.de>
25
26      Editor:   Martin Bjorklund
27                <mailto:mbj@tail-f.com>";
28
29   description
30     "This module contains a collection of YANG definitions for
31      managing network interfaces.
32
33      Copyright (c) 2013 IETF Trust and the persons identified as
34      authors of the code.  All rights reserved.
35
36      Redistribution and use in source and binary forms, with or
37      without modification, is permitted pursuant to, and subject
38      to the license terms contained in, the Simplified BSD License
39      set forth in Section 4.c of the IETF Trust's Legal Provisions
40      Relating to IETF Documents
41      (http://trustee.ietf.org/license-info).
42
43      This version of this YANG module is part of RFC XXXX; see
44      the RFC itself for full legal notices.";
45
46   // RFC Ed.: replace XXXX with actual RFC number and remove this
47   // note.
48
49   // RFC Ed.: update the date below with the date of RFC publication
50   // and remove this note.
51   revision 2013-07-04 {
52     description
53       "Initial revision.";
54     reference
55       "RFC XXXX: A YANG Data Model for Interface Management";
56   }
57
58   /* Typedefs */
59
60   typedef interface-ref {
61     type leafref {
62       path "/if:interfaces/if:interface/if:name";
63     }
64     description
65       "This type is used by data models that need to reference
66        configured interfaces.";
67   }
68
69   typedef interface-state-ref {
70     type leafref {
71       path "/if:interfaces-state/if:interface/if:name";
72     }
73     description
74       "This type is used by data models that need to reference
75        the operationally present interfaces.";
76   }
77
78   /* Features */
79
80   feature arbitrary-names {
81     description
82       "This feature indicates that the device allows user-controlled
83        interfaces to be named arbitrarily.";
84   }
85
86   feature pre-provisioning {
87     description
88       "This feature indicates that the device supports
89        pre-provisioning of interface configuration, i.e., it is
90        possible to configure an interface whose physical interface
91        hardware is not present on the device.";
92   }
93
94   feature if-mib {
95     description
96       "This feature indicates that the device implements IF-MIB.";
97     reference
98       "RFC 2863: The Interfaces Group MIB";
99   }
100
101   /* Data nodes */
102
103   container interfaces {
104     description
105       "Interface configuration parameters.";
106
107     list interface {
108       key "name";
109
110       description
111         "The list of configured interfaces on the device.
112
113          The operational state of an interface is available in the
114          /interfaces-state/interface list.  If the configuration of a
115          system-controlled interface cannot be used by the system
116          (e.g., the interface hardware present does not match the
117          interface type), then the configuration is not applied to
118          the system-controlled interface shown in the
119          /interfaces-state/interface list.  If the the configuration
120          of a user-controlled interface cannot be used by the system,
121          the configured interface is not instantiated in the
122          /interfaces-state/interface list.";
123
124      leaf name {
125         type string;
126         description
127           "The name of the interface.
128
129            A device MAY restrict the allowed values for this leaf,
130            possibly depending on the type of the interface.
131
132            For system-controlled interfaces, this leaf is the
133            device-specific name of the interface.  The 'config false'
134            list /interfaces-state/interface contains the currently
135            existing interfaces on the device.
136
137            If a client tries to create configuration for a
138            system-controlled interface that is not present in the
139            /interfaces-state/interface list, the server MAY reject
140            the request, if the implementation does not support
141            pre-provisioning of interfaces, or if the name refers to
142            an interface that can never exist in the system.  A
143            NETCONF server MUST reply with an rpc-error with the
144            error-tag 'invalid-value' in this case.
145
146            If the device supports pre-provisioning of interface
147            configuration, the feature 'pre-provisioning' is
148            advertised.
149
150            If the device allows arbitrarily named user-controlled
151            interfaces, the feature 'arbitrary-names' is advertised.
152
153            When a configured user-controlled interface is created by
154            the system, it is instantiated with the same name in the
155            /interface-state/interface list.  Since the name in that
156            list MAY be mapped to ifName by an implementation, such an
157            implementation MUST restrict the allowed values for this
158            leaf so that it matches the restrictions of ifName.
159
160            If a NETCONF server that implements this restriction is
161            sent a value that doesn't match the restriction, it MUST
162            reply with an rpc-error with the error-tag
163            'invalid-value'.";
164       }
165
166       leaf description {
167         type string;
168         description
169           "A textual description of the interface.
170
171            This leaf MAY be mapped to ifAlias by an implementation.
172            Such an implementation MUST restrict the allowed values
173            for this leaf so that it matches the restrictions of
174            ifAlias.
175
176            If a NETCONF server that implements this restriction is
177            sent a value that doesn't match the restriction, it MUST
178            reply with an rpc-error with the error-tag
179            'invalid-value'.
180
181            Since ifAlias is defined to be stored in non-volatile
182            storage, the MIB implementation MUST map ifAlias to the
183            value of 'description' in the persistently stored
184            datastore.
185
186            Specifically, if the device supports ':startup', when
187            ifAlias is read the device MUST return the value of
188            'description' in the 'startup' datastore, and when it is
189            written, it MUST be written to the 'running' and 'startup'
190            datastores.  Note that it is up to the implementation if
191            it modifies this single leaf in 'startup', or if it
192            performs an implicit copy-config from 'running' to
193            'startup'.
194
195            If the device does not support ':startup', ifAlias MUST
196            be mapped to the 'description' leaf in the 'running'
197            datastore.";
198         reference
199           "RFC 2863: The Interfaces Group MIB - ifAlias";
200       }
201
202       leaf type {
203         type ianaift:iana-if-type;
204         mandatory true;
205         description
206           "The type of the interface.
207
208            When an interface entry is created, a server MAY
209            initialize the type leaf with a valid value, e.g., if it
210            is possible to derive the type from the name of the
211            interface.
212
213            If a client tries to set the type of an interface to a
214            value that can never be used by the system, e.g., if the
215            type is not supported or if the type does not match the
216            name of the interface, the server MUST reject the request.
217            A NETCONF server MUST reply with an rpc-error with the
218            error-tag 'invalid-value' in this case.";
219         reference
220           "RFC 2863: The Interfaces Group MIB - ifType";
221       }
222
223       leaf enabled {
224         type boolean;
225         default "true";
226         description
227           "This leaf contains the configured, desired state of the
228            interface.
229
230            Systems that implement the IF-MIB use the value of this
231            leaf in the 'running' datastore to set
232            IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry
233            has been initialized, as described in RFC 2863.
234
235            Changes in this leaf in the 'running' datastore are
236            reflected in ifAdminStatus, but if ifAdminStatus is
237            changed over SNMP, this leaf is not affected.";
238         reference
239           "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
240       }
241
242       leaf link-up-down-trap-enable {
243         if-feature if-mib;
244         type enumeration {
245           enum enabled {
246             value 1;
247           }
248           enum disabled {
249             value 2;
250           }
251         }
252         description
253           "Controls whether linkUp/linkDown SNMP notifications
254            should be generated for this interface.
255
256            If this node is not configured, the value 'enabled' is
257            operationally used by the server for interfaces which do
258            not operate on top of any other interface (i.e., there are
259            no 'lower-layer-if' entries), and 'disabled' otherwise.";
260         reference
261           "RFC 2863: The Interfaces Group MIB -
262                      ifLinkUpDownTrapEnable";
263       }
264     }
265   }
266
267   container interfaces-state {
268     config false;
269     description
270       "Data nodes for the operational state of interfaces.";
271
272     list interface {
273       key "name";
274
275       description
276         "The list of interfaces on the device.
277
278          System-controlled interfaces created by the system are
279          always present in this list, whether they are configured or
280          not.";
281
282       leaf name {
283         type string;
284         description
285           "The name of the interface.
286
287            This leaf MAY be mapped to ifName by an implementation.";
288         reference
289           "RFC 2863: The Interfaces Group MIB - ifName";
290       }
291
292       leaf type {
293         type ianaift:iana-if-type;
294         mandatory true;
295         description
296           "The type of the interface.";
297         reference
298           "RFC 2863: The Interfaces Group MIB - ifType";
299       }
300
301       leaf admin-status {
302         if-feature if-mib;
303         type enumeration {
304           enum up {
305             value 1;
306             description
307               "Ready to pass packets.";
308           }
309           enum down {
310             value 2;
311             description
312               "Not ready to pass packets and not in some test mode.";
313           }
314           enum testing {
315             value 3;
316             description
317               "In some test mode.";
318           }
319         }
320         mandatory true;
321         description
322           "The desired state of the interface.
323
324            This leaf has the same read semantics as ifAdminStatus.";
325         reference
326           "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
327       }
328
329       leaf oper-status {
330         type enumeration {
331           enum up {
332             value 1;
333             description
334               "Ready to pass packets.";
335           }
336           enum down {
337             value 2;
338             description
339               "The interface does not pass any packets.";
340           }
341           enum testing {
342             value 3;
343             description
344               "In some test mode.  No operational packets can
345                be passed.";
346           }
347           enum unknown {
348             value 4;
349             description
350               "Status cannot be determined for some reason.";
351           }
352           enum dormant {
353             value 5;
354             description
355               "Waiting for some external event.";
356           }
357           enum not-present {
358             value 6;
359             description
360               "Some component (typically hardware) is missing.";
361           }
362           enum lower-layer-down {
363             value 7;
364             description
365               "Down due to state of lower-layer interface(s).";
366           }
367         }
368         mandatory true;
369         description
370           "The current operational state of the interface.
371
372            This leaf has the same semantics as ifOperStatus.";
373         reference
374           "RFC 2863: The Interfaces Group MIB - ifOperStatus";
375       }
376
377       leaf last-change {
378         type yang:date-and-time;
379         description
380           "The time the interface entered its current operational
381            state.  If the current state was entered prior to the
382            last re-initialization of the local network management
383            subsystem, then this node is not present.";
384         reference
385           "RFC 2863: The Interfaces Group MIB - ifLastChange";
386       }
387
388       leaf if-index {
389         if-feature if-mib;
390         type int32 {
391           range "1..2147483647";
392         }
393         mandatory true;
394         description
395           "The ifIndex value for the ifEntry represented by this
396            interface.";
397         reference
398           "RFC 2863: The Interfaces Group MIB - ifIndex";
399       }
400
401       leaf phys-address {
402         type yang:phys-address;
403         description
404           "The interface's address at its protocol sub-layer.  For
405           example, for an 802.x interface, this object normally
406           contains a MAC address.  The interface's media-specific
407           modules must define the bit and byte ordering and the
408           format of the value of this object.  For interfaces that do
409           not have such an address (e.g., a serial line), this node
410           is not present.";
411         reference
412           "RFC 2863: The Interfaces Group MIB - ifPhysAddress";
413       }
414
415       leaf-list higher-layer-if {
416         type interface-state-ref;
417         description
418           "A list of references to interfaces layered on top of this
419            interface.";
420         reference
421           "RFC 2863: The Interfaces Group MIB - ifStackTable";
422       }
423
424       leaf-list lower-layer-if {
425         type interface-state-ref;
426         description
427           "A list of references to interfaces layered underneath this
428            interface.";
429         reference
430           "RFC 2863: The Interfaces Group MIB - ifStackTable";
431       }
432
433       leaf speed {
434         type yang:gauge64;
435         units "bits / second";
436         description
437             "An estimate of the interface's current bandwidth in bits
438              per second.  For interfaces that do not vary in
439              bandwidth or for those where no accurate estimation can
440              be made, this node should contain the nominal bandwidth.
441              For interfaces that have no concept of bandwidth, this
442              node is not present.";
443         reference
444           "RFC 2863: The Interfaces Group MIB -
445                      ifSpeed, ifHighSpeed";
446       }
447
448       container statistics {
449         description
450           "A collection of interface-related statistics objects.";
451
452         leaf discontinuity-time {
453           type yang:date-and-time;
454           mandatory true;
455           description
456             "The time on the most recent occasion at which any one or
457              more of this interface's counters suffered a
458              discontinuity.  If no such discontinuities have occurred
459              since the last re-initialization of the local management
460              subsystem, then this node contains the time the local
461              management subsystem re-initialized itself.";
462         }
463
464         leaf in-octets {
465           type yang:counter64;
466           description
467             "The total number of octets received on the interface,
468              including framing characters.
469
470              Discontinuities in the value of this counter can occur
471              at re-initialization of the management system, and at
472              other times as indicated by the value of
473              'discontinuity-time'.";
474           reference
475             "RFC 2863: The Interfaces Group MIB - ifHCInOctets";
476         }
477         leaf in-unicast-pkts {
478           type yang:counter64;
479           description
480             "The number of packets, delivered by this sub-layer to a
481              higher (sub-)layer, which were not addressed to a
482              multicast or broadcast address at this sub-layer.
483
484              Discontinuities in the value of this counter can occur
485              at re-initialization of the management system, and at
486              other times as indicated by the value of
487              'discontinuity-time'.";
488           reference
489             "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts";
490         }
491         leaf in-broadcast-pkts {
492           type yang:counter64;
493           description
494             "The number of packets, delivered by this sub-layer to a
495              higher (sub-)layer, which were addressed to a broadcast
496              address at this sub-layer.
497
498              Discontinuities in the value of this counter can occur
499              at re-initialization of the management system, and at
500              other times as indicated by the value of
501              'discontinuity-time'.";
502           reference
503             "RFC 2863: The Interfaces Group MIB -
504                        ifHCInBroadcastPkts";
505         }
506         leaf in-multicast-pkts {
507           type yang:counter64;
508           description
509             "The number of packets, delivered by this sub-layer to a
510              higher (sub-)layer, which were addressed to a multicast
511              address at this sub-layer.  For a MAC layer protocol,
512              this includes both Group and Functional addresses.
513
514              Discontinuities in the value of this counter can occur
515              at re-initialization of the management system, and at
516              other times as indicated by the value of
517              'discontinuity-time'.";
518           reference
519             "RFC 2863: The Interfaces Group MIB -
520                        ifHCInMulticastPkts";
521         }
522         leaf in-discards {
523           type yang:counter32;
524           description
525             "The number of inbound packets which were chosen to be
526              discarded even though no errors had been detected to
527              prevent their being deliverable to a higher-layer
528              protocol.  One possible reason for discarding such a
529              packet could be to free up buffer space.
530
531              Discontinuities in the value of this counter can occur
532              at re-initialization of the management system, and at
533              other times as indicated by the value of
534              'discontinuity-time'.";
535           reference
536             "RFC 2863: The Interfaces Group MIB - ifInDiscards";
537         }
538         leaf in-errors {
539           type yang:counter32;
540           description
541             "For packet-oriented interfaces, the number of inbound
542              packets that contained errors preventing them from being
543              deliverable to a higher-layer protocol.  For character-
544              oriented or fixed-length interfaces, the number of
545              inbound transmission units that contained errors
546              preventing them from being deliverable to a higher-layer
547              protocol.
548
549              Discontinuities in the value of this counter can occur
550              at re-initialization of the management system, and at
551              other times as indicated by the value of
552              'discontinuity-time'.";
553           reference
554             "RFC 2863: The Interfaces Group MIB - ifInErrors";
555         }
556         leaf in-unknown-protos {
557           type yang:counter32;
558           description
559             "For packet-oriented interfaces, the number of packets
560              received via the interface which were discarded because
561              of an unknown or unsupported protocol.  For
562              character-oriented or fixed-length interfaces that
563              support protocol multiplexing the number of transmission
564              units received via the interface which were discarded
565              because of an unknown or unsupported protocol.  For any
566              interface that does not support protocol multiplexing,
567              this counter is not present.
568              Discontinuities in the value of this counter can occur
569              at re-initialization of the management system, and at
570              other times as indicated by the value of
571              'discontinuity-time'.";
572           reference
573             "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos";
574         }
575
576         leaf out-octets {
577           type yang:counter64;
578           description
579             "The total number of octets transmitted out of the
580              interface, including framing characters.
581
582              Discontinuities in the value of this counter can occur
583              at re-initialization of the management system, and at
584              other times as indicated by the value of
585              'discontinuity-time'.";
586           reference
587             "RFC 2863: The Interfaces Group MIB - ifHCOutOctets";
588         }
589         leaf out-unicast-pkts {
590           type yang:counter64;
591           description
592             "The total number of packets that higher-level protocols
593              requested be transmitted, and which were not addressed
594              to a multicast or broadcast address at this sub-layer,
595              including those that were discarded or not sent.
596
597              Discontinuities in the value of this counter can occur
598              at re-initialization of the management system, and at
599              other times as indicated by the value of
600              'discontinuity-time'.";
601           reference
602             "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts";
603         }
604         leaf out-broadcast-pkts {
605           type yang:counter64;
606           description
607             "The total number of packets that higher-level protocols
608              requested be transmitted, and which were addressed to a
609              broadcast address at this sub-layer, including those
610              that were discarded or not sent.
611
612              Discontinuities in the value of this counter can occur
613              at re-initialization of the management system, and at
614              other times as indicated by the value of
615              'discontinuity-time'.";
616           reference
617             "RFC 2863: The Interfaces Group MIB -
618                        ifHCOutBroadcastPkts";
619         }
620         leaf out-multicast-pkts {
621           type yang:counter64;
622           description
623             "The total number of packets that higher-level protocols
624              requested be transmitted, and which were addressed to a
625              multicast address at this sub-layer, including those
626              that were discarded or not sent.  For a MAC layer
627              protocol, this includes both Group and Functional
628              addresses.
629
630              Discontinuities in the value of this counter can occur
631              at re-initialization of the management system, and at
632              other times as indicated by the value of
633              'discontinuity-time'.";
634           reference
635             "RFC 2863: The Interfaces Group MIB -
636                        ifHCOutMulticastPkts";
637         }
638         leaf out-discards {
639           type yang:counter32;
640           description
641             "The number of outbound packets which were chosen to be
642              discarded even though no errors had been detected to
643              prevent their being transmitted.  One possible reason
644              for discarding such a packet could be to free up buffer
645              space.
646
647              Discontinuities in the value of this counter can occur
648              at re-initialization of the management system, and at
649              other times as indicated by the value of
650              'discontinuity-time'.";
651           reference
652             "RFC 2863: The Interfaces Group MIB - ifOutDiscards";
653         }
654         leaf out-errors {
655           type yang:counter32;
656           description
657             "For packet-oriented interfaces, the number of outbound
658              packets that could not be transmitted because of errors.
659              For character-oriented or fixed-length interfaces, the
660              number of outbound transmission units that could not be
661              transmitted because of errors.
662
663              Discontinuities in the value of this counter can occur
664              at re-initialization of the management system, and at
665              other times as indicated by the value of
666              'discontinuity-time'.";
667           reference
668             "RFC 2863: The Interfaces Group MIB - ifOutErrors";
669         }
670       }
671     }
672   }
673 }