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