Allow multiple NTS Manager instances to run on the same machine.
[sim/o1-interface.git] / ntsimulator / yang / o-ran-sc / o-ran-ru / ietf-hardware.yang
1 module ietf-hardware {
2 yang-version 1.1;
3 namespace "urn:ietf:params:xml:ns:yang:ietf-hardware";
4 prefix hw;
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
16 organization
17   "IETF NETMOD (Network Modeling) Working Group";
18
19 contact
20   "WG Web:   <https://datatracker.ietf.org/wg/netmod/>
21    WG List:  <mailto:netmod@ietf.org>
22    Editor:   Andy Bierman
23              <mailto:andy@yumaworks.com>
24    Editor:   Martin Bjorklund
25              <mailto:mbj@tail-f.com>
26    Editor:   Jie Dong
27              <mailto:jie.dong@huawei.com>
28    Editor:   Dan Romascanu
29              <mailto:dromasca@gmail.com>";
30
31 description
32   "This module contains a collection of YANG definitions for
33    managing hardware.
34    This data model is designed for the Network Management Datastore
35    Architecture (NMDA) defined in RFC 8342.
36    Copyright (c) 2018 IETF Trust and the persons identified as
37    authors of the code.  All rights reserved.
38    Redistribution and use in source and binary forms, with or
39    without modification, is permitted pursuant to, and subject
40    to the license terms contained in, the Simplified BSD License
41    set forth in Section 4.c of the IETF Trust's Legal Provisions
42    Relating to IETF Documents
43    (https://trustee.ietf.org/license-info).
44    This version of this YANG module is part of RFC 8348; see
45    the RFC itself for full legal notices.";
46
47 revision 2018-03-13 {
48   description
49     "Initial revision.";
50   reference
51     "RFC 8348: A YANG Data Model for Hardware Management";
52 }
53
54 /*
55  * Features
56  */
57
58 feature entity-mib {
59   description
60     "This feature indicates that the device implements
61      the ENTITY-MIB.";
62   reference
63     "RFC 6933: Entity MIB (Version 4)";
64 }
65
66 feature hardware-state {
67   description
68     "Indicates that ENTITY-STATE-MIB objects are supported";
69   reference
70     "RFC 4268: Entity State MIB";
71 }
72
73 feature hardware-sensor {
74   description
75     "Indicates that ENTITY-SENSOR-MIB objects are supported";
76   reference
77     "RFC 3433: Entity Sensor Management Information Base";
78 }
79
80 /*
81  * Typedefs
82  */
83
84 typedef admin-state {
85   type enumeration {
86     enum unknown {
87       value 1;
88       description
89         "The resource is unable to report administrative state.";
90     }
91     enum locked {
92       value 2;
93       description
94         "The resource is administratively prohibited from use.";
95     }
96     enum shutting-down {
97       value 3;
98       description
99         "The resource usage is administratively limited to current
100          instances of use.";
101     }
102     enum unlocked {
103       value 4;
104       description
105         "The resource is not administratively prohibited from
106          use.";
107     }
108   }
109   description
110     "Represents the various possible administrative states.";
111   reference
112     "RFC 4268: Entity State MIB - EntityAdminState";
113 }
114
115 typedef oper-state {
116   type enumeration {
117     enum unknown {
118       value 1;
119       description
120         "The resource is unable to report its operational state.";
121     }
122     enum disabled {
123       value 2;
124       description
125         "The resource is totally inoperable.";
126     }
127     enum enabled {
128       value 3;
129
130       description
131         "The resource is partially or fully operable.";
132     }
133     enum testing {
134       value 4;
135       description
136         "The resource is currently being tested and cannot
137          therefore report whether or not it is operational.";
138     }
139   }
140   description
141     "Represents the possible values of operational states.";
142   reference
143     "RFC 4268: Entity State MIB - EntityOperState";
144 }
145
146 typedef usage-state {
147   type enumeration {
148     enum unknown {
149       value 1;
150       description
151         "The resource is unable to report usage state.";
152     }
153     enum idle {
154       value 2;
155       description
156         "The resource is servicing no users.";
157     }
158     enum active {
159       value 3;
160       description
161         "The resource is currently in use, and it has sufficient
162          spare capacity to provide for additional users.";
163     }
164     enum busy {
165       value 4;
166       description
167         "The resource is currently in use, but it currently has no
168          spare capacity to provide for additional users.";
169     }
170   }
171   description
172     "Represents the possible values of usage states.";
173   reference
174     "RFC 4268: Entity State MIB -  EntityUsageState";
175 }
176
177 typedef alarm-state {
178   type bits {
179     bit unknown {
180       position 0;
181       description
182         "The resource is unable to report alarm state.";
183     }
184     bit under-repair {
185       position 1;
186       description
187         "The resource is currently being repaired, which, depending
188          on the implementation, may make the other values in this
189          bit string not meaningful.";
190     }
191     bit critical {
192       position 2;
193       description
194         "One or more critical alarms are active against the
195          resource.";
196     }
197     bit major {
198       position 3;
199       description
200         "One or more major alarms are active against the
201          resource.";
202     }
203     bit minor {
204       position 4;
205       description
206         "One or more minor alarms are active against the
207          resource.";
208     }
209     bit warning {
210       position 5;
211       description
212         "One or more warning alarms are active against the
213          resource.";
214     }
215     bit indeterminate {
216       position 6;
217       description
218         "One or more alarms of whose perceived severity cannot be
219          determined are active against this resource.";
220     }
221   }
222   description
223     "Represents the possible values of alarm states.  An alarm is a
224      persistent indication of an error or warning condition.
225      When no bits of this attribute are set, then no active alarms
226      are known against this component and it is not under repair.";
227   reference
228     "RFC 4268: Entity State MIB - EntityAlarmStatus";
229 }
230
231 typedef standby-state {
232   type enumeration {
233     enum unknown {
234       value 1;
235       description
236         "The resource is unable to report standby state.";
237     }
238     enum hot-standby {
239       value 2;
240       description
241         "The resource is not providing service, but it will be
242          immediately able to take over the role of the resource to
243          be backed up, without the need for initialization
244          activity, and will contain the same information as the
245          resource to be backed up.";
246     }
247     enum cold-standby {
248       value 3;
249       description
250         "The resource is to back up another resource, but it will
251          not be immediately able to take over the role of a
252          resource to be backed up and will require some
253          initialization activity.";
254     }
255     enum providing-service {
256       value 4;
257       description
258         "The resource is providing service.";
259     }
260   }
261   description
262     "Represents the possible values of standby states.";
263   reference
264     "RFC 4268: Entity State MIB - EntityStandbyStatus";
265 }
266
267 typedef sensor-value-type {
268   type enumeration {
269     enum other {
270       value 1;
271       description
272         "A measure other than those listed below.";
273     }
274     enum unknown {
275       value 2;
276       description
277         "An unknown measurement or arbitrary, relative numbers";
278     }
279     enum volts-AC {
280       value 3;
281       description
282         "A measure of electric potential (alternating current).";
283     }
284     enum volts-DC {
285       value 4;
286       description
287         "A measure of electric potential (direct current).";
288     }
289     enum amperes {
290       value 5;
291       description
292         "A measure of electric current.";
293     }
294     enum watts {
295       value 6;
296       description
297         "A measure of power.";
298     }
299     enum hertz {
300       value 7;
301       description
302         "A measure of frequency.";
303     }
304     enum celsius {
305       value 8;
306       description
307         "A measure of temperature.";
308     }
309     enum percent-RH {
310       value 9;
311       description
312         "A measure of percent relative humidity.";
313     }
314     enum rpm {
315       value 10;
316       description
317         "A measure of shaft revolutions per minute.";
318     }
319     enum cmm {
320       value 11;
321       description
322         "A measure of cubic meters per minute (airflow).";
323     }
324     enum truth-value {
325       value 12;
326       description
327         "Value is one of 1 (true) or 2 (false)";
328     }
329   }
330   description
331     "A node using this data type represents the sensor measurement
332      data type associated with a physical sensor value.  The actual
333      data units are determined by examining a node of this type
334      together with the associated sensor-value-scale node.
335      A node of this type SHOULD be defined together with nodes of
336      type sensor-value-scale and type sensor-value-precision.
337      These three types are used to identify the semantics of a node
338      of type sensor-value.";
339   reference
340     "RFC 3433: Entity Sensor Management Information Base -
341                EntitySensorDataType";
342 }
343
344 typedef sensor-value-scale {
345   type enumeration {
346     enum yocto {
347       value 1;
348       description
349         "Data scaling factor of 10^-24.";
350     }
351     enum zepto {
352       value 2;
353       description
354         "Data scaling factor of 10^-21.";
355     }
356     enum atto {
357       value 3;
358       description
359         "Data scaling factor of 10^-18.";
360     }
361     enum femto {
362       value 4;
363       description
364         "Data scaling factor of 10^-15.";
365     }
366     enum pico {
367       value 5;
368       description
369         "Data scaling factor of 10^-12.";
370     }
371     enum nano {
372       value 6;
373       description
374         "Data scaling factor of 10^-9.";
375     }
376     enum micro {
377       value 7;
378       description
379         "Data scaling factor of 10^-6.";
380     }
381     enum milli {
382       value 8;
383       description
384         "Data scaling factor of 10^-3.";
385     }
386     enum units {
387       value 9;
388       description
389         "Data scaling factor of 10^0.";
390     }
391     enum kilo {
392       value 10;
393       description
394         "Data scaling factor of 10^3.";
395     }
396     enum mega {
397       value 11;
398       description
399         "Data scaling factor of 10^6.";
400     }
401     enum giga {
402       value 12;
403       description
404         "Data scaling factor of 10^9.";
405     }
406     enum tera {
407       value 13;
408       description
409         "Data scaling factor of 10^12.";
410     }
411     enum peta {
412       value 14;
413       description
414         "Data scaling factor of 10^15.";
415     }
416     enum exa {
417       value 15;
418       description
419         "Data scaling factor of 10^18.";
420     }
421     enum zetta {
422       value 16;
423       description
424         "Data scaling factor of 10^21.";
425     }
426     enum yotta {
427       value 17;
428       description
429         "Data scaling factor of 10^24.";
430     }
431   }
432   description
433     "A node using this data type represents a data scaling factor,
434      represented with an International System of Units (SI) prefix.
435      The actual data units are determined by examining a node of
436      this type together with the associated sensor-value-type.
437      A node of this type SHOULD be defined together with nodes of
438      type sensor-value-type and type sensor-value-precision.
439      Together, associated nodes of these three types are used to
440      identify the semantics of a node of type sensor-value.";
441   reference
442     "RFC 3433: Entity Sensor Management Information Base -
443                EntitySensorDataScale";
444 }
445
446 typedef sensor-value-precision {
447   type int8 {
448     range "-8 .. 9";
449   }
450   description
451     "A node using this data type represents a sensor value
452      precision range.
453      A node of this type SHOULD be defined together with nodes of
454      type sensor-value-type and type sensor-value-scale.  Together,
455      associated nodes of these three types are used to identify the
456      semantics of a node of type sensor-value.
457      If a node of this type contains a value in the range 1 to 9,
458      it represents the number of decimal places in the fractional
459      part of an associated sensor-value fixed-point number.
460      If a node of this type contains a value in the range -8 to -1,
461      it represents the number of accurate digits in the associated
462      sensor-value fixed-point number.
463      The value zero indicates the associated sensor-value node is
464      not a fixed-point number.
465      Server implementers must choose a value for the associated
466      sensor-value-precision node so that the precision and accuracy
467      of the associated sensor-value node is correctly indicated.
468      For example, a component representing a temperature sensor
469      that can measure 0 to 100 degrees C in 0.1 degree
470      increments, +/- 0.05 degrees, would have a
471      sensor-value-precision value of '1', a sensor-value-scale
472      value of 'units', and a sensor-value ranging from '0' to
473      '1000'.  The sensor-value would be interpreted as
474      'degrees C * 10'.";
475   reference
476     "RFC 3433: Entity Sensor Management Information Base -
477                EntitySensorPrecision";
478 }
479
480 typedef sensor-value {
481   type int32 {
482     range "-1000000000 .. 1000000000";
483   }
484   description
485    "A node using this data type represents a sensor value.
486     A node of this type SHOULD be defined together with nodes of
487     type sensor-value-type, type sensor-value-scale, and
488     type sensor-value-precision.  Together, associated nodes of
489     those three types are used to identify the semantics of a node
490     of this data type.
491     The semantics of a node using this data type are determined by
492     the value of the associated sensor-value-type node.
493     If the associated sensor-value-type node is equal to 'voltsAC',
494     'voltsDC', 'amperes', 'watts', 'hertz', 'celsius', or 'cmm',
495     then a node of this type MUST contain a fixed-point number
496     ranging from -999,999,999 to +999,999,999.  The value
497     -1000000000 indicates an underflow error.  The value
498     +1000000000 indicates an overflow error.  The
499     sensor-value-precision indicates how many fractional digits
500     are represented in the associated sensor-value node.
501     If the associated sensor-value-type node is equal to
502     'percentRH', then a node of this type MUST contain a number
503     ranging from 0 to 100.
504     If the associated sensor-value-type node is equal to 'rpm',
505     then a node of this type MUST contain a number ranging from
506     -999,999,999 to +999,999,999.
507     If the associated sensor-value-type node is equal to
508     'truth-value', then a node of this type MUST contain either the
509     value 1 (true) or the value 2 (false).
510     If the associated sensor-value-type node is equal to 'other' or
511     'unknown', then a node of this type MUST contain a number
512     ranging from -1000000000 to 1000000000.";
513   reference
514     "RFC 3433: Entity Sensor Management Information Base -
515                EntitySensorValue";
516 }
517
518 typedef sensor-status {
519   type enumeration {
520     enum ok {
521       value 1;
522       description
523         "Indicates that the server can obtain the sensor value.";
524     }
525     enum unavailable {
526       value 2;
527       description
528         "Indicates that the server presently cannot obtain the
529          sensor value.";
530     }
531     enum nonoperational {
532       value 3;
533       description
534         "Indicates that the server believes the sensor is broken.
535          The sensor could have a hard failure (disconnected wire)
536          or a soft failure such as out-of-range, jittery, or wildly
537          fluctuating readings.";
538     }
539   }
540   description
541     "A node using this data type represents the operational status
542      of a physical sensor.";
543   reference
544     "RFC 3433: Entity Sensor Management Information Base -
545                EntitySensorStatus";
546 }
547
548 /*
549  * Data nodes
550  */
551
552 container hardware {
553   description
554     "Data nodes representing components.
555      If the server supports configuration of hardware components,
556      then this data model is instantiated in the configuration
557      datastores supported by the server.  The leaf-list 'datastore'
558      for the module 'ietf-hardware' in the YANG library provides
559      this information.";
560
561   leaf last-change {
562     type yang:date-and-time;
563     config false;
564     description
565       "The time the '/hardware/component' list changed in the
566        operational state.";
567   }
568
569   list component {
570     key name;
571     description
572       "List of components.
573        When the server detects a new hardware component, it
574        initializes a list entry in the operational state.
575        If the server does not support configuration of hardware
576        components, list entries in the operational state are
577        initialized with values for all nodes as detected by the
578        implementation.
579        Otherwise, this procedure is followed:
580          1. If there is an entry in the '/hardware/component' list
581             in the intended configuration with values for the nodes
582             'class', 'parent', and 'parent-rel-pos' that are equal
583             to the detected values, then the list entry in the
584             operational state is initialized with the configured
585             values, including the 'name'.
586          2. Otherwise (i.e., there is no matching configuration
587             entry), the list entry in the operational state is
588             initialized with values for all nodes as detected by
589             the implementation.
590        If the '/hardware/component' list in the intended
591        configuration is modified, then the system MUST behave as if
592        it re-initializes itself and follow the procedure in (1).";
593     reference
594       "RFC 6933: Entity MIB (Version 4) - entPhysicalEntry";
595
596     leaf name {
597       type string;
598       description
599         "The name assigned to this component.
600          This name is not required to be the same as
601          entPhysicalName.";
602     }
603
604     leaf class {
605       type identityref {
606         base ianahw:hardware-class;
607       }
608       mandatory true;
609       description
610         "An indication of the general hardware type of the
611          component.";
612       reference
613         "RFC 6933: Entity MIB (Version 4) - entPhysicalClass";
614     }
615
616     leaf physical-index {
617       if-feature entity-mib;
618       type int32 {
619         range "1..2147483647";
620       }
621       config false;
622       description
623         "The entPhysicalIndex for the entPhysicalEntry represented
624          by this list entry.";
625       reference
626         "RFC 6933: Entity MIB (Version 4) - entPhysicalIndex";
627     }
628
629     leaf description {
630       type string;
631       config false;
632       description
633         "A textual description of the component.  This node should
634          contain a string that identifies the manufacturer's name
635          for the component and should be set to a distinct value
636          for each version or model of the component.";
637       reference
638         "RFC 6933: Entity MIB (Version 4) - entPhysicalDescr";
639     }
640
641     leaf parent {
642       type leafref {
643         path "../../component/name";
644         require-instance false;
645       }
646       description
647         "The name of the component that physically contains this
648          component.
649          If this leaf is not instantiated, it indicates that this
650          component is not contained in any other component.
651          In the event that a physical component is contained by
652          more than one physical component (e.g., double-wide
653          modules), this node contains the name of one of these
654          components.  An implementation MUST use the same name
655          every time this node is instantiated.";
656       reference
657         "RFC 6933: Entity MIB (Version 4) - entPhysicalContainedIn";
658     }
659
660     leaf parent-rel-pos {
661       type int32 {
662         range "0 .. 2147483647";
663       }
664       description
665         "An indication of the relative position of this child
666          component among all its sibling components.  Sibling
667          components are defined as components that:
668            o share the same value of the 'parent' node and
669            o share a common base identity for the 'class' node.
670          Note that the last rule gives implementations flexibility
671          in how components are numbered.  For example, some
672          implementations might have a single number series for all
673          components derived from 'ianahw:port', while some others
674          might have different number series for different
675          components with identities derived from 'ianahw:port' (for
676          example, one for registered jack 45 (RJ45) and one for
677          small form-factor pluggable (SFP)).";
678
679       reference
680         "RFC 6933: Entity MIB (Version 4) -
681                    entPhysicalParentRelPos";
682     }
683
684     leaf-list contains-child {
685       type leafref {
686         path "../../component/name";
687       }
688       config false;
689       description
690         "The name of the contained component.";
691       reference
692         "RFC 6933: Entity MIB (Version 4) - entPhysicalChildIndex";
693     }
694
695     leaf hardware-rev {
696       type string;
697       config false;
698       description
699         "The vendor-specific hardware revision string for the
700          component.  The preferred value is the hardware revision
701          identifier actually printed on the component itself (if
702          present).";
703       reference
704         "RFC 6933: Entity MIB (Version 4) -
705                    entPhysicalHardwareRev";
706     }
707
708     leaf firmware-rev {
709       type string;
710       config false;
711       description
712         "The vendor-specific firmware revision string for the
713          component.";
714       reference
715         "RFC 6933: Entity MIB (Version 4) -
716                    entPhysicalFirmwareRev";
717     }
718
719     leaf software-rev {
720       type string;
721       config false;
722
723       description
724         "The vendor-specific software revision string for the
725          component.";
726       reference
727         "RFC 6933: Entity MIB (Version 4) -
728                    entPhysicalSoftwareRev";
729     }
730
731     leaf serial-num {
732       type string;
733       config false;
734       description
735         "The vendor-specific serial number string for the
736          component.  The preferred value is the serial number
737          string actually printed on the component itself (if
738          present).";
739       reference
740         "RFC 6933: Entity MIB (Version 4) - entPhysicalSerialNum";
741     }
742
743     leaf mfg-name {
744       type string;
745       config false;
746       description
747         "The name of the manufacturer of this physical component.
748          The preferred value is the manufacturer name string
749          actually printed on the component itself (if present).
750          Note that comparisons between instances of the
751          'model-name', 'firmware-rev', 'software-rev', and
752          'serial-num' nodes are only meaningful amongst components
753          with the same value of 'mfg-name'.
754          If the manufacturer name string associated with the
755          physical component is unknown to the server, then this
756          node is not instantiated.";
757       reference
758         "RFC 6933: Entity MIB (Version 4) - entPhysicalMfgName";
759     }
760
761     leaf model-name {
762       type string;
763       config false;
764       description
765         "The vendor-specific model name identifier string
766          associated with this physical component.  The preferred
767          value is the customer-visible part number, which may be
768          printed on the component itself.
769          If the model name string associated with the physical
770          component is unknown to the server, then this node is not
771          instantiated.";
772       reference
773         "RFC 6933: Entity MIB (Version 4) - entPhysicalModelName";
774     }
775
776     leaf alias {
777       type string;
778       description
779         "An 'alias' name for the component, as specified by a
780          network manager, that provides a non-volatile 'handle' for
781          the component.
782          If no configured value exists, the server MAY set the
783          value of this node to a locally unique value in the
784          operational state.
785          A server implementation MAY map this leaf to the
786          entPhysicalAlias MIB object.  Such an implementation needs
787          to use some mechanism to handle the differences in size
788          and characters allowed between this leaf and
789          entPhysicalAlias.  The definition of such a mechanism is
790          outside the scope of this document.";
791       reference
792         "RFC 6933: Entity MIB (Version 4) - entPhysicalAlias";
793     }
794
795     leaf asset-id {
796       type string;
797       description
798         "This node is a user-assigned asset tracking identifier for
799          the component.
800          A server implementation MAY map this leaf to the
801          entPhysicalAssetID MIB object.  Such an implementation
802          needs to use some mechanism to handle the differences in
803          size and characters allowed between this leaf and
804          entPhysicalAssetID.  The definition of such a mechanism is
805          outside the scope of this document.";
806       reference
807         "RFC 6933: Entity MIB (Version 4) - entPhysicalAssetID";
808     }
809
810     leaf is-fru {
811       type boolean;
812       config false;
813
814       description
815         "This node indicates whether or not this component is
816          considered a 'field-replaceable unit' by the vendor.  If
817          this node contains the value 'true', then this component
818          identifies a field-replaceable unit.  For all components
819          that are permanently contained within a field-replaceable
820          unit, the value 'false' should be returned for this
821          node.";
822       reference
823         "RFC 6933: Entity MIB (Version 4) - entPhysicalIsFRU";
824     }
825
826     leaf mfg-date {
827       type yang:date-and-time;
828       config false;
829       description
830         "The date of manufacturing of the managed component.";
831       reference
832         "RFC 6933: Entity MIB (Version 4) - entPhysicalMfgDate";
833     }
834
835     leaf-list uri {
836       type inet:uri;
837       description
838         "This node contains identification information about the
839          component.";
840       reference
841         "RFC 6933: Entity MIB (Version 4) - entPhysicalUris";
842     }
843
844     leaf uuid {
845       type yang:uuid;
846       config false;
847       description
848         "A Universally Unique Identifier of the component.";
849       reference
850         "RFC 6933: Entity MIB (Version 4) - entPhysicalUUID";
851     }
852
853     container state {
854       if-feature hardware-state;
855       description
856         "State-related nodes";
857       reference
858         "RFC 4268: Entity State MIB";
859
860       leaf state-last-changed {
861         type yang:date-and-time;
862         config false;
863         description
864           "The date and time when the value of any of the
865            admin-state, oper-state, usage-state, alarm-state, or
866            standby-state changed for this component.
867            If there has been no change since the last
868            re-initialization of the local system, this node
869            contains the date and time of local system
870            initialization.  If there has been no change since the
871            component was added to the local system, this node
872            contains the date and time of the insertion.";
873         reference
874           "RFC 4268: Entity State MIB - entStateLastChanged";
875       }
876
877       leaf admin-state {
878         type admin-state;
879         description
880           "The administrative state for this component.
881            This node refers to a component's administrative
882            permission to service both other components within its
883            containment hierarchy as well other users of its
884            services defined by means outside the scope of this
885            module.
886            Some components exhibit only a subset of the remaining
887            administrative state values.  Some components cannot be
888            locked; hence, this node exhibits only the 'unlocked'
889            state.  Other components cannot be shut down gracefully;
890            hence, this node does not exhibit the 'shutting-down'
891            state.";
892         reference
893           "RFC 4268: Entity State MIB - entStateAdmin";
894       }
895
896       leaf oper-state {
897         type oper-state;
898         config false;
899         description
900           "The operational state for this component.
901            Note that this node does not follow the administrative
902            state.  An administrative state of 'down' does not
903            predict an operational state of 'disabled'.
904            Note that some implementations may not be able to
905            accurately report oper-state while the admin-state node
906            has a value other than 'unlocked'.  In these cases, this
907            node MUST have a value of 'unknown'.";
908         reference
909           "RFC 4268: Entity State MIB - entStateOper";
910       }
911
912       leaf usage-state {
913         type usage-state;
914         config false;
915         description
916           "The usage state for this component.
917            This node refers to a component's ability to service
918            more components in a containment hierarchy.
919            Some components will exhibit only a subset of the usage
920            state values.  Components that are unable to ever
921            service any components within a containment hierarchy
922            will always have a usage state of 'busy'.  In some
923            cases, a component will be able to support only one
924            other component within its containment hierarchy and
925            will therefore only exhibit values of 'idle' and
926            'busy'.";
927         reference
928           "RFC 4268: Entity State MIB - entStateUsage";
929       }
930
931       leaf alarm-state {
932         type alarm-state;
933         config false;
934         description
935           "The alarm state for this component.  It does not
936            include the alarms raised on child components within its
937            containment hierarchy.";
938         reference
939           "RFC 4268: Entity State MIB - entStateAlarm";
940       }
941
942       leaf standby-state {
943         type standby-state;
944         config false;
945         description
946           "The standby state for this component.
947            Some components will exhibit only a subset of the
948            remaining standby state values.  If this component
949            cannot operate in a standby role, the value of this node
950            will always be 'providing-service'.";
951         reference
952           "RFC 4268: Entity State MIB - entStateStandby";
953       }
954     }
955
956     container sensor-data {
957       when 'derived-from-or-self(../class,
958                                  "ianahw:sensor")' {
959         description
960           "Sensor data nodes present for any component of type
961            'sensor'";
962       }
963       if-feature hardware-sensor;
964       config false;
965
966       description
967         "Sensor-related nodes.";
968       reference
969         "RFC 3433: Entity Sensor Management Information Base";
970
971       leaf value {
972         type sensor-value;
973         description
974           "The most recent measurement obtained by the server
975            for this sensor.
976            A client that periodically fetches this node should also
977            fetch the nodes 'value-type', 'value-scale', and
978            'value-precision', since they may change when the value
979            is changed.";
980         reference
981           "RFC 3433: Entity Sensor Management Information Base -
982                      entPhySensorValue";
983       }
984
985       leaf value-type {
986         type sensor-value-type;
987         description
988           "The type of data units associated with the
989            sensor value";
990         reference
991           "RFC 3433: Entity Sensor Management Information Base -
992                      entPhySensorType";
993       }
994       leaf value-scale {
995         type sensor-value-scale;
996         description
997           "The (power of 10) scaling factor associated
998            with the sensor value";
999         reference
1000           "RFC 3433: Entity Sensor Management Information Base -
1001                      entPhySensorScale";
1002       }
1003
1004       leaf value-precision {
1005         type sensor-value-precision;
1006         description
1007           "The number of decimal places of precision
1008            associated with the sensor value";
1009         reference
1010           "RFC 3433: Entity Sensor Management Information Base -
1011                      entPhySensorPrecision";
1012       }
1013
1014       leaf oper-status {
1015         type sensor-status;
1016         description
1017           "The operational status of the sensor.";
1018         reference
1019           "RFC 3433: Entity Sensor Management Information Base -
1020                      entPhySensorOperStatus";
1021       }
1022
1023       leaf units-display {
1024         type string;
1025         description
1026           "A textual description of the data units that should be
1027            used in the display of the sensor value.";
1028         reference
1029           "RFC 3433: Entity Sensor Management Information Base -
1030                      entPhySensorUnitsDisplay";
1031       }
1032
1033       leaf value-timestamp {
1034         type yang:date-and-time;
1035         description
1036           "The time the status and/or value of this sensor was last
1037            obtained by the server.";
1038         reference
1039           "RFC 3433: Entity Sensor Management Information Base -
1040                      entPhySensorValueTimeStamp";
1041       }
1042       leaf value-update-rate {
1043         type uint32;
1044         units "milliseconds";
1045         description
1046           "An indication of the frequency that the server updates
1047            the associated 'value' node, represented in
1048            milliseconds.  The value zero indicates:
1049             - the sensor value is updated on demand (e.g.,
1050               when polled by the server for a get-request),
1051             - the sensor value is updated when the sensor
1052               value changes (event-driven), or
1053             - the server does not know the update rate.";
1054         reference
1055           "RFC 3433: Entity Sensor Management Information Base -
1056                      entPhySensorValueUpdateRate";
1057       }
1058     }
1059   }
1060 }
1061
1062 /*
1063  * Notifications
1064  */
1065
1066 notification hardware-state-change {
1067   description
1068     "A hardware-state-change notification is generated when the
1069      value of /hardware/last-change changes in the operational
1070      state.";
1071   reference
1072     "RFC 6933: Entity MIB (Version 4) - entConfigChange";
1073 }
1074
1075 notification hardware-state-oper-enabled {
1076   if-feature hardware-state;
1077   description
1078     "A hardware-state-oper-enabled notification signifies that a
1079      component has transitioned into the 'enabled' state.";
1080
1081   leaf name {
1082     type leafref {
1083       path "/hardware/component/name";
1084     }
1085
1086     description
1087       "The name of the component that has transitioned into the
1088        'enabled' state.";
1089   }
1090   leaf admin-state {
1091     type leafref {
1092       path "/hardware/component/state/admin-state";
1093     }
1094     description
1095       "The administrative state for the component.";
1096   }
1097   leaf alarm-state {
1098     type leafref {
1099       path "/hardware/component/state/alarm-state";
1100     }
1101     description
1102       "The alarm state for the component.";
1103   }
1104   reference
1105     "RFC 4268: Entity State MIB - entStateOperEnabled";
1106 }
1107
1108 notification hardware-state-oper-disabled {
1109   if-feature hardware-state;
1110   description
1111     "A hardware-state-oper-disabled notification signifies that a
1112      component has transitioned into the 'disabled' state.";
1113
1114   leaf name {
1115     type leafref {
1116       path "/hardware/component/name";
1117     }
1118     description
1119       "The name of the component that has transitioned into the
1120        'disabled' state.";
1121   }
1122   leaf admin-state {
1123     type leafref {
1124       path "/hardware/component/state/admin-state";
1125     }
1126     description
1127       "The administrative state for the component.";
1128   }
1129   leaf alarm-state {
1130     type leafref {
1131       path "/hardware/component/state/alarm-state";
1132     }
1133
1134     description
1135       "The alarm state for the component.";
1136   }
1137   reference
1138     "RFC 4268: Entity State MIB - entStateOperDisabled";
1139 }
1140
1141 }