blob: 37c2cfe8b778cdfea2664c5216f6a6ef8666037e [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;
39}
40
41enum ComponentAdminState {
42 COMP_ADMIN_STATE_UNDEFINED = 0;
43 COMP_ADMIN_STATE_UNKNOWN = 1;
44 COMP_ADMIN_STATE_LOCKED = 2;
45 COMP_ADMIN_STATE_SHUTTING_DOWN = 3;
46 COMP_ADMIN_STATE_UNLOCKED = 4;
47}
48
49enum ComponentOperState {
50 COMP_OPER_STATE_UNDEFINED = 0;
51 COMP_OPER_STATE_UNKNOWN = 1;
52 COMP_OPER_STATE_DISABLED = 2;
53 COMP_OPER_STATE_ENABLED = 3;
54 COMP_OPER_STATE_TESTING = 4;
55}
56
57enum ComponentUsageState {
58 COMP_USAGE_STATE_UNDEFINED = 0;
59 COMP_USAGE_STATE_UNKNOWN = 1;
60 COMP_USAGE_STATE_IDLE = 2;
61 COMP_USAGE_STATE_ACTIVE = 3;
62 COMP_USAGE_STATE_BUSY = 4;
63}
64
65enum ComponentAlarmState {
66 COMP_ALARM_STATE_UNDEFINED = 0;
67 COMP_ALARM_STATE_UNKNOWN = 1;
68 COMP_ALARM_STATE_UNDER_REPAIR= 2;
69 COMP_ALARM_STATE_CRITICAL = 3;
70 COMP_ALARM_STATE_MAJOR = 4;
71 COMP_ALARM_STATE_MINOR = 5;
72 COMP_ALARM_STATE_WARNING = 6;
amit.ghosh3a5c7f12020-12-11 13:56:26 +010073 COMP_ALARM_STATE_INDETERMINATE = 7;
Amit Ghosh09f28362020-06-12 21:52:19 +010074}
75
76enum ComponentStandbyState {
77 COMP_STANDBY_STATE_UNDEFINED = 0;
78 COMP_STANDBY_STATE_UNKNOWN = 1;
79 COMP_STANDBY_STATE_HOT = 2;
80 COMP_STANDBY_STATE_COLD = 3;
81 COMP_STANDBY_STATE_PROVIDING_SERVICE = 4;
82}
83
84message ComponentState {
85 google.protobuf.Timestamp state_last_changed = 1;
86 ComponentAdminState admin_state = 2;
87 ComponentOperState oper_state = 3;
88 ComponentUsageState usage_state = 4;
89 ComponentAlarmState alarm_state = 5;
90 ComponentStandbyState standby_state = 6;
91}
92
amit.ghosh2a6b60b2021-02-03 15:16:02 +010093enum DataValueType {
94 VALUE_TYPE_UNDEFINED = 0;
95 VALUE_TYPE_OTHER = 1;
96 VALUE_TYPE_UNKNOWN = 2;
97 VALUE_TYPE_VOLTS_AC = 3;
98 VALUE_TYPE_VOLTS_DC = 4;
99 VALUE_TYPE_AMPERES = 5;
100 VALUE_TYPE_WATTS = 6;
101 VALUE_TYPE_HERTZ = 7;
102 VALUE_TYPE_CELSIUS = 8;
103 VALUE_TYPE_PERCENT_RH = 9;
104 VALUE_TYPE_RPM = 10;
105 VALUE_TYPE_CMM = 11;
106 VALUE_TYPE_TRUTH_VALUE = 12;
amit.ghoshf54a9a32021-03-10 16:39:54 +0100107 VALUE_TYPE_PERCENT = 13;
108 VALUE_TYPE_METERS = 14;
109 VALUE_TYPE_BYTES = 15;
Amit Ghosh09f28362020-06-12 21:52:19 +0100110}
111
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100112enum ValueScale {
113 VALUE_SCALE_UNDEFINED = 0;
114 VALUE_SCALE_YOCTO = 1;
115 VALUE_SCALE_ZEPTO = 2;
116 VALUE_SCALE_ATTO = 3;
117 VALUE_SCALE_FEMTO = 4;
118 VALUE_SCALE_PICO = 5;
119 VALUE_SCALE_NANO = 6;
120 VALUE_SCALE_MICRO = 7;
121 VALUE_SCALE_MILLI = 8;
122 VALUE_SCALE_UNITS = 9;
123 VALUE_SCALE_KILO = 10;
124 VALUE_SCALE_MEGA = 11;
125 VALUE_SCALE_GIGA = 12;
126 VALUE_SCALE_TERA = 13;
127 VALUE_SCALE_PETA = 14;
128 VALUE_SCALE_EXA = 15;
129 VALUE_SCALE_ZETTA = 16;
130 VALUE_SCALE_YOTTA =17;
Amit Ghosh09f28362020-06-12 21:52:19 +0100131}
132
133enum SensorStatus {
134 SENSOR_STATUS_UNDEFINED = 0;
135 SENSOR_STATUS_OK = 1;
136 SENSOR_STATUS_UNAVAILABLE = 2;
137 SENSOR_STATUS_NONOPERATIONAL = 3;
138}
139
Girish Gowdra997432d2022-03-10 15:59:33 -0800140enum TransceiverType {
141 TYPE_UNDEFINED = 0;
142 ETHERNET = 1;
143 GPON = 2;
144 XGPON = 3;
145 XGSPON = 4;
146 CPON = 5;
147 NG_PON2 = 6;
148 EPON = 7;
149 // Add more here
150
151 TYPE_NOT_DETECTED = 255;
152}
153
Amit Ghosh09f28362020-06-12 21:52:19 +0100154message ComponentSensorData {
155 int32 value = 1;
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100156 DataValueType type = 2;
157 ValueScale scale = 3;
Amit Ghosh09f28362020-06-12 21:52:19 +0100158 int32 precision = 4;
159 SensorStatus status = 5;
160 string units_display = 6;
161 google.protobuf.Timestamp timestamp = 7;
162 uint32 value_update_rate = 8;
163 // data_type can be of the string representation of MetricNames or something else as well
164 string data_type = 9;
165}
166
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100167message PortComponentAttributes{
168 enum ConnectorType {
169 CONNECTOR_TYPE_UNDEFINED = 0;
170 RJ45 = 1;
171 FIBER_LC = 2;
172 FIBER_SC_PC = 3;
173 FIBER_MPO = 4;
amit.ghosh6682fef2021-03-19 14:53:37 +0100174 RS232 = 5;
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100175 }
176 enum Speed {
177 SPEED_UNDEFINED = 0;
178 DYNAMIC = 1;
179 GIGABIT_1 = 2;
180 GIGABIT_10 = 3;
181 GIGABIT_25 = 4;
182 GIGABIT_40 = 5;
183 GIGABIT_100 = 6;
184 GIGABIT_400 = 7;
185 MEGABIT_2500 = 8;
186 MEGABIT_1250 = 9;
187 }
188 enum Protocol {
189 PROTOCOL_UNDEFINED = 0;
190 ETHERNET = 1;
191 GPON = 2;
192 XGPON = 3;
193 XGSPON = 4;
194 GFAST = 5;
195 SERIAL = 6;
196 EPON = 7;
amit.ghosh6682fef2021-03-19 14:53:37 +0100197 BITS = 8;
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100198 }
199 ConnectorType connector_type = 1;
200 Speed speed = 2;
201 Protocol protocol = 3;
202 string physical_label = 4;
amit.ghosh98c5a6c2021-08-12 16:19:46 +0200203 // The mapping_label can be used to map ports between the DMI interface and other systems like VOLTHA
204 // The value of the mapping_label should be exactly the same as generated for the same port by the other
205 // system
206 string mapping_label = 5;
207 PonIdConfig pon_id_config = 6;
Andrea Campanellafcd22292021-08-27 10:45:46 +0200208 bool speed_autonegotiation = 7; //Only valid for ethernet type port components. True if enabled, false otherwise.
amit.ghosh98c5a6c2021-08-12 16:19:46 +0200209}
210
211message PortComponentChangeAttributes {
212 PonIdConfig pon_id_config = 1;
213}
214
Girish Gowdra997432d2022-03-10 15:59:33 -0800215message TransceiverComponentChangeAttributes {
216 TransceiverType trans_type = 1;
217}
218
amit.ghosh98c5a6c2021-08-12 16:19:46 +0200219message PonIdConfig {
220 // The pon_id and pon_id_transmit_periodicity attributes are valid only for ports of type GPON, XGPON and XGSPON
221 // For GPON pon_id is a 7 byte value
222 // For XGS-PON, it's a 32 bit value, should be encoded in the first 4 bytes of pon_id in network byte order
223 bytes pon_id = 1;
224 uint32 pon_id_transmit_periodicity = 2; // The value is in seconds and defaults to 1 second
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100225}
226
227message ContainerComponentAttributes{
228 string physical_label = 1;
229}
230
231message PsuComponentAttributes{
232 enum SupportedVoltage {
233 SUPPORTED_VOLTAGE_UNDEFINED = 0;
234 V48 = 1;
235 V230 = 2;
236 V115 = 3;
237 }
238 SupportedVoltage supported_voltage = 1;
239}
240
241message TransceiverComponentsAttributes{
242 enum FormFactor {
243 FORM_FACTOR_UNKNOWN = 0;
244 QSFP = 1;
245 QSFP_PLUS = 2;
246 QSFP28 = 3;
247 SFP = 4;
248 SFP_PLUS = 5;
249 XFP = 6;
250 CFP4 = 7;
251 CFP2 = 8;
252 CPAK = 9;
253 X2 = 10;
254 OTHER = 11;
255 CFP = 12;
256 CFP2_ACO = 13;
257 CFP2_DCO = 14;
258 }
259
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100260 FormFactor form_factor = 1;
Girish Gowdra997432d2022-03-10 15:59:33 -0800261 TransceiverType trans_type = 2;
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100262 // The maximum reach that can be achieved by this transceiver
263 uint32 max_distance = 3;
264 ValueScale max_distance_scale = 4;
265 // The receive and transmit wavelengths that the transeiver operates on
266 repeated uint32 rx_wavelength = 5;
267 repeated uint32 tx_wavelength = 6;
268 ValueScale wavelength_scale = 7;
269}
270
Amit Ghosh09f28362020-06-12 21:52:19 +0100271message Component {
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100272 // The name of a component uniquely identifies a component within the hardware
Amit Ghosh09f28362020-06-12 21:52:19 +0100273 string name = 1;
274 ComponentType class = 2;
275 string description = 3;
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100276 // The name of the parent of this component, empty string("") in case of the root component
Amit Ghosh121f7c22020-07-21 10:18:38 +0100277 string parent = 4;
Amit Ghosh09f28362020-06-12 21:52:19 +0100278 int32 parent_rel_pos = 5;
279 repeated Component children = 6;
280 string hardware_rev = 7;
281 string firmware_rev = 8;
282 string software_rev = 9;
283 string serial_num = 10;
284 string mfg_name = 11;
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100285 // Apart from the definition of this attribute as defined in RFC 8348, implementations could choose to carry
286 // the manufacturer's part number in this attribute.
Amit Ghosh09f28362020-06-12 21:52:19 +0100287 string model_name = 12;
288 string alias = 13;
289 string asset_id = 14;
290 bool is_fru = 15;
291 google.protobuf.Timestamp mfg_date = 16;
292 Uri uri = 17;
293 // The uuid of the component uniquely identifies the component across the entire system
294 Uuid uuid= 18;
295 ComponentState state = 19;
296 repeated ComponentSensorData sensor_data = 20;
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100297 // The attribute 'specific' can be populated for components where more details are required by the users of the DMI interface
298 oneof specific {
299 PortComponentAttributes port_attr = 50;
300 ContainerComponentAttributes container_attr = 51;
301 PsuComponentAttributes psu_attr = 52;
302 TransceiverComponentsAttributes transceiver_attr = 53;
303 }
Amit Ghosh09f28362020-06-12 21:52:19 +0100304}
305
306message Hardware {
307 google.protobuf.Timestamp last_change = 1;
308 // Each HW has one parent/root and all other components are children of this
309 // The class of the root component would be set as UNDEFINED
310 Component root = 2;
amit.ghosh2a6b60b2021-02-03 15:16:02 +0100311 // TODO: Authentication?
312 // Timestamp at which the hardware last booted
313 google.protobuf.Timestamp last_booted = 3;
Amit Ghosh09f28362020-06-12 21:52:19 +0100314}
315
316// The attributes of a component which are modifiable from the client side
317message ModifiableComponent {
318 // The name has to be unique for each component within the hardware and implementations need to
319 // ascertain this when modifying the name
320 string name = 1;
321 ComponentType class = 2;
322 Component parent = 3;
323 int32 parent_rel_pos = 4;
324 string alias = 5;
325 string asset_id = 6;
326 Uri uri = 7;
327 ComponentAdminState admin_state = 8;
amit.ghosh98c5a6c2021-08-12 16:19:46 +0200328 // The attribute 'specific' can be populated for specific class of components
329 oneof specific {
330 PortComponentChangeAttributes port_attr = 50;
Girish Gowdra997432d2022-03-10 15:59:33 -0800331 TransceiverComponentChangeAttributes trx_attr = 51;
amit.ghosh98c5a6c2021-08-12 16:19:46 +0200332 }
Amit Ghosh09f28362020-06-12 21:52:19 +0100333}