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