Add ietf-hardware model
[mdsal.git] / model / ietf / rfc8348-ietf-hardware-state / src / main / yang-disabled / ietf-hardware-state@2018-03-13.yang
1 module ietf-hardware-state {
2   yang-version 1.1;
3   namespace "urn:ietf:params:xml:ns:yang:ietf-hardware-state";
4   prefix hw-state;
5
6   import ietf-inet-types {
7     prefix inet;
8   }
9   import ietf-yang-types {
10     prefix yang;
11   }
12   import iana-hardware {
13     prefix ianahw;
14   }
15   import ietf-hardware {
16     prefix hw;
17   }
18
19   organization
20     "IETF NETMOD (Network Modeling) Working Group";
21
22   contact
23     "WG Web:   <https://datatracker.ietf.org/wg/netmod/>
24      WG List:  <mailto:netmod@ietf.org>
25
26      Editor:   Andy Bierman
27                <mailto:andy@yumaworks.com>
28
29      Editor:   Martin Bjorklund
30                <mailto:mbj@tail-f.com>
31
32      Editor:   Jie Dong
33                <mailto:jie.dong@huawei.com>
34      Editor:   Dan Romascanu
35                <mailto:dromasca@gmail.com>";
36
37   description
38     "This module contains a collection of YANG definitions for
39      monitoring hardware.
40
41      This data model is designed as a temporary solution for
42      implementations that do not yet support the Network Management
43      Datastore Architecture (NMDA) defined in RFC 8342.  Such an
44      implementation cannot implement the module 'ietf-hardware'
45      properly, since without NMDA support, it is not possible to
46      distinguish between instances of nodes in the running
47      configuration and operational states.
48
49      The data model in this module is the same as the data model in
50      'ietf-hardware', except all nodes are marked as 'config false'.
51
52      If a server that implements this module but doesn't support NMDA
53      also supports configuration of hardware components, it SHOULD
54      also implement the module 'ietf-hardware' in the configuration
55      datastores.  The corresponding state data is found in the
56      '/hw-state:hardware' subtree.
57
58      Copyright (c) 2018 IETF Trust and the persons identified as
59      authors of the code.  All rights reserved.
60
61      Redistribution and use in source and binary forms, with or
62      without modification, is permitted pursuant to, and subject
63      to the license terms contained in, the Simplified BSD License
64      set forth in Section 4.c of the IETF Trust's Legal Provisions
65      Relating to IETF Documents
66      (https://trustee.ietf.org/license-info).
67
68      This version of this YANG module is part of RFC 8348; see
69      the RFC itself for full legal notices.";
70
71   revision 2018-03-13 {
72     description
73       "Initial revision.";
74     reference
75       "RFC 8348: A YANG Data Model for Hardware Management";
76   }
77
78   /*
79    * Features
80    */
81
82   feature entity-mib {
83     status deprecated;
84     description
85       "This feature indicates that the device implements
86        the ENTITY-MIB.";
87     reference
88       "RFC 6933: Entity MIB (Version 4)";
89   }
90
91   feature hardware-state {
92     status deprecated;
93     description
94       "Indicates that ENTITY-STATE-MIB objects are supported";
95     reference
96       "RFC 4268: Entity State MIB";
97   }
98
99   feature hardware-sensor {
100     status deprecated;
101     description
102       "Indicates that ENTITY-SENSOR-MIB objects are supported";
103     reference
104       "RFC 3433: Entity Sensor Management Information Base";
105   }
106
107   /*
108    * Data nodes
109    */
110
111   container hardware {
112     config false;
113     status deprecated;
114     description
115       "Data nodes representing components.";
116
117     leaf last-change {
118       type yang:date-and-time;
119       status deprecated;
120       description
121         "The time the '/hardware/component' list changed in the
122          operational state.";
123     }
124
125     list component {
126       key name;
127       status deprecated;
128       description
129         "List of components.
130          When the server detects a new hardware component, it
131          initializes a list entry in the operational state.
132
133          If the server does not support configuration of hardware
134          components, list entries in the operational state are
135          initialized with values for all nodes as detected by the
136          implementation.
137
138          Otherwise, this procedure is followed:
139
140            1. If there is an entry in the '/hardware/component' list
141               in the intended configuration with values for the nodes
142               'class', 'parent', and 'parent-rel-pos' that are equal
143               to the detected values, then:
144
145            1a. If the configured entry has a value for 'mfg-name'
146                that is equal to the detected value or if the
147                'mfg-name' value cannot be detected, then the list
148                entry in the operational state is initialized with the
149                configured values for all configured nodes, including
150                the 'name'.
151
152                Otherwise, the list entry in the operational state is
153                initialized with values for all nodes as detected by
154                the implementation.  The implementation may raise an
155                alarm that informs about the 'mfg-name' mismatch
156                condition.  How this is done is outside the scope of
157                this document.
158
159            1b. Otherwise (i.e., there is no matching configuration
160                entry), the list entry in the operational state is
161                initialized with values for all nodes as detected by
162                the implementation.
163
164          If the '/hardware/component' list in the intended
165          configuration is modified, then the system MUST behave as if
166          it re-initializes itself and follow the procedure in (1).";
167       reference
168         "RFC 6933: Entity MIB (Version 4) - entPhysicalEntry";
169
170       leaf name {
171         type string;
172         status deprecated;
173         description
174           "The name assigned to this component.
175
176            This name is not required to be the same as
177            entPhysicalName.";
178       }
179
180       leaf class {
181         type identityref {
182           base ianahw:hardware-class;
183         }
184         mandatory true;
185         status deprecated;
186         description
187           "An indication of the general hardware type of the
188            component.";
189         reference
190           "RFC 6933: Entity MIB (Version 4) - entPhysicalClass";
191       }
192
193       leaf physical-index {
194         if-feature entity-mib;
195         type int32 {
196           range "1..2147483647";
197         }
198         status deprecated;
199         description
200           "The entPhysicalIndex for the entPhysicalEntry represented
201            by this list entry.";
202         reference
203           "RFC 6933: Entity MIB (Version 4) - entPhysicalIndex";
204       }
205
206       leaf description {
207         type string;
208         status deprecated;
209         description
210           "A textual description of the component.  This node should
211            contain a string that identifies the manufacturer's name
212            for the component and should be set to a distinct value
213            for each version or model of the component.";
214         reference
215           "RFC 6933: Entity MIB (Version 4) - entPhysicalDescr";
216       }
217
218       leaf parent {
219         type leafref {
220           path "../../component/name";
221           require-instance false;
222         }
223         status deprecated;
224
225         description
226           "The name of the component that physically contains this
227            component.
228
229            If this leaf is not instantiated, it indicates that this
230            component is not contained in any other component.
231
232            In the event that a physical component is contained by
233            more than one physical component (e.g., double-wide
234            modules), this node contains the name of one of these
235            components.  An implementation MUST use the same name
236            every time this node is instantiated.";
237         reference
238           "RFC 6933: Entity MIB (Version 4) -
239                      entPhysicalContainedIn";
240       }
241
242       leaf parent-rel-pos {
243         type int32 {
244           range "0 .. 2147483647";
245         }
246         status deprecated;
247         description
248           "An indication of the relative position of this child
249            component among all its sibling components.  Sibling
250            components are defined as components that:
251
252              o share the same value of the 'parent' node and
253
254              o share a common base identity for the 'class' node.
255
256            Note that the last rule gives implementations flexibility
257            in how components are numbered.  For example, some
258            implementations might have a single number series for all
259            components derived from 'ianahw:port', while some others
260            might have different number series for different
261            components with identities derived from 'ianahw:port' (for
262            example, one for RJ45 and one for SFP).";
263
264         reference
265           "RFC 6933: Entity MIB (Version 4) -
266                      entPhysicalParentRelPos";
267       }
268
269       leaf-list contains-child {
270         type leafref {
271           path "../../component/name";
272         }
273         status deprecated;
274         description
275           "The name of the contained component.";
276         reference
277           "RFC 6933: Entity MIB (Version 4) - entPhysicalChildIndex";
278       }
279
280       leaf hardware-rev {
281         type string;
282         status deprecated;
283         description
284           "The vendor-specific hardware revision string for the
285            component.  The preferred value is the hardware revision
286            identifier actually printed on the component itself (if
287            present).";
288         reference
289           "RFC 6933: Entity MIB (Version 4) -
290                      entPhysicalHardwareRev";
291       }
292
293       leaf firmware-rev {
294         type string;
295         status deprecated;
296         description
297           "The vendor-specific firmware revision string for the
298            component.";
299         reference
300           "RFC 6933: Entity MIB (Version 4) -
301                      entPhysicalFirmwareRev";
302       }
303
304       leaf software-rev {
305         type string;
306         status deprecated;
307         description
308           "The vendor-specific software revision string for the
309            component.";
310         reference
311           "RFC 6933: Entity MIB (Version 4) -
312                      entPhysicalSoftwareRev";
313       }
314
315       leaf serial-num {
316         type string;
317         status deprecated;
318
319         description
320           "The vendor-specific serial number string for the
321            component.  The preferred value is the serial number
322            string actually printed on the component itself (if
323            present).";
324         reference
325           "RFC 6933: Entity MIB (Version 4) - entPhysicalSerialNum";
326       }
327
328       leaf mfg-name {
329         type string;
330         status deprecated;
331         description
332           "The name of the manufacturer of this physical component.
333            The preferred value is the manufacturer name string
334            actually printed on the component itself (if present).
335
336            Note that comparisons between instances of the
337            'model-name', 'firmware-rev', 'software-rev', and
338            'serial-num' nodes are only meaningful amongst components
339            with the same value of 'mfg-name'.
340
341            If the manufacturer name string associated with the
342            physical component is unknown to the server, then this
343            node is not instantiated.";
344         reference
345           "RFC 6933: Entity MIB (Version 4) - entPhysicalMfgName";
346       }
347
348       leaf model-name {
349         type string;
350         status deprecated;
351         description
352           "The vendor-specific model name identifier string
353            associated with this physical component.  The preferred
354            value is the customer-visible part number, which may be
355            printed on the component itself.
356
357            If the model name string associated with the physical
358            component is unknown to the server, then this node is not
359            instantiated.";
360         reference
361           "RFC 6933: Entity MIB (Version 4) - entPhysicalModelName";
362       }
363
364       leaf alias {
365         type string;
366         status deprecated;
367         description
368           "An 'alias' name for the component, as specified by a
369            network manager, that provides a non-volatile 'handle' for
370            the component.
371
372            If no configured value exists, the server MAY set the
373            value of this node to a locally unique value in the
374            operational state.
375
376            A server implementation MAY map this leaf to the
377            entPhysicalAlias MIB object.  Such an implementation needs
378            to use some mechanism to handle the differences in size
379            and characters allowed between this leaf and
380            entPhysicalAlias.  The definition of such a mechanism is
381            outside the scope of this document.";
382         reference
383           "RFC 6933: Entity MIB (Version 4) - entPhysicalAlias";
384       }
385
386       leaf asset-id {
387         type string;
388         status deprecated;
389         description
390           "This node is a user-assigned asset tracking identifier for
391            the component.
392
393            A server implementation MAY map this leaf to the
394            entPhysicalAssetID MIB object.  Such an implementation
395            needs to use some mechanism to handle the differences in
396            size and characters allowed between this leaf and
397            entPhysicalAssetID.  The definition of such a mechanism is
398            outside the scope of this document.";
399         reference
400           "RFC 6933: Entity MIB (Version 4) - entPhysicalAssetID";
401       }
402
403       leaf is-fru {
404         type boolean;
405         status deprecated;
406         description
407           "This node indicates whether or not this component is
408            considered a 'field-replaceable unit' by the vendor.  If
409            this node contains the value 'true', then this component
410            identifies a field-replaceable unit.  For all components
411            that are permanently contained within a field-replaceable
412            unit, the value 'false' should be returned for this
413            node.";
414
415         reference
416           "RFC 6933: Entity MIB (Version 4) - entPhysicalIsFRU";
417       }
418
419       leaf mfg-date {
420         type yang:date-and-time;
421         status deprecated;
422         description
423           "The date of manufacturing of the managed component.";
424         reference
425           "RFC 6933: Entity MIB (Version 4) - entPhysicalMfgDate";
426       }
427
428       leaf-list uri {
429         type inet:uri;
430         status deprecated;
431         description
432           "This node contains identification information about the
433            component.";
434         reference
435           "RFC 6933: Entity MIB (Version 4) - entPhysicalUris";
436       }
437
438       leaf uuid {
439         type yang:uuid;
440         status deprecated;
441         description
442           "A Universally Unique Identifier of the component.";
443         reference
444           "RFC 6933: Entity MIB (Version 4) - entPhysicalUUID";
445       }
446
447       container state {
448         if-feature hardware-state;
449         status deprecated;
450         description
451           "State-related nodes";
452         reference
453           "RFC 4268: Entity State MIB";
454
455         leaf state-last-changed {
456           type yang:date-and-time;
457           status deprecated;
458           description
459             "The date and time when the value of any of the
460              admin-state, oper-state, usage-state, alarm-state, or
461              standby-state changed for this component.
462
463              If there has been no change since the last
464              re-initialization of the local system, this node
465              contains the date and time of local system
466              initialization.  If there has been no change since the
467              component was added to the local system, this node
468              contains the date and time of the insertion.";
469           reference
470             "RFC 4268: Entity State MIB - entStateLastChanged";
471         }
472
473         leaf admin-state {
474           type hw:admin-state;
475           status deprecated;
476           description
477             "The administrative state for this component.
478
479              This node refers to a component's administrative
480              permission to service both other components within its
481              containment hierarchy as well as other users of its
482              services defined by means outside the scope of this
483              module.
484
485              Some components exhibit only a subset of the remaining
486              administrative state values.  Some components cannot be
487              locked; hence, this node exhibits only the 'unlocked'
488              state.  Other components cannot be shut down gracefully;
489              hence, this node does not exhibit the 'shutting-down'
490              state.";
491           reference
492             "RFC 4268: Entity State MIB - entStateAdmin";
493         }
494
495         leaf oper-state {
496           type hw:oper-state;
497           status deprecated;
498           description
499             "The operational state for this component.
500
501              Note that this node does not follow the administrative
502              state.  An administrative state of 'down' does not
503              predict an operational state of 'disabled'.
504
505              Note that some implementations may not be able to
506              accurately report oper-state while the admin-state node
507              has a value other than 'unlocked'.  In these cases, this
508              node MUST have a value of 'unknown'.";
509           reference
510             "RFC 4268: Entity State MIB - entStateOper";
511         }
512
513         leaf usage-state {
514           type hw:usage-state;
515           status deprecated;
516           description
517             "The usage state for this component.
518
519              This node refers to a component's ability to service
520              more components in a containment hierarchy.
521
522              Some components will exhibit only a subset of the usage
523              state values.  Components that are unable to ever
524              service any components within a containment hierarchy
525              will always have a usage state of 'busy'.  In some
526              cases, a component will be able to support only one
527              other component within its containment hierarchy and
528              will therefore only exhibit values of 'idle' and
529              'busy'.";
530           reference
531             "RFC 4268: Entity State MIB - entStateUsage";
532         }
533
534         leaf alarm-state {
535           type hw:alarm-state;
536           status deprecated;
537           description
538             "The alarm state for this component.  It does not
539              include the alarms raised on child components within its
540              containment hierarchy.";
541           reference
542             "RFC 4268: Entity State MIB - entStateAlarm";
543         }
544
545         leaf standby-state {
546           type hw:standby-state;
547           status deprecated;
548           description
549             "The standby state for this component.
550
551              Some components will exhibit only a subset of the
552              remaining standby state values.  If this component
553              cannot operate in a standby role, the value of this node
554              will always be 'providing-service'.";
555           reference
556             "RFC 4268: Entity State MIB - entStateStandby";
557         }
558       }
559       container sensor-data {
560         when 'derived-from-or-self(../class,
561                                    "ianahw:sensor")' {
562           description
563             "Sensor data nodes present for any component of type
564              'sensor'";
565         }
566         if-feature hardware-sensor;
567         status deprecated;
568
569         description
570           "Sensor-related nodes.";
571         reference
572           "RFC 3433: Entity Sensor Management Information Base";
573
574         leaf value {
575           type hw:sensor-value;
576           status deprecated;
577           description
578             "The most recent measurement obtained by the server
579              for this sensor.
580
581              A client that periodically fetches this node should also
582              fetch the nodes 'value-type', 'value-scale', and
583              'value-precision', since they may change when the value
584              is changed.";
585           reference
586             "RFC 3433: Entity Sensor Management Information Base -
587                        entPhySensorValue";
588         }
589
590         leaf value-type {
591           type hw:sensor-value-type;
592           status deprecated;
593           description
594             "The type of data units associated with the
595              sensor value";
596           reference
597             "RFC 3433: Entity Sensor Management Information Base -
598                        entPhySensorType";
599         }
600
601         leaf value-scale {
602           type hw:sensor-value-scale;
603           status deprecated;
604           description
605             "The (power of 10) scaling factor associated
606              with the sensor value";
607           reference
608             "RFC 3433: Entity Sensor Management Information Base -
609                        entPhySensorScale";
610         }
611
612         leaf value-precision {
613           type hw:sensor-value-precision;
614           status deprecated;
615           description
616             "The number of decimal places of precision
617              associated with the sensor value";
618           reference
619             "RFC 3433: Entity Sensor Management Information Base -
620                        entPhySensorPrecision";
621         }
622
623         leaf oper-status {
624           type hw:sensor-status;
625           status deprecated;
626           description
627             "The operational status of the sensor.";
628           reference
629             "RFC 3433: Entity Sensor Management Information Base -
630                        entPhySensorOperStatus";
631         }
632
633         leaf units-display {
634           type string;
635           status deprecated;
636           description
637             "A textual description of the data units that should be
638              used in the display of the sensor value.";
639           reference
640             "RFC 3433: Entity Sensor Management Information Base -
641                        entPhySensorUnitsDisplay";
642         }
643
644         leaf value-timestamp {
645           type yang:date-and-time;
646           status deprecated;
647           description
648             "The time the status and/or value of this sensor was last
649              obtained by the server.";
650           reference
651             "RFC 3433: Entity Sensor Management Information Base -
652                        entPhySensorValueTimeStamp";
653         }
654
655         leaf value-update-rate {
656           type uint32;
657           units "milliseconds";
658           status deprecated;
659           description
660             "An indication of the frequency that the server updates
661              the associated 'value' node, represented in
662              milliseconds.  The value zero indicates:
663
664               - the sensor value is updated on demand (e.g.,
665                 when polled by the server for a get-request),
666
667               - the sensor value is updated when the sensor
668                 value changes (event-driven), or
669
670               - the server does not know the update rate.";
671           reference
672             "RFC 3433: Entity Sensor Management Information Base -
673                        entPhySensorValueUpdateRate";
674         }
675       }
676     }
677   }
678
679   /*
680    * Notifications
681    */
682
683   notification hardware-state-change {
684     status deprecated;
685     description
686       "A hardware-state-change notification is generated when the
687        value of /hardware/last-change changes in the operational
688        state.";
689     reference
690       "RFC 6933: Entity MIB (Version 4) - entConfigChange";
691   }
692
693   notification hardware-state-oper-enabled {
694     if-feature hardware-state;
695     status deprecated;
696     description
697       "A hardware-state-oper-enabled notification signifies that a
698        component has transitioned into the 'enabled' state.";
699
700     leaf name {
701       type leafref {
702         path "/hardware/component/name";
703       }
704       status deprecated;
705       description
706         "The name of the component that has transitioned into the
707          'enabled' state.";
708     }
709     leaf admin-state {
710       type leafref {
711         path "/hardware/component/state/admin-state";
712       }
713       status deprecated;
714       description
715         "The administrative state for the component.";
716     }
717     leaf alarm-state {
718       type leafref {
719         path "/hardware/component/state/alarm-state";
720       }
721       status deprecated;
722       description
723         "The alarm state for the component.";
724     }
725     reference
726       "RFC 4268: Entity State MIB - entStateOperEnabled";
727   }
728
729   notification hardware-state-oper-disabled {
730     if-feature hardware-state;
731     status deprecated;
732     description
733       "A hardware-state-oper-disabled notification signifies that a
734        component has transitioned into the 'disabled' state.";
735
736     leaf name {
737       type leafref {
738         path "/hardware/component/name";
739       }
740       status deprecated;
741       description
742         "The name of the component that has transitioned into the
743          'disabled' state.";
744     }
745     leaf admin-state {
746       type leafref {
747         path "/hardware/component/state/admin-state";
748       }
749       status deprecated;
750
751       description
752         "The administrative state for the component.";
753     }
754     leaf alarm-state {
755       type leafref {
756         path "/hardware/component/state/alarm-state";
757       }
758       status deprecated;
759       description
760         "The alarm state for the component.";
761     }
762     reference
763       "RFC 4268: Entity State MIB - entStateOperDisabled";
764   }
765
766 }