blob: 4b290a4cda4a78a98f04cf1c166d1cd9181a2559 [file] [log] [blame]
Amit Ghosh09f28362020-06-12 21:52:19 +01001syntax = "proto3";
2
3option go_package = "github.com/opencord/device-management-interface/v3/go/dmi";
4package dmi;
5
6import "google/protobuf/timestamp.proto";
7
8// The model used to represent a HW is based on RFC8348 (https://tools.ietf.org/html/rfc8348)
9
10message Uuid {
11 string uuid = 1;
12}
13
14message HardwareID {
15 Uuid uuid = 1;
16}
17
18message Uri {
19 string uri = 1;
20}
21
22enum ComponentType {
23 COMPONENT_TYPE_UNDEFINED = 0;
24 COMPONENT_TYPE_UNKNOWN = 1;
25 COMPONENT_TYPE_CHASSIS = 2;
26 COMPONENT_TYPE_BACKPLANE = 3;
27 COMPONENT_TYPE_CONTAINER = 4;
28 COMPONENT_TYPE_POWER_SUPPLY = 5;
29 COMPONENT_TYPE_FAN = 6;
30 COMPONENT_TYPE_SENSOR = 7;
31 COMPONENT_TYPE_MODULE = 8;
32 COMPONENT_TYPE_PORT = 9;
33 COMPONENT_TYPE_CPU = 10;
34 COMPONENT_TYPE_BATTERY = 11;
35 COMPONENT_TYPE_STORAGE = 12;
36 COMPONENT_TYPE_MEMORY = 13;
37 COMPONENT_TYPE_TRANSCEIVER = 14;
38}
39
40enum ComponentAdminState {
41 COMP_ADMIN_STATE_UNDEFINED = 0;
42 COMP_ADMIN_STATE_UNKNOWN = 1;
43 COMP_ADMIN_STATE_LOCKED = 2;
44 COMP_ADMIN_STATE_SHUTTING_DOWN = 3;
45 COMP_ADMIN_STATE_UNLOCKED = 4;
46}
47
48enum ComponentOperState {
49 COMP_OPER_STATE_UNDEFINED = 0;
50 COMP_OPER_STATE_UNKNOWN = 1;
51 COMP_OPER_STATE_DISABLED = 2;
52 COMP_OPER_STATE_ENABLED = 3;
53 COMP_OPER_STATE_TESTING = 4;
54}
55
56enum ComponentUsageState {
57 COMP_USAGE_STATE_UNDEFINED = 0;
58 COMP_USAGE_STATE_UNKNOWN = 1;
59 COMP_USAGE_STATE_IDLE = 2;
60 COMP_USAGE_STATE_ACTIVE = 3;
61 COMP_USAGE_STATE_BUSY = 4;
62}
63
64enum ComponentAlarmState {
65 COMP_ALARM_STATE_UNDEFINED = 0;
66 COMP_ALARM_STATE_UNKNOWN = 1;
67 COMP_ALARM_STATE_UNDER_REPAIR= 2;
68 COMP_ALARM_STATE_CRITICAL = 3;
69 COMP_ALARM_STATE_MAJOR = 4;
70 COMP_ALARM_STATE_MINOR = 5;
71 COMP_ALARM_STATE_WARNING = 6;
72 COMP_ALARM_STATE_INTERMEDIATE = 7;
73}
74
75enum ComponentStandbyState {
76 COMP_STANDBY_STATE_UNDEFINED = 0;
77 COMP_STANDBY_STATE_UNKNOWN = 1;
78 COMP_STANDBY_STATE_HOT = 2;
79 COMP_STANDBY_STATE_COLD = 3;
80 COMP_STANDBY_STATE_PROVIDING_SERVICE = 4;
81}
82
83message ComponentState {
84 google.protobuf.Timestamp state_last_changed = 1;
85 ComponentAdminState admin_state = 2;
86 ComponentOperState oper_state = 3;
87 ComponentUsageState usage_state = 4;
88 ComponentAlarmState alarm_state = 5;
89 ComponentStandbyState standby_state = 6;
90}
91
92enum SensorValueType {
93 SENSOR_VALUE_TYPE_UNDEFINED = 0;
94 SENSOR_VALUE_TYPE_OTHER = 1;
95 SENSOR_VALUE_TYPE_UNKNOWN = 2;
96 SENSOR_VALUE_TYPE_VOLTS_AC = 3;
97 SENSOR_VALUE_TYPE_VOLTS_DC = 4;
98 SENSOR_VALUE_TYPE_AMPERES = 5;
99 SENSOR_VALUE_TYPE_WATTS = 6;
100 SENSOR_VALUE_TYPE_HERTZ = 7;
101 SENSOR_VALUE_TYPE_CELSIUS = 8;
102 SENSOR_VALUE_TYPE_PERCENT_RH = 9;
103 SENSOR_VALUE_TYPE_RPM = 10;
104 SENSOR_VALUE_TYPE_CMM = 11;
105 SENSOR_VALUE_TYPE_TRUTH_VALUE = 12;
106}
107
108enum SensorValueScale {
109 SENSOR_VALUE_SCALE_UNDEFINED = 0;
110 SENSOR_VALUE_SCALE_YOCTO = 1;
111 SENSOR_VALUE_SCALE_ZEPTO = 2;
112 SENSOR_VALUE_SCALE_ATTO = 3;
113 SENSOR_VALUE_SCALE_FEMTO = 4;
114 SENSOR_VALUE_SCALE_PICO = 5;
115 SENSOR_VALUE_SCALE_NANO = 6;
116 SENSOR_VALUE_SCALE_MICRO = 7;
117 SENSOR_VALUE_SCALE_MILLI = 8;
118 SENSOR_VALUE_SCALE_UNITS = 9;
119 SENSOR_VALUE_SCALE_KILO = 10;
120 SENSOR_VALUE_SCALE_MEGA = 11;
121 SENSOR_VALUE_SCALE_GIGA = 12;
122 SENSOR_VALUE_SCALE_TERA = 13;
123 SENSOR_VALUE_SCALE_PETA = 14;
124 SENSOR_VALUE_SCALE_EXA = 15;
125 SENSOR_VALUE_SCALE_ZETTA = 16;
126 SENSOR_VALUE_SCALE_YOTTA =17;
127}
128
129enum SensorStatus {
130 SENSOR_STATUS_UNDEFINED = 0;
131 SENSOR_STATUS_OK = 1;
132 SENSOR_STATUS_UNAVAILABLE = 2;
133 SENSOR_STATUS_NONOPERATIONAL = 3;
134}
135
136message ComponentSensorData {
137 int32 value = 1;
138 SensorValueType type = 2;
139 SensorValueScale scale = 3;
140 int32 precision = 4;
141 SensorStatus status = 5;
142 string units_display = 6;
143 google.protobuf.Timestamp timestamp = 7;
144 uint32 value_update_rate = 8;
145 // data_type can be of the string representation of MetricNames or something else as well
146 string data_type = 9;
147}
148
149message Component {
150 // The name of a component uniquely identifies an component within the Hardware
151 string name = 1;
152 ComponentType class = 2;
153 string description = 3;
Amit Ghosh121f7c22020-07-21 10:18:38 +0100154 // The name of the parent of this component, empty "" in case of the root component
155 string parent = 4;
Amit Ghosh09f28362020-06-12 21:52:19 +0100156 int32 parent_rel_pos = 5;
157 repeated Component children = 6;
158 string hardware_rev = 7;
159 string firmware_rev = 8;
160 string software_rev = 9;
161 string serial_num = 10;
162 string mfg_name = 11;
163 string model_name = 12;
164 string alias = 13;
165 string asset_id = 14;
166 bool is_fru = 15;
167 google.protobuf.Timestamp mfg_date = 16;
168 Uri uri = 17;
169 // The uuid of the component uniquely identifies the component across the entire system
170 Uuid uuid= 18;
171 ComponentState state = 19;
172 repeated ComponentSensorData sensor_data = 20;
173}
174
175message Hardware {
176 google.protobuf.Timestamp last_change = 1;
177 // Each HW has one parent/root and all other components are children of this
178 // The class of the root component would be set as UNDEFINED
179 Component root = 2;
180 // TODO: Authetication?
181}
182
183// The attributes of a component which are modifiable from the client side
184message ModifiableComponent {
185 // The name has to be unique for each component within the hardware and implementations need to
186 // ascertain this when modifying the name
187 string name = 1;
188 ComponentType class = 2;
189 Component parent = 3;
190 int32 parent_rel_pos = 4;
191 string alias = 5;
192 string asset_id = 6;
193 Uri uri = 7;
194 ComponentAdminState admin_state = 8;
195}