blob: 2ebaeebd3988b09fe6d97a024168af2639d42bdb [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;
amit.ghosh2a6b60b2021-02-03 15:16:02 +010037 // A component of type "TRANSCEIVER" could have 0 or more components of type "PORT" as children.
Amit Ghosh09f28362020-06-12 21:52:19 +010038 COMPONENT_TYPE_TRANSCEIVER = 14;
amit.ghosh2a6b60b2021-02-03 15:16:02 +010039 // Removing the below two specific types of transceivers as we introduce a specific attribute
40 // called type of the transeiver which can be used to convey the same information
41 // Will deprecate these two in the future.
42 //COMPONENT_TYPE_GPON_TRANSCEIVER = 15;
43 //COMPONENT_TYPE_XGS_PON_TRANSCEIVER = 16;
Amit Ghosh09f28362020-06-12 21:52:19 +010044}
45
46enum ComponentAdminState {
47 COMP_ADMIN_STATE_UNDEFINED = 0;
48 COMP_ADMIN_STATE_UNKNOWN = 1;
49 COMP_ADMIN_STATE_LOCKED = 2;
50 COMP_ADMIN_STATE_SHUTTING_DOWN = 3;
51 COMP_ADMIN_STATE_UNLOCKED = 4;
52}
53
54enum ComponentOperState {
55 COMP_OPER_STATE_UNDEFINED = 0;
56 COMP_OPER_STATE_UNKNOWN = 1;
57 COMP_OPER_STATE_DISABLED = 2;
58 COMP_OPER_STATE_ENABLED = 3;
59 COMP_OPER_STATE_TESTING = 4;
60}
61
62enum ComponentUsageState {
63 COMP_USAGE_STATE_UNDEFINED = 0;
64 COMP_USAGE_STATE_UNKNOWN = 1;
65 COMP_USAGE_STATE_IDLE = 2;
66 COMP_USAGE_STATE_ACTIVE = 3;
67 COMP_USAGE_STATE_BUSY = 4;
68}
69
70enum ComponentAlarmState {
71 COMP_ALARM_STATE_UNDEFINED = 0;
72 COMP_ALARM_STATE_UNKNOWN = 1;
73 COMP_ALARM_STATE_UNDER_REPAIR= 2;
74 COMP_ALARM_STATE_CRITICAL = 3;
75 COMP_ALARM_STATE_MAJOR = 4;
76 COMP_ALARM_STATE_MINOR = 5;
77 COMP_ALARM_STATE_WARNING = 6;
amit.ghosh3a5c7f12020-12-11 13:56:26 +010078 COMP_ALARM_STATE_INDETERMINATE = 7;
Amit Ghosh09f28362020-06-12 21:52:19 +010079}
80
81enum ComponentStandbyState {
82 COMP_STANDBY_STATE_UNDEFINED = 0;
83 COMP_STANDBY_STATE_UNKNOWN = 1;
84 COMP_STANDBY_STATE_HOT = 2;
85 COMP_STANDBY_STATE_COLD = 3;
86 COMP_STANDBY_STATE_PROVIDING_SERVICE = 4;
87}
88
89message ComponentState {
90 google.protobuf.Timestamp state_last_changed = 1;
91 ComponentAdminState admin_state = 2;
92 ComponentOperState oper_state = 3;
93 ComponentUsageState usage_state = 4;
94 ComponentAlarmState alarm_state = 5;
95 ComponentStandbyState standby_state = 6;
96}
97
amit.ghosh2a6b60b2021-02-03 15:16:02 +010098enum DataValueType {
99 VALUE_TYPE_UNDEFINED = 0;
100 VALUE_TYPE_OTHER = 1;
101 VALUE_TYPE_UNKNOWN = 2;
102 VALUE_TYPE_VOLTS_AC = 3;
103 VALUE_TYPE_VOLTS_DC = 4;
104 VALUE_TYPE_AMPERES = 5;
105 VALUE_TYPE_WATTS = 6;
106 VALUE_TYPE_HERTZ = 7;
107 VALUE_TYPE_CELSIUS = 8;
108 VALUE_TYPE_PERCENT_RH = 9;
109 VALUE_TYPE_RPM = 10;
110 VALUE_TYPE_CMM = 11;
111 VALUE_TYPE_TRUTH_VALUE = 12;
amit.ghoshf54a9a32021-03-10 16:39:54 +0100112 VALUE_TYPE_PERCENT = 13;
113 VALUE_TYPE_METERS = 14;
114 VALUE_TYPE_BYTES = 15;
Amit Ghosh09f28362020-06-12 21:52:19 +0100115}
116
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100117enum ValueScale {
118 VALUE_SCALE_UNDEFINED = 0;
119 VALUE_SCALE_YOCTO = 1;
120 VALUE_SCALE_ZEPTO = 2;
121 VALUE_SCALE_ATTO = 3;
122 VALUE_SCALE_FEMTO = 4;
123 VALUE_SCALE_PICO = 5;
124 VALUE_SCALE_NANO = 6;
125 VALUE_SCALE_MICRO = 7;
126 VALUE_SCALE_MILLI = 8;
127 VALUE_SCALE_UNITS = 9;
128 VALUE_SCALE_KILO = 10;
129 VALUE_SCALE_MEGA = 11;
130 VALUE_SCALE_GIGA = 12;
131 VALUE_SCALE_TERA = 13;
132 VALUE_SCALE_PETA = 14;
133 VALUE_SCALE_EXA = 15;
134 VALUE_SCALE_ZETTA = 16;
135 VALUE_SCALE_YOTTA =17;
Amit Ghosh09f28362020-06-12 21:52:19 +0100136}
137
138enum SensorStatus {
139 SENSOR_STATUS_UNDEFINED = 0;
140 SENSOR_STATUS_OK = 1;
141 SENSOR_STATUS_UNAVAILABLE = 2;
142 SENSOR_STATUS_NONOPERATIONAL = 3;
143}
144
145message ComponentSensorData {
146 int32 value = 1;
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100147 DataValueType type = 2;
148 ValueScale scale = 3;
Amit Ghosh09f28362020-06-12 21:52:19 +0100149 int32 precision = 4;
150 SensorStatus status = 5;
151 string units_display = 6;
152 google.protobuf.Timestamp timestamp = 7;
153 uint32 value_update_rate = 8;
154 // data_type can be of the string representation of MetricNames or something else as well
155 string data_type = 9;
156}
157
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100158message PortComponentAttributes{
159 enum ConnectorType {
160 CONNECTOR_TYPE_UNDEFINED = 0;
161 RJ45 = 1;
162 FIBER_LC = 2;
163 FIBER_SC_PC = 3;
164 FIBER_MPO = 4;
165 }
166 enum Speed {
167 SPEED_UNDEFINED = 0;
168 DYNAMIC = 1;
169 GIGABIT_1 = 2;
170 GIGABIT_10 = 3;
171 GIGABIT_25 = 4;
172 GIGABIT_40 = 5;
173 GIGABIT_100 = 6;
174 GIGABIT_400 = 7;
175 MEGABIT_2500 = 8;
176 MEGABIT_1250 = 9;
177 }
178 enum Protocol {
179 PROTOCOL_UNDEFINED = 0;
180 ETHERNET = 1;
181 GPON = 2;
182 XGPON = 3;
183 XGSPON = 4;
184 GFAST = 5;
185 SERIAL = 6;
186 EPON = 7;
187 }
188 ConnectorType connector_type = 1;
189 Speed speed = 2;
190 Protocol protocol = 3;
191 string physical_label = 4;
192}
193
194message ContainerComponentAttributes{
195 string physical_label = 1;
196}
197
198message PsuComponentAttributes{
199 enum SupportedVoltage {
200 SUPPORTED_VOLTAGE_UNDEFINED = 0;
201 V48 = 1;
202 V230 = 2;
203 V115 = 3;
204 }
205 SupportedVoltage supported_voltage = 1;
206}
207
208message TransceiverComponentsAttributes{
209 enum FormFactor {
210 FORM_FACTOR_UNKNOWN = 0;
211 QSFP = 1;
212 QSFP_PLUS = 2;
213 QSFP28 = 3;
214 SFP = 4;
215 SFP_PLUS = 5;
216 XFP = 6;
217 CFP4 = 7;
218 CFP2 = 8;
219 CPAK = 9;
220 X2 = 10;
221 OTHER = 11;
222 CFP = 12;
223 CFP2_ACO = 13;
224 CFP2_DCO = 14;
225 }
226
227 enum Type {
228 TYPE_UNKNOWN = 0;
229 ETHERNET = 1;
230 GPON = 2;
231 XGPON = 3;
232 XGSPON = 4;
233 CPON = 5;
234 NG_PON2 = 6;
235 EPON = 7;
236 }
237 FormFactor form_factor = 1;
238 Type trans_type = 2;
239 // The maximum reach that can be achieved by this transceiver
240 uint32 max_distance = 3;
241 ValueScale max_distance_scale = 4;
242 // The receive and transmit wavelengths that the transeiver operates on
243 repeated uint32 rx_wavelength = 5;
244 repeated uint32 tx_wavelength = 6;
245 ValueScale wavelength_scale = 7;
246}
247
Amit Ghosh09f28362020-06-12 21:52:19 +0100248message Component {
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100249 // The name of a component uniquely identifies a component within the hardware
Amit Ghosh09f28362020-06-12 21:52:19 +0100250 string name = 1;
251 ComponentType class = 2;
252 string description = 3;
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100253 // The name of the parent of this component, empty string("") in case of the root component
Amit Ghosh121f7c22020-07-21 10:18:38 +0100254 string parent = 4;
Amit Ghosh09f28362020-06-12 21:52:19 +0100255 int32 parent_rel_pos = 5;
256 repeated Component children = 6;
257 string hardware_rev = 7;
258 string firmware_rev = 8;
259 string software_rev = 9;
260 string serial_num = 10;
261 string mfg_name = 11;
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100262 // Apart from the definition of this attribute as defined in RFC 8348, implementations could choose to carry
263 // the manufacturer's part number in this attribute.
Amit Ghosh09f28362020-06-12 21:52:19 +0100264 string model_name = 12;
265 string alias = 13;
266 string asset_id = 14;
267 bool is_fru = 15;
268 google.protobuf.Timestamp mfg_date = 16;
269 Uri uri = 17;
270 // The uuid of the component uniquely identifies the component across the entire system
271 Uuid uuid= 18;
272 ComponentState state = 19;
273 repeated ComponentSensorData sensor_data = 20;
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100274 // The attribute 'specific' can be populated for components where more details are required by the users of the DMI interface
275 oneof specific {
276 PortComponentAttributes port_attr = 50;
277 ContainerComponentAttributes container_attr = 51;
278 PsuComponentAttributes psu_attr = 52;
279 TransceiverComponentsAttributes transceiver_attr = 53;
280 }
Amit Ghosh09f28362020-06-12 21:52:19 +0100281}
282
283message Hardware {
284 google.protobuf.Timestamp last_change = 1;
285 // Each HW has one parent/root and all other components are children of this
286 // The class of the root component would be set as UNDEFINED
287 Component root = 2;
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100288 // TODO: Authentication?
289 // Timestamp at which the hardware last booted
290 google.protobuf.Timestamp last_booted = 3;
Amit Ghosh09f28362020-06-12 21:52:19 +0100291}
292
293// The attributes of a component which are modifiable from the client side
294message ModifiableComponent {
295 // The name has to be unique for each component within the hardware and implementations need to
296 // ascertain this when modifying the name
297 string name = 1;
298 ComponentType class = 2;
299 Component parent = 3;
300 int32 parent_rel_pos = 4;
301 string alias = 5;
302 string asset_id = 6;
303 Uri uri = 7;
304 ComponentAdminState admin_state = 8;
305}