blob: 6094e94600411d12a6fbaec35fb2a8c0eb2da1e3 [file] [log] [blame]
hiroki096259b2018-12-07 09:33:24 -08001module openconfig-platform {
2
3 yang-version "1";
4
5 // namespace
6 namespace "http://openconfig.net/yang/platform";
7
8 prefix "oc-platform";
9
10 import openconfig-platform-types { prefix oc-platform-types; }
11 import openconfig-extensions { prefix oc-ext; }
12 import openconfig-alarm-types { prefix oc-alarm-types; }
13 import openconfig-yang-types { prefix oc-yang; }
14
15
16 // meta
17 organization "OpenConfig working group";
18
19 contact
20 "OpenConfig working group
21 www.openconfig.net";
22
23 description
24 "This module defines a data model for representing a system
25 component inventory, which can include hardware or software
26 elements arranged in an arbitrary structure. The primary
27 relationship supported by the model is containment, e.g.,
28 components containing subcomponents.
29
30 It is expected that this model reflects every field replacable
31 unit on the device at a minimum (i.e., additional information
32 may be supplied about non-replacable components).
33
34 Every element in the inventory is termed a 'component' with each
35 component expected to have a unique name and type, and optionally
36 a unique system-assigned identifier and FRU number. The
37 uniqueness is guaranteed by the system within the device.
38
39 Components may have properties defined by the system that are
40 modeled as a list of key-value pairs. These may or may not be
41 user-configurable. The model provides a flag for the system
42 to optionally indicate which properties are user configurable.
43
44 Each component also has a list of 'subcomponents' which are
45 references to other components. Appearance in a list of
46 subcomponents indicates a containment relationship as described
47 above. For example, a linecard component may have a list of
48 references to port components that reside on the linecard.
49
50 This schema is generic to allow devices to express their own
51 platform-specific structure. It may be augmented by additional
52 component type-specific schemas that provide a common structure
53 for well-known component types. In these cases, the system is
54 expected to populate the common component schema, and may
55 optionally also represent the component and its properties in the
56 generic structure.
57
58 The properties for each component may include dynamic values,
59 e.g., in the 'state' part of the schema. For example, a CPU
60 component may report its utilization, temperature, or other
61 physical properties. The intent is to capture all platform-
62 specific physical data in one location, including inventory
63 (presence or absence of a component) and state (physical
64 attributes or status).";
65
66 oc-ext:openconfig-version "0.11.0";
67
68 revision "2018-06-03" {
69 description
70 "Added parent reference, empty flag and preconfiguration
71 for components";
72 reference "0.11.0";
73 }
74
75 revision "2018-04-20" {
76 description
77 "Added new per-component state data: mfg-date and removable";
78 reference "0.10.0";
79 }
80
81 revision "2018-01-30" {
82 description
83 "Amended approach for modelling CPU - rather than having
84 a local CPU utilisation state variable, a component with
85 a CPU should create a subcomponent of type CPU to report
86 statistics.";
87 reference "0.9.0";
88 }
89
90 revision "2018-01-16" {
91 description
92 "Added new per-component common data; add temp alarm;
93 moved hardware-port reference to port model";
94 reference "0.8.0";
95 }
96
97 revision "2017-12-14" {
98 description
99 "Added anchor containers for component data, added new
100 component types";
101 reference "0.7.0";
102 }
103
104 revision "2017-08-16" {
105 description
106 "Added power state enumerated type";
107 reference "0.6.0";
108 }
109
110 revision "2016-12-22" {
111 description
112 "Added temperature state variable to component";
113 reference "0.5.0";
114 }
115
116 // grouping statements
117
118
119 grouping platform-component-properties-config {
120 description
121 "System-defined configuration data for component properties";
122
123 leaf name {
124 type string;
125 description
126 "System-supplied name of the property -- this is typically
127 non-configurable";
128 }
129
130 leaf value {
131 type union {
132 type string;
133 type boolean;
134 type int64;
135 type uint64;
136 type decimal64 {
137 fraction-digits 2;
138 }
139 }
140 description
141 "Property values can take on a variety of types. Signed and
142 unsigned integer types may be provided in smaller sizes,
143 e.g., int8, uint16, etc.";
144 }
145 }
146
147 grouping platform-component-properties-state {
148 description
149 "Operational state data for component properties";
150
151 leaf configurable {
152 type boolean;
153 description
154 "Indication whether the property is user-configurable";
155 }
156 }
157
158 grouping platform-component-properties-top {
159 description
160 "Top-level grouping ";
161
162 container properties {
163 description
164 "Enclosing container ";
165
166 list property {
167 key "name";
168 description
169 "List of system properties for the component";
170
171 leaf name {
172 type leafref {
173 path "../config/name";
174 }
175 description
176 "Reference to the property name.";
177 }
178
179 container config {
180 description
181 "Configuration data for each property";
182
183 uses platform-component-properties-config;
184 }
185
186 container state {
187
188 config false;
189
190 description
191 "Operational state data for each property";
192
193 uses platform-component-properties-config;
194 uses platform-component-properties-state;
195 }
196 }
197 }
198 }
199
200 grouping platform-subcomponent-ref-config {
201 description
202 "Configuration data for subcomponent references";
203
204 leaf name {
205 type leafref {
206 path "../../../../../component/config/name";
207 }
208 description
209 "Reference to the name of the subcomponent";
210 }
211 }
212
213 grouping platform-subcomponent-ref-state {
214 description
215 "Operational state data for subcomponent references";
216
217 }
218
219 grouping platform-subcomponent-ref-top {
220 description
221 "Top-level grouping for list of subcomponent references";
222
223 container subcomponents {
224 description
225 "Enclosing container for subcomponent references";
226
227 list subcomponent {
228 key "name";
229 description
230 "List of subcomponent references";
231
232 leaf name {
233 type leafref {
234 path "../config/name";
235 }
236 description
237 "Reference to the name list key";
238 }
239
240 container config {
241 description
242 "Configuration data for the subcomponent";
243
244 uses platform-subcomponent-ref-config;
245 }
246
247 container state {
248
249 config false;
250
251 description
252 "Operational state data for the subcomponent";
253
254 uses platform-subcomponent-ref-config;
255 uses platform-subcomponent-ref-state;
256 }
257 }
258 }
259 }
260
261 grouping platform-component-config {
262 description
263 "Configuration data for components";
264
265 leaf name {
266 type string;
267 description
268 "Device name for the component -- this may not be a
269 configurable parameter on many implementations. Where
270 component preconfiguration is supported, for example,
271 the component name may be configurable.";
272 }
273 }
274
275 grouping platform-component-state {
276 description
277 "Operational state data for device components.";
278
279 leaf type {
280 type union {
281 type identityref {
282 base oc-platform-types:OPENCONFIG_HARDWARE_COMPONENT;
283 }
284 type identityref {
285 base oc-platform-types:OPENCONFIG_SOFTWARE_COMPONENT;
286 }
287 }
288 description
289 "Type of component as identified by the system";
290 }
291
292 leaf id {
293 type string;
294 description
295 "Unique identifier assigned by the system for the
296 component";
297 }
298
299 leaf description {
300 type string;
301 description
302 "System-supplied description of the component";
303 }
304
305 leaf mfg-name {
306 type string;
307 description
308 "System-supplied identifier for the manufacturer of the
309 component. This data is particularly useful when a
310 component manufacturer is different than the overall
311 device vendor.";
312 }
313
314 leaf mfg-date {
315 type oc-yang:date;
316 description
317 "System-supplied representation of the component's
318 manufacturing date.";
319 }
320
321 leaf hardware-version {
322 type string;
323 description
324 "For hardware components, this is the hardware revision of
325 the component.";
326 }
327
328 leaf firmware-version {
329 type string;
330 description
331 "For hardware components, this is the version of associated
332 firmware that is running on the component, if applicable.";
333 }
334
335 leaf software-version {
336 type string;
337 description
338 "For software components such as operating system or other
339 software module, this is the version of the currently
340 running software.";
341 }
342
343 leaf serial-no {
344 type string;
345 description
346 "System-assigned serial number of the component.";
347 }
348
349 leaf part-no {
350 type string;
351 description
352 "System-assigned part number for the component. This should
353 be present in particular if the component is also an FRU
354 (field replaceable unit)";
355 }
356
357 leaf removable {
358 type boolean;
359 description
360 "If true, this component is removable or is a field
361 replaceable unit";
362 }
363
364 leaf oper-status {
365 type identityref {
366 base oc-platform-types:COMPONENT_OPER_STATUS;
367 }
368 description
369 "If applicable, this reports the current operational status
370 of the component.";
371 }
372
373 leaf empty {
374 type boolean;
375 default false;
376 description
377 "The empty leaf may be used by the device to indicate that a
378 component position exists but is not populated. Using this
379 flag, it is possible for the management system to learn how
380 many positions are available (e.g., occupied vs. empty
381 linecard slots in a chassis).";
382 }
383
384 leaf parent {
385 type leafref {
386 path "../../config/name";
387 }
388 description
389 "Reference to the name of the parent component. Note that
390 this reference must be kept synchronized with the
391 corresponding subcomponent reference from the parent
392 component.";
393 }
394 }
395
396 grouping platform-component-temp-alarm-state {
397 description
398 "Temperature alarm data for platform components";
399
400 // TODO(aashaikh): consider if these leaves could be in a
401 // reusable grouping (not temperature-specific); threshold
402 // may always need to be units specific.
403
404 leaf alarm-status {
405 type boolean;
406 description
407 "A value of true indicates the alarm has been raised or
408 asserted. The value should be false when the alarm is
409 cleared.";
410 }
411
412 leaf alarm-threshold {
413 type uint32;
414 description
415 "The threshold value that was crossed for this alarm.";
416 }
417
418 leaf alarm-severity {
419 type identityref {
420 base oc-alarm-types:OPENCONFIG_ALARM_SEVERITY;
421 }
422 description
423 "The severity of the current alarm.";
424 }
425 }
426
427 grouping platform-component-power-state {
428 description
429 "Power-related operational state for device components.";
430
431 leaf allocated-power {
432 type uint32;
433 units watts;
434 description
435 "Power allocated by the system for the component.";
436 }
437
438 leaf used-power {
439 type uint32;
440 units watts;
441 description
442 "Actual power used by the component.";
443 }
444 }
445
446 grouping platform-component-temp-state {
447 description
448 "Temperature state data for device components";
449
450 container temperature {
451 description
452 "Temperature in degrees Celsius of the component. Values include
453 the instantaneous, average, minimum, and maximum statistics. If
454 avg/min/max statistics are not supported, the target is expected
455 to just supply the instant value";
456
457 uses oc-platform-types:avg-min-max-instant-stats-precision1-celsius;
458 uses platform-component-temp-alarm-state;
459 }
460 }
461
462 grouping platform-component-memory-state {
463 description
464 "Per-component memory statistics";
465
466 container memory {
467 description
468 "For components that have associated memory, these values
469 report information about available and utilized memory.";
470
471 leaf available {
472 type uint64;
473 units bytes;
474 description
475 "The available memory physically installed, or logically
476 allocated to the component.";
477 }
478
479 // TODO(aashaikh): consider if this needs to be a
480 // min/max/avg statistic
481 leaf utilized {
482 type uint64;
483 units bytes;
484 description
485 "The memory currently in use by processes running on
486 the component, not considering reserved memory that is
487 not available for use.";
488 }
489 }
490 }
491
492 grouping platform-anchors-top {
493 description
494 "This grouping is used to add containers for components that
495 are common across systems, but do not have a defined schema
496 within the openconfig-platform module. Containers should be
497 added to this grouping for components that are expected to
498 exist in multiple systems, with corresponding modules
499 augmenting the config/state containers directly.";
500
501 container chassis {
502 description
503 "Data for chassis components";
504
505 container config {
506 description
507 "Configuration data for chassis components";
508 }
509
510 container state {
511 config false;
512 description
513 "Operational state data for chassis components";
514 }
515 }
516
517// TODO(aashaikh): linecard container is already defined in
518// openconfig-platform-linecard; will move to this module
519// in future.
520 /*
521 container linecard {
522 description
523 "Data for linecard components";
524
525 container config {
526 description
527 "Configuration data for linecard components";
528 }
529
530 container state {
531 config false;
532 description
533 "Operational state data for linecard components";
534 }
535 }
536 */
537
538 container port {
539 description
540 "Data for physical port components";
541
542 container config {
543 description
544 "Configuration data for physical port components";
545 }
546
547 container state {
548 config false;
549 leaf type {
550 type string;
551 }
552 description
553 "Operational state data for physical port components";
554 }
555 }
556
557// TODO(aashaikh): transceiver container is already defined in
558// openconfig-platform-transceiver; will move to this module
559// in future.
560 /*
561 container transceiver {
562 description
563 "Data for transceiver components";
564
565 container config {
566 description
567 "Configuration data for transceiver components";
568 }
569
570 container state {
571 config false;
572 description
573 "Operational state data for transceiver components";
574 }
575 }
576 */
577
578 container power-supply {
579 description
580 "Data for power supply components";
581
582 container config {
583 description
584 "Configuration data for power supply components";
585 }
586
587 container state {
588 config false;
589 description
590 "Operational state data for power supply components";
591 }
592 }
593
594 container fan {
595 description
596 "Data for fan components";
597
598 container config {
599 description
600 "Configuration data for fan components";
601 }
602
603 container state {
604 config false;
605 description
606 "Operational state data for fan components";
607 }
608 }
609
610 container fabric {
611 description
612 "Data for fabric components";
613
614 container config {
615 description
616 "Configuration data for fabric components";
617 }
618
619 container state {
620 config false;
621 description
622 "Operational state data for fabric components";
623 }
624 }
625
626 container storage {
627 description
628 "Data for storage components";
629
630 container config {
631 description
632 "Configuration data for storage components";
633 }
634
635 container state {
636 config false;
637 description
638 "Operational state data for storage components";
639 }
640 }
641
642 container cpu {
643 description
644 "Data for cpu components";
645
646 container config {
647 description
648 "Configuration data for cpu components";
649 }
650
651 container state {
652 config false;
653 description
654 "Operational state data for cpu components";
655 }
656 }
657
658 container integrated-circuit {
659 description
660 "Data for chip components, such as ASIC, NPUs, etc.";
661
662 container config {
663 description
664 "Configuration data for chip components";
665 }
666
667 container state {
668 config false;
669 description
670 "Operational state data for chip components";
671 }
672 }
673
674 container backplane {
675 description
676 "Data for backplane components";
677
678 container config {
679 description
680 "Configuration data for backplane components";
681 }
682
683 container state {
684 config false;
685 description
686 "Operational state data for backplane components";
687 }
688 }
689 }
690
691 grouping platform-component-top {
692 description
693 "Top-level grouping for components in the device inventory";
694
695 container components {
696 description
697 "Enclosing container for the components in the system.";
698
699 list component {
700 key "name";
701 description
702 "List of components, keyed by component name.";
703
704 leaf name {
705 type leafref {
706 path "../config/name";
707 }
708 description
709 "References the component name";
710 }
711
712 container config {
713 description
714 "Configuration data for each component";
715
716 uses platform-component-config;
717 }
718
719 container state {
720
721 config false;
722
723 description
724 "Operational state data for each component";
725
726 uses platform-component-config;
727 uses platform-component-state;
728 uses platform-component-temp-state;
729 uses platform-component-memory-state;
730 uses platform-component-power-state;
731 }
732
733 uses platform-component-properties-top;
734 uses platform-subcomponent-ref-top;
735 uses platform-anchors-top;
736 }
737 }
738 }
739
740
741 // data definition statements
742
743 uses platform-component-top;
744
745
746 // augments
747
748
749}