blob: 693e8d832465e1f851ffc239e7edef9720992a48 [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.ghoshae473032021-01-10 11:59:10 +0100108 }
Amit Ghosh366228e2020-07-06 13:46:42 +0100109 Status status = 1;
110 Reason reason = 2;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100111 string reason_detail = 3;
Amit Ghosh366228e2020-07-06 13:46:42 +0100112}
113
amit.ghosh0c687412021-03-24 19:01:08 +0100114message ManagedDeviceInfo {
115 ModifiableComponent info = 1;
116 Uuid device_uuid = 2;
117}
118
Andrea Campanellacb990bc2020-09-22 12:50:56 +0200119message ManagedDevicesResponse {
amit.ghosh0c687412021-03-24 19:01:08 +0100120 enum Reason {
121 UNDEFINED_REASON = 0;
122 INTERNAL_ERROR = 1;
123 }
124 Status status = 1;
125 Reason reason = 2;
126 repeated ManagedDeviceInfo devices = 3;
Andrea Campanellacb990bc2020-09-22 12:50:56 +0200127}
128
amit.ghosh188a84f2020-09-27 20:59:25 +0200129message SetLoggingEndpointRequest {
130 Uuid device_uuid = 1;
131 string logging_endpoint = 2;
132 string logging_protocol = 3;
133}
134
135message SetRemoteEndpointResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100136 enum Reason {
137 UNDEFINED_REASON = 0;
138 UNKNOWN_DEVICE = 1;
139 INTERNAL_ERROR = 2;
140 LOGGING_ENDPOINT_ERROR = 3;
141 LOGGING_ENDPOINT_PROTOCOL_ERROR = 4;
142 MSGBUS_ENDPOINT_ERROR = 5;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100143 DEVICE_UNREACHABLE = 6;
amit.ghoshae473032021-01-10 11:59:10 +0100144 }
amit.ghosh188a84f2020-09-27 20:59:25 +0200145 Status status = 1;
146 Reason reason = 2;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100147 string reason_detail = 3;
amit.ghosh188a84f2020-09-27 20:59:25 +0200148}
149
150message GetLoggingEndpointResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100151 enum Reason {
152 UNDEFINED_REASON = 0;
153 UNKNOWN_DEVICE = 1;
154 INTERNAL_ERROR = 2;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100155 DEVICE_UNREACHABLE = 3;
amit.ghoshae473032021-01-10 11:59:10 +0100156 }
amit.ghosh188a84f2020-09-27 20:59:25 +0200157 Status status = 1;
158 Reason reason = 2;
159 string logging_endpoint = 3;
160 string logging_protocol = 4;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100161 string reason_detail = 5;
amit.ghosh188a84f2020-09-27 20:59:25 +0200162}
163
164message SetMsgBusEndpointRequest {
165 string msgbus_endpoint = 1;
166}
167
168message GetMsgBusEndpointResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100169 enum Reason {
170 UNDEFINED_REASON = 0;
171 INTERNAL_ERROR = 1;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100172 DEVICE_UNREACHABLE = 2;
amit.ghoshae473032021-01-10 11:59:10 +0100173 }
amit.ghosh188a84f2020-09-27 20:59:25 +0200174 Status status = 1;
175 Reason reason = 2;
176 string msgbus_endpoint = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100177 string reason_detail = 4;
amit.ghosh188a84f2020-09-27 20:59:25 +0200178}
179
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200180message EntitiesLogLevel {
181 LogLevel logLevel = 1;
182 repeated string entities = 2;
183}
184
185message SetLogLevelRequest {
186 Uuid device_uuid = 1;
187 repeated EntitiesLogLevel loglevels = 2;
188}
189
190message SetLogLevelResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100191 enum Reason {
192 UNDEFINED_REASON = 0;
193 UNKNOWN_DEVICE = 1;
194 INTERNAL_ERROR = 2;
195 UNKNOWN_LOG_ENTITY = 3;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100196 DEVICE_UNREACHABLE = 4;
amit.ghoshae473032021-01-10 11:59:10 +0100197 }
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200198 Uuid device_uuid = 1;
199 Status status = 2;
200 Reason reason = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100201 string reason_detail = 4;
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200202}
203
204message GetLogLevelRequest {
205 Uuid device_uuid = 1;
206 repeated string entities = 2;
207}
208
209message GetLogLevelResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100210 enum Reason {
211 UNDEFINED_REASON = 0;
212 UNKNOWN_DEVICE = 1;
213 INTERNAL_ERROR = 2;
214 UNKNOWN_LOG_ENTITY = 3;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100215 DEVICE_UNREACHABLE = 4;
amit.ghoshae473032021-01-10 11:59:10 +0100216 }
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200217 Uuid device_uuid = 1;
218 repeated EntitiesLogLevel logLevels = 2;
219 Status status = 3;
220 Reason reason = 4;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100221 string reason_detail = 5;
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200222}
223
224message GetLoggableEntitiesRequest {
225 Uuid device_uuid = 1;
226}
227
Chandrakanth Nalkudre Gowda415b83c2021-04-28 18:01:29 +0530228message Heartbeat {
229 fixed32 heartbeat_signature = 1;
230}
231
Chandrakanth Nalkudre Gowda2f6066c2021-05-13 12:36:32 +0530232message RebootDeviceRequest {
233 Uuid device_uuid = 1;
234}
235
236message RebootDeviceResponse {
237 enum Reason {
238 UNDEFINED_REASON = 0;
239 UNKNOWN_DEVICE = 1;
240 INTERNAL_ERROR = 2;
241 DEVICE_UNREACHABLE = 3;
amit.ghosh840cb602022-04-08 16:10:50 +0200242 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.
243 // For example, if a RebootRequest is issued while the startup configuration is being updated
Chandrakanth Nalkudre Gowda2f6066c2021-05-13 12:36:32 +0530244 }
245 Status status = 3;
246 Reason reason = 4;
247 string reason_detail = 5;
248}
249
Amit Ghosh09f28362020-06-12 21:52:19 +0100250service NativeHWManagementService {
251 // Initializes context for a device and sets up required states
Amit Ghosh704462f2020-06-24 16:44:56 +0100252 // In the call to StartManagingDevice, the fields of ModifiableComponent which are relevant
253 // and their meanings in this context is mentioned below:
254 // name = The unique name that needs to be assigned to this hardware;
255 // class = COMPONENT_TYPE_UNDEFINED;
256 // parent = nil;
257 // alias = Optional;
258 // asset_id = Optional;
259 // uri = IP Address of the Hardware;
260 rpc StartManagingDevice(ModifiableComponent) returns(stream StartManagingDeviceResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100261
Amit Ghosh366228e2020-07-06 13:46:42 +0100262 // Stop management of a device and clean up any context and caches for that device
amit.ghoshae473032021-01-10 11:59:10 +0100263 // This rpc can be called at any time, even before the StartManagingDevice operation
264 // has completed, and should be able to cleanup.
Amit Ghosh366228e2020-07-06 13:46:42 +0100265 rpc StopManagingDevice(StopManagingDeviceRequest) returns(StopManagingDeviceResponse);
266
Andrea Campanellacb990bc2020-09-22 12:50:56 +0200267 // Returns an object containing a list of devices managed by this entity
268 rpc GetManagedDevices(google.protobuf.Empty) returns(ManagedDevicesResponse);
269
Amit Ghosh09f28362020-06-12 21:52:19 +0100270 // Get the HW inventory details of the Device
271 rpc GetPhysicalInventory(PhysicalInventoryRequest) returns(stream PhysicalInventoryResponse);
272
273 // Get the details of a particular HW component
aghoshc301dcd2020-09-03 16:55:34 +0100274 rpc GetHWComponentInfo(HWComponentInfoGetRequest) returns(stream HWComponentInfoGetResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100275
276 // Sets the permissible attributes of a HW component
277 rpc SetHWComponentInfo(HWComponentInfoSetRequest) returns(HWComponentInfoSetResponse);
amit.ghosh188a84f2020-09-27 20:59:25 +0200278
279 // Sets the location to which logs need to be shipped
280 rpc SetLoggingEndpoint(SetLoggingEndpointRequest) returns(SetRemoteEndpointResponse);
281
282 // Gets the configured location to which the logs are being shipped
amit.ghosh5d97dba2020-11-12 16:45:27 +0100283 rpc GetLoggingEndpoint(HardwareID) returns(GetLoggingEndpointResponse);
amit.ghosh188a84f2020-09-27 20:59:25 +0200284
285 // Sets the location of the Message Bus to which events and metrics are shipped
286 rpc SetMsgBusEndpoint(SetMsgBusEndpointRequest) returns(SetRemoteEndpointResponse);
287
288 // Gets the configured location to which the events and metrics are being shipped
289 rpc GetMsgBusEndpoint(google.protobuf.Empty) returns(GetMsgBusEndpointResponse);
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200290
291 // Gets the entities of a device on which log can be configured. A few are expected, like OS, PON Management etc.
292 // In general an entity is any item within an hardware system that can emit logs, e.g. service, process, subsystem,
293 // interface, package etc.
294 rpc GetLoggableEntities(GetLoggableEntitiesRequest) returns(GetLogLevelResponse);
295
amit.ghosh5d97dba2020-11-12 16:45:27 +0100296 // Sets the log level of the device, for each given entity to a certain level.
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200297 // If only one EntitiesLogLevel is provided for the device and that request contains only a log level with
298 // no entity in the list it's assumed that the caller wants to set that level for all the entities.
299 rpc SetLogLevel(SetLogLevelRequest) returns(SetLogLevelResponse);
300
301 // Gets the configured log level for a certain entity on a certain device.
302 // If no entity is specified in the request all the entities with their log level should be returned.
303 rpc GetLogLevel(GetLogLevelRequest) returns(GetLogLevelResponse);
Chandrakanth Nalkudre Gowda415b83c2021-04-28 18:01:29 +0530304
305 // Performs the heartbeat check
306 rpc HeartbeatCheck(google.protobuf.Empty) returns (Heartbeat);
Chandrakanth Nalkudre Gowda2f6066c2021-05-13 12:36:32 +0530307
308 // Performs the reboot of the device
309 rpc RebootDevice(RebootDeviceRequest) returns(RebootDeviceResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100310}