blob: 58be1a150c30769c1867bf0a18d92ce879e406cd [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 "dmi/commons.proto";
7import "dmi/hw.proto";
Andrea Campanellacb990bc2020-09-22 12:50:56 +02008import "google/protobuf/empty.proto";
Amit Ghosh09f28362020-06-12 21:52:19 +01009
10// Protos for the management of a hardware and it's components
11
12message PhysicalInventoryRequest {
13 Uuid device_uuid = 1;
14}
15
16message PhysicalInventoryResponse {
amit.ghoshae473032021-01-10 11:59:10 +010017 enum Reason {
18 UNDEFINED_REASON = 0;
19 UNKNOWN_DEVICE = 1;
20 INTERNAL_ERROR = 2;
amit.ghoshbd2022e2021-02-22 05:58:53 +010021 DEVICE_UNREACHABLE = 3;
amit.ghoshae473032021-01-10 11:59:10 +010022 }
Amit Ghosh09f28362020-06-12 21:52:19 +010023 Status status = 1;
24 Reason reason = 2;
25 Hardware inventory = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +010026 // It is recommended that upstream components/users of the DMI interface
27 // do not really interpret/parse the reson_detail, but rather use it for
28 // display purposes to the end user or use it for logging the error
29 string reason_detail = 4;
Amit Ghosh09f28362020-06-12 21:52:19 +010030}
31
32message HWComponentInfoGetRequest {
33 Uuid device_uuid = 1;
34 Uuid component_uuid = 2;
35 string component_name = 3;
36}
37
aghoshc301dcd2020-09-03 16:55:34 +010038message HWComponentInfoGetResponse {
amit.ghoshae473032021-01-10 11:59:10 +010039 enum Reason {
40 UNDEFINED_REASON = 0;
41 UNKNOWN_DEVICE = 1;
42 UNKNOWN_COMPONENT = 2;
43 INTERNAL_ERROR = 3;
amit.ghoshbd2022e2021-02-22 05:58:53 +010044 DEVICE_UNREACHABLE = 4;
amit.ghoshae473032021-01-10 11:59:10 +010045 }
aghoshc301dcd2020-09-03 16:55:34 +010046 Status status = 1;
47 Reason reason = 2;
48 Component component = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +010049 string reason_detail = 4;
aghoshc301dcd2020-09-03 16:55:34 +010050}
51
Amit Ghosh09f28362020-06-12 21:52:19 +010052message HWComponentInfoSetRequest {
53 Uuid device_uuid = 1;
54 Uuid component_uuid = 2;
55 string component_name = 3;
56 ModifiableComponent changes = 4;
57}
58
59message HWComponentInfoSetResponse {
amit.ghoshae473032021-01-10 11:59:10 +010060 enum Reason {
61 UNDEFINED_REASON = 0;
62 UNKNOWN_DEVICE = 1;
63 UNKNOWN_COMPONENT = 2;
64 INVALID_PARAMS = 3;
65 INTERNAL_ERROR = 4;
amit.ghoshbd2022e2021-02-22 05:58:53 +010066 DEVICE_UNREACHABLE = 5;
Girish Gowdra997432d2022-03-10 15:59:33 -080067 SET_UNSUPPORTED = 6;
amit.ghoshae473032021-01-10 11:59:10 +010068 }
Amit Ghosh09f28362020-06-12 21:52:19 +010069 Status status = 1;
70 Reason reason = 2;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +010071 string reason_detail = 3;
Amit Ghosh09f28362020-06-12 21:52:19 +010072}
73
74message StartManagingDeviceResponse {
amit.ghoshae473032021-01-10 11:59:10 +010075 enum Reason {
76 UNDEFINED_REASON = 0;
77 // DEVICE_ALREADY_MANAGED is returned when StartManagingDevice is called again for the same name AFTER a previously
78 // successful StartManagingDevice operation
79 DEVICE_ALREADY_MANAGED = 1;
80 // OPERATION_ALREADY_IN_PROGRESS is returned when StartManagingDevice is called again for the same name BEFORE
81 // a previous StartManagingDevice operation has completed
82 OPERATION_ALREADY_IN_PROGRESS = 2;
83 INVALID_PARAMS = 3;
84 INTERNAL_ERROR = 4;
amit.ghosh6bdb0f72021-06-02 14:42:29 +020085 // AUTHENTICATION_FAILURE is returned when the device management software/server is not able to connect to the underlying
86 // hardware because of authentication failures
87 AUTHENTICATION_FAILURE = 5;
88 // INCOMPATIBLE_DEVICE is returned when there is a mismatch between the device management software/server and the underlying
89 // hardware
90 INCOMPATIBLE_DEVICE = 6;
amit.ghoshae473032021-01-10 11:59:10 +010091 }
Amit Ghosh09f28362020-06-12 21:52:19 +010092 Status status = 1;
93 Reason reason = 2;
94 Uuid device_uuid = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +010095 string reason_detail = 4;
Amit Ghosh09f28362020-06-12 21:52:19 +010096}
97
Amit Ghosh366228e2020-07-06 13:46:42 +010098message StopManagingDeviceRequest {
99 string name = 1;
100}
101
102message StopManagingDeviceResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100103 // The only case in which an error is expected is if the name of the
104 // device to be stopped is not found
105 enum Reason {
106 UNDEFINED_REASON = 0;
amit.ghosh0c687412021-03-24 19:01:08 +0100107 UNKNOWN_DEVICE = 1;
amit.ghoshdd12d882022-07-01 12:32:36 +0200108 // DEVICE_UNREACHABLE is to be returned when the device manager cannot reach the device and stop managing it
109 DEVICE_UNREACHABLE = 2;
amit.ghoshae473032021-01-10 11:59:10 +0100110 }
Amit Ghosh366228e2020-07-06 13:46:42 +0100111 Status status = 1;
112 Reason reason = 2;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100113 string reason_detail = 3;
Amit Ghosh366228e2020-07-06 13:46:42 +0100114}
115
amit.ghosh0c687412021-03-24 19:01:08 +0100116message ManagedDeviceInfo {
117 ModifiableComponent info = 1;
118 Uuid device_uuid = 2;
119}
120
Andrea Campanellacb990bc2020-09-22 12:50:56 +0200121message ManagedDevicesResponse {
amit.ghosh0c687412021-03-24 19:01:08 +0100122 enum Reason {
123 UNDEFINED_REASON = 0;
124 INTERNAL_ERROR = 1;
125 }
126 Status status = 1;
127 Reason reason = 2;
128 repeated ManagedDeviceInfo devices = 3;
Andrea Campanellacb990bc2020-09-22 12:50:56 +0200129}
130
amit.ghosh188a84f2020-09-27 20:59:25 +0200131message SetLoggingEndpointRequest {
132 Uuid device_uuid = 1;
133 string logging_endpoint = 2;
134 string logging_protocol = 3;
135}
136
137message SetRemoteEndpointResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100138 enum Reason {
139 UNDEFINED_REASON = 0;
140 UNKNOWN_DEVICE = 1;
141 INTERNAL_ERROR = 2;
142 LOGGING_ENDPOINT_ERROR = 3;
143 LOGGING_ENDPOINT_PROTOCOL_ERROR = 4;
144 MSGBUS_ENDPOINT_ERROR = 5;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100145 DEVICE_UNREACHABLE = 6;
amit.ghoshae473032021-01-10 11:59:10 +0100146 }
amit.ghosh188a84f2020-09-27 20:59:25 +0200147 Status status = 1;
148 Reason reason = 2;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100149 string reason_detail = 3;
amit.ghosh188a84f2020-09-27 20:59:25 +0200150}
151
152message GetLoggingEndpointResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100153 enum Reason {
154 UNDEFINED_REASON = 0;
155 UNKNOWN_DEVICE = 1;
156 INTERNAL_ERROR = 2;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100157 DEVICE_UNREACHABLE = 3;
amit.ghoshae473032021-01-10 11:59:10 +0100158 }
amit.ghosh188a84f2020-09-27 20:59:25 +0200159 Status status = 1;
160 Reason reason = 2;
161 string logging_endpoint = 3;
162 string logging_protocol = 4;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100163 string reason_detail = 5;
amit.ghosh188a84f2020-09-27 20:59:25 +0200164}
165
166message SetMsgBusEndpointRequest {
167 string msgbus_endpoint = 1;
168}
169
170message GetMsgBusEndpointResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100171 enum Reason {
172 UNDEFINED_REASON = 0;
173 INTERNAL_ERROR = 1;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100174 DEVICE_UNREACHABLE = 2;
amit.ghoshae473032021-01-10 11:59:10 +0100175 }
amit.ghosh188a84f2020-09-27 20:59:25 +0200176 Status status = 1;
177 Reason reason = 2;
178 string msgbus_endpoint = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100179 string reason_detail = 4;
amit.ghosh188a84f2020-09-27 20:59:25 +0200180}
181
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200182message EntitiesLogLevel {
183 LogLevel logLevel = 1;
184 repeated string entities = 2;
185}
186
187message SetLogLevelRequest {
188 Uuid device_uuid = 1;
189 repeated EntitiesLogLevel loglevels = 2;
190}
191
192message SetLogLevelResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100193 enum Reason {
194 UNDEFINED_REASON = 0;
195 UNKNOWN_DEVICE = 1;
196 INTERNAL_ERROR = 2;
197 UNKNOWN_LOG_ENTITY = 3;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100198 DEVICE_UNREACHABLE = 4;
amit.ghoshae473032021-01-10 11:59:10 +0100199 }
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200200 Uuid device_uuid = 1;
201 Status status = 2;
202 Reason reason = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100203 string reason_detail = 4;
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200204}
205
206message GetLogLevelRequest {
207 Uuid device_uuid = 1;
208 repeated string entities = 2;
209}
210
211message GetLogLevelResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100212 enum Reason {
213 UNDEFINED_REASON = 0;
214 UNKNOWN_DEVICE = 1;
215 INTERNAL_ERROR = 2;
216 UNKNOWN_LOG_ENTITY = 3;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100217 DEVICE_UNREACHABLE = 4;
amit.ghoshae473032021-01-10 11:59:10 +0100218 }
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200219 Uuid device_uuid = 1;
220 repeated EntitiesLogLevel logLevels = 2;
221 Status status = 3;
222 Reason reason = 4;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100223 string reason_detail = 5;
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200224}
225
226message GetLoggableEntitiesRequest {
227 Uuid device_uuid = 1;
228}
229
amit.ghosh93183512024-05-28 22:37:27 +0200230message SetDmLogLevelRequest {
231 LogLevel level = 1;
232}
233
234message SetDmLogLevelResponse {
235 enum Reason {
236 UNDEFINED_REASON = 0;
237 INTERNAL_ERROR = 1;
238 UNKNOWN_LOG_LEVEL = 2;
239 }
240 Status status = 1;
241 Reason reason = 2;
242 string reason_detail = 3;
243}
244
245message GetDmLogLevelRequest {
246}
247
248message GetDmLogLevelResponse {
249 enum Reason {
250 UNDEFINED_REASON = 0;
251 INTERNAL_ERROR = 1;
252 }
253
254 LogLevel level = 1;
255 Status status = 2;
256 Reason reason = 3;
257 string reason_detail = 4;
258}
259
Chandrakanth Nalkudre Gowda415b83c2021-04-28 18:01:29 +0530260message Heartbeat {
261 fixed32 heartbeat_signature = 1;
262}
263
Chandrakanth Nalkudre Gowda2f6066c2021-05-13 12:36:32 +0530264message RebootDeviceRequest {
265 Uuid device_uuid = 1;
266}
267
268message RebootDeviceResponse {
269 enum Reason {
270 UNDEFINED_REASON = 0;
271 UNKNOWN_DEVICE = 1;
272 INTERNAL_ERROR = 2;
273 DEVICE_UNREACHABLE = 3;
amit.ghosh840cb602022-04-08 16:10:50 +0200274 DEVICE_IN_WRONG_STATE = 4; // This reason would be returned by the Device Manager if doing the reboot could lead the device to an inconsistent state.
275 // For example, if a RebootRequest is issued while the startup configuration is being updated
Chandrakanth Nalkudre Gowda2f6066c2021-05-13 12:36:32 +0530276 }
277 Status status = 3;
278 Reason reason = 4;
279 string reason_detail = 5;
280}
281
Amit Ghoshe45d9972025-06-26 14:52:48 +0200282// Request to disable a hardware component on a device.
283// At least one of component_name or component_uuid must be provided, along with device_uuid.
284message DisableHWComponentRequest {
285 // UUID of the device containing the component to disable (required)
286 Uuid device_uuid = 1;
287 // UUID of the component to disable (optional, but either this or component_name must be set)
288 Uuid component_uuid = 2;
289 // Name of the component to disable (optional, but either this or component_uuid must be set)
290 string component_name = 3;
291}
292
293// Response for DisableHWComponent RPC.
294message DisableHWComponentResponse {
295 enum Reason {
296 UNDEFINED_REASON = 0;
297 UNKNOWN_DEVICE = 1;
298 UNKNOWN_COMPONENT = 2;
299 INTERNAL_ERROR = 3;
300 DEVICE_UNREACHABLE = 4;
301 DISABLE_UNSUPPORTED = 5; // Disabling this component is not supported
302 INVALID_PARAMS = 6; // Neither component_name nor component_uuid provided
303 }
304 // Indicates whether the operation was successful or not.
305 Status status = 1;
306 // Reason for failure, if any
307 Reason reason = 2;
308 // Human-readable details for logging or display
309 string reason_detail = 3;
310}
311
312// Request to reset a hardware component on a device.
313// At least one of component_name or component_uuid must be provided, along with device_uuid.
314message ResetHWComponentRequest {
315 // UUID of the device containing the component to reset (required)
316 Uuid device_uuid = 1;
317 // UUID of the component to reset (optional, but either this or component_name must be set)
318 Uuid component_uuid = 2;
319 // Name of the component to reset (optional, but either this or component_uuid must be set)
320 string component_name = 3;
321}
322
323// Response for ResetHWComponent RPC.
324message ResetHWComponentResponse {
325 enum Reason {
326 UNDEFINED_REASON = 0;
327 UNKNOWN_DEVICE = 1;
328 UNKNOWN_COMPONENT = 2;
329 INTERNAL_ERROR = 3;
330 DEVICE_UNREACHABLE = 4;
331 RESET_UNSUPPORTED = 5; // Resetting this component is not supported
332 INVALID_PARAMS = 6; // Neither component_name nor component_uuid provided
333 }
334 // Indicates whether the operation was successful or not.
335 Status status = 1;
336 // Reason for failure, if any
337 Reason reason = 2;
338 // Human-readable details for logging or display
339 string reason_detail = 3;
340}
341
342// Request to enable a hardware component on a device.
343// At least one of component_name or component_uuid must be provided, along with device_uuid.
344message EnableHWComponentRequest {
345 // UUID of the device containing the component to enable (required)
346 Uuid device_uuid = 1;
347 // UUID of the component to enable (optional, but either this or component_name must be set)
348 Uuid component_uuid = 2;
349 // Name of the component to enable (optional, but either this or component_uuid must be set)
350 string component_name = 3;
351}
352
353// Response for EnableHWComponent RPC.
354message EnableHWComponentResponse {
355 enum Reason {
356 UNDEFINED_REASON = 0;
357 UNKNOWN_DEVICE = 1;
358 UNKNOWN_COMPONENT = 2;
359 INTERNAL_ERROR = 3;
360 DEVICE_UNREACHABLE = 4;
361 ENABLE_UNSUPPORTED = 5; // Enabling this component is not supported
362 INVALID_PARAMS = 6; // Neither component_name nor component_uuid provided
363 }
364 // Indicates whether the operation was successful or not.
365 Status status = 1;
366 // Reason for failure, if any
367 Reason reason = 2;
368 // Human-readable details for logging or display
369 string reason_detail = 3;
370}
371
Amit Ghosh09f28362020-06-12 21:52:19 +0100372service NativeHWManagementService {
373 // Initializes context for a device and sets up required states
Amit Ghosh704462f2020-06-24 16:44:56 +0100374 // In the call to StartManagingDevice, the fields of ModifiableComponent which are relevant
375 // and their meanings in this context is mentioned below:
376 // name = The unique name that needs to be assigned to this hardware;
377 // class = COMPONENT_TYPE_UNDEFINED;
378 // parent = nil;
379 // alias = Optional;
380 // asset_id = Optional;
381 // uri = IP Address of the Hardware;
382 rpc StartManagingDevice(ModifiableComponent) returns(stream StartManagingDeviceResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100383
Amit Ghosh366228e2020-07-06 13:46:42 +0100384 // Stop management of a device and clean up any context and caches for that device
amit.ghoshae473032021-01-10 11:59:10 +0100385 // This rpc can be called at any time, even before the StartManagingDevice operation
386 // has completed, and should be able to cleanup.
Amit Ghosh366228e2020-07-06 13:46:42 +0100387 rpc StopManagingDevice(StopManagingDeviceRequest) returns(StopManagingDeviceResponse);
388
Andrea Campanellacb990bc2020-09-22 12:50:56 +0200389 // Returns an object containing a list of devices managed by this entity
390 rpc GetManagedDevices(google.protobuf.Empty) returns(ManagedDevicesResponse);
391
Amit Ghosh09f28362020-06-12 21:52:19 +0100392 // Get the HW inventory details of the Device
393 rpc GetPhysicalInventory(PhysicalInventoryRequest) returns(stream PhysicalInventoryResponse);
394
395 // Get the details of a particular HW component
aghoshc301dcd2020-09-03 16:55:34 +0100396 rpc GetHWComponentInfo(HWComponentInfoGetRequest) returns(stream HWComponentInfoGetResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100397
398 // Sets the permissible attributes of a HW component
399 rpc SetHWComponentInfo(HWComponentInfoSetRequest) returns(HWComponentInfoSetResponse);
amit.ghosh188a84f2020-09-27 20:59:25 +0200400
401 // Sets the location to which logs need to be shipped
402 rpc SetLoggingEndpoint(SetLoggingEndpointRequest) returns(SetRemoteEndpointResponse);
403
404 // Gets the configured location to which the logs are being shipped
amit.ghosh5d97dba2020-11-12 16:45:27 +0100405 rpc GetLoggingEndpoint(HardwareID) returns(GetLoggingEndpointResponse);
amit.ghosh188a84f2020-09-27 20:59:25 +0200406
407 // Sets the location of the Message Bus to which events and metrics are shipped
408 rpc SetMsgBusEndpoint(SetMsgBusEndpointRequest) returns(SetRemoteEndpointResponse);
409
410 // Gets the configured location to which the events and metrics are being shipped
411 rpc GetMsgBusEndpoint(google.protobuf.Empty) returns(GetMsgBusEndpointResponse);
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200412
413 // Gets the entities of a device on which log can be configured. A few are expected, like OS, PON Management etc.
414 // In general an entity is any item within an hardware system that can emit logs, e.g. service, process, subsystem,
415 // interface, package etc.
416 rpc GetLoggableEntities(GetLoggableEntitiesRequest) returns(GetLogLevelResponse);
417
amit.ghosh5d97dba2020-11-12 16:45:27 +0100418 // Sets the log level of the device, for each given entity to a certain level.
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200419 // If only one EntitiesLogLevel is provided for the device and that request contains only a log level with
420 // no entity in the list it's assumed that the caller wants to set that level for all the entities.
421 rpc SetLogLevel(SetLogLevelRequest) returns(SetLogLevelResponse);
422
423 // Gets the configured log level for a certain entity on a certain device.
424 // If no entity is specified in the request all the entities with their log level should be returned.
425 rpc GetLogLevel(GetLogLevelRequest) returns(GetLogLevelResponse);
Chandrakanth Nalkudre Gowda415b83c2021-04-28 18:01:29 +0530426
427 // Performs the heartbeat check
428 rpc HeartbeatCheck(google.protobuf.Empty) returns (Heartbeat);
Chandrakanth Nalkudre Gowda2f6066c2021-05-13 12:36:32 +0530429
430 // Performs the reboot of the device
431 rpc RebootDevice(RebootDeviceRequest) returns(RebootDeviceResponse);
amit.ghosh93183512024-05-28 22:37:27 +0200432
433 // Sets the log level of the Device Manager itself
434 rpc SetDmLogLevel(SetDmLogLevelRequest) returns(SetDmLogLevelResponse);
435
436 // Gets the log level at which the Device Manager is running
437 rpc GetDmLogLevel(GetDmLogLevelRequest) returns(GetDmLogLevelResponse);
Amit Ghoshe45d9972025-06-26 14:52:48 +0200438
439 // Disables a hardware component on a device.
440 rpc DisableHWComponent(DisableHWComponentRequest) returns(DisableHWComponentResponse);
441
442 // Resets a hardware component on a device.
443 rpc ResetHWComponent(ResetHWComponentRequest) returns(ResetHWComponentResponse);
444
445 // Enables a hardware component on a device.
446 rpc EnableHWComponent(EnableHWComponentRequest) returns(EnableHWComponentResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100447}