blob: 7b249253c0115c9806296921963c674a6611738a [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;
amit.ghoshae473032021-01-10 11:59:10 +010067 }
Amit Ghosh09f28362020-06-12 21:52:19 +010068 Status status = 1;
69 Reason reason = 2;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +010070 string reason_detail = 3;
Amit Ghosh09f28362020-06-12 21:52:19 +010071}
72
73message StartManagingDeviceResponse {
amit.ghoshae473032021-01-10 11:59:10 +010074 enum Reason {
75 UNDEFINED_REASON = 0;
76 // DEVICE_ALREADY_MANAGED is returned when StartManagingDevice is called again for the same name AFTER a previously
77 // successful StartManagingDevice operation
78 DEVICE_ALREADY_MANAGED = 1;
79 // OPERATION_ALREADY_IN_PROGRESS is returned when StartManagingDevice is called again for the same name BEFORE
80 // a previous StartManagingDevice operation has completed
81 OPERATION_ALREADY_IN_PROGRESS = 2;
82 INVALID_PARAMS = 3;
83 INTERNAL_ERROR = 4;
amit.ghosh6bdb0f72021-06-02 14:42:29 +020084 // AUTHENTICATION_FAILURE is returned when the device management software/server is not able to connect to the underlying
85 // hardware because of authentication failures
86 AUTHENTICATION_FAILURE = 5;
87 // INCOMPATIBLE_DEVICE is returned when there is a mismatch between the device management software/server and the underlying
88 // hardware
89 INCOMPATIBLE_DEVICE = 6;
amit.ghoshae473032021-01-10 11:59:10 +010090 }
Amit Ghosh09f28362020-06-12 21:52:19 +010091 Status status = 1;
92 Reason reason = 2;
93 Uuid device_uuid = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +010094 string reason_detail = 4;
Amit Ghosh09f28362020-06-12 21:52:19 +010095}
96
Amit Ghosh366228e2020-07-06 13:46:42 +010097message StopManagingDeviceRequest {
98 string name = 1;
99}
100
101message StopManagingDeviceResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100102 // The only case in which an error is expected is if the name of the
103 // device to be stopped is not found
104 enum Reason {
105 UNDEFINED_REASON = 0;
amit.ghosh0c687412021-03-24 19:01:08 +0100106 UNKNOWN_DEVICE = 1;
amit.ghoshae473032021-01-10 11:59:10 +0100107 }
Amit Ghosh366228e2020-07-06 13:46:42 +0100108 Status status = 1;
109 Reason reason = 2;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100110 string reason_detail = 3;
Amit Ghosh366228e2020-07-06 13:46:42 +0100111}
112
amit.ghosh0c687412021-03-24 19:01:08 +0100113message ManagedDeviceInfo {
114 ModifiableComponent info = 1;
115 Uuid device_uuid = 2;
116}
117
Andrea Campanellacb990bc2020-09-22 12:50:56 +0200118message ManagedDevicesResponse {
amit.ghosh0c687412021-03-24 19:01:08 +0100119 enum Reason {
120 UNDEFINED_REASON = 0;
121 INTERNAL_ERROR = 1;
122 }
123 Status status = 1;
124 Reason reason = 2;
125 repeated ManagedDeviceInfo devices = 3;
Andrea Campanellacb990bc2020-09-22 12:50:56 +0200126}
127
amit.ghosh188a84f2020-09-27 20:59:25 +0200128message SetLoggingEndpointRequest {
129 Uuid device_uuid = 1;
130 string logging_endpoint = 2;
131 string logging_protocol = 3;
132}
133
134message SetRemoteEndpointResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100135 enum Reason {
136 UNDEFINED_REASON = 0;
137 UNKNOWN_DEVICE = 1;
138 INTERNAL_ERROR = 2;
139 LOGGING_ENDPOINT_ERROR = 3;
140 LOGGING_ENDPOINT_PROTOCOL_ERROR = 4;
141 MSGBUS_ENDPOINT_ERROR = 5;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100142 DEVICE_UNREACHABLE = 6;
amit.ghoshae473032021-01-10 11:59:10 +0100143 }
amit.ghosh188a84f2020-09-27 20:59:25 +0200144 Status status = 1;
145 Reason reason = 2;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100146 string reason_detail = 3;
amit.ghosh188a84f2020-09-27 20:59:25 +0200147}
148
149message GetLoggingEndpointResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100150 enum Reason {
151 UNDEFINED_REASON = 0;
152 UNKNOWN_DEVICE = 1;
153 INTERNAL_ERROR = 2;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100154 DEVICE_UNREACHABLE = 3;
amit.ghoshae473032021-01-10 11:59:10 +0100155 }
amit.ghosh188a84f2020-09-27 20:59:25 +0200156 Status status = 1;
157 Reason reason = 2;
158 string logging_endpoint = 3;
159 string logging_protocol = 4;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100160 string reason_detail = 5;
amit.ghosh188a84f2020-09-27 20:59:25 +0200161}
162
163message SetMsgBusEndpointRequest {
164 string msgbus_endpoint = 1;
165}
166
167message GetMsgBusEndpointResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100168 enum Reason {
169 UNDEFINED_REASON = 0;
170 INTERNAL_ERROR = 1;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100171 DEVICE_UNREACHABLE = 2;
amit.ghoshae473032021-01-10 11:59:10 +0100172 }
amit.ghosh188a84f2020-09-27 20:59:25 +0200173 Status status = 1;
174 Reason reason = 2;
175 string msgbus_endpoint = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100176 string reason_detail = 4;
amit.ghosh188a84f2020-09-27 20:59:25 +0200177}
178
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200179message EntitiesLogLevel {
180 LogLevel logLevel = 1;
181 repeated string entities = 2;
182}
183
184message SetLogLevelRequest {
185 Uuid device_uuid = 1;
186 repeated EntitiesLogLevel loglevels = 2;
187}
188
189message SetLogLevelResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100190 enum Reason {
191 UNDEFINED_REASON = 0;
192 UNKNOWN_DEVICE = 1;
193 INTERNAL_ERROR = 2;
194 UNKNOWN_LOG_ENTITY = 3;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100195 DEVICE_UNREACHABLE = 4;
amit.ghoshae473032021-01-10 11:59:10 +0100196 }
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200197 Uuid device_uuid = 1;
198 Status status = 2;
199 Reason reason = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100200 string reason_detail = 4;
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200201}
202
203message GetLogLevelRequest {
204 Uuid device_uuid = 1;
205 repeated string entities = 2;
206}
207
208message GetLogLevelResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100209 enum Reason {
210 UNDEFINED_REASON = 0;
211 UNKNOWN_DEVICE = 1;
212 INTERNAL_ERROR = 2;
213 UNKNOWN_LOG_ENTITY = 3;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100214 DEVICE_UNREACHABLE = 4;
amit.ghoshae473032021-01-10 11:59:10 +0100215 }
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200216 Uuid device_uuid = 1;
217 repeated EntitiesLogLevel logLevels = 2;
218 Status status = 3;
219 Reason reason = 4;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100220 string reason_detail = 5;
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200221}
222
223message GetLoggableEntitiesRequest {
224 Uuid device_uuid = 1;
225}
226
Chandrakanth Nalkudre Gowda415b83c2021-04-28 18:01:29 +0530227message Heartbeat {
228 fixed32 heartbeat_signature = 1;
229}
230
Chandrakanth Nalkudre Gowda2f6066c2021-05-13 12:36:32 +0530231message RebootDeviceRequest {
232 Uuid device_uuid = 1;
233}
234
235message RebootDeviceResponse {
236 enum Reason {
237 UNDEFINED_REASON = 0;
238 UNKNOWN_DEVICE = 1;
239 INTERNAL_ERROR = 2;
240 DEVICE_UNREACHABLE = 3;
241 }
242 Status status = 3;
243 Reason reason = 4;
244 string reason_detail = 5;
245}
246
Amit Ghosh09f28362020-06-12 21:52:19 +0100247service NativeHWManagementService {
248 // Initializes context for a device and sets up required states
Amit Ghosh704462f2020-06-24 16:44:56 +0100249 // In the call to StartManagingDevice, the fields of ModifiableComponent which are relevant
250 // and their meanings in this context is mentioned below:
251 // name = The unique name that needs to be assigned to this hardware;
252 // class = COMPONENT_TYPE_UNDEFINED;
253 // parent = nil;
254 // alias = Optional;
255 // asset_id = Optional;
256 // uri = IP Address of the Hardware;
257 rpc StartManagingDevice(ModifiableComponent) returns(stream StartManagingDeviceResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100258
Amit Ghosh366228e2020-07-06 13:46:42 +0100259 // Stop management of a device and clean up any context and caches for that device
amit.ghoshae473032021-01-10 11:59:10 +0100260 // This rpc can be called at any time, even before the StartManagingDevice operation
261 // has completed, and should be able to cleanup.
Amit Ghosh366228e2020-07-06 13:46:42 +0100262 rpc StopManagingDevice(StopManagingDeviceRequest) returns(StopManagingDeviceResponse);
263
Andrea Campanellacb990bc2020-09-22 12:50:56 +0200264 // Returns an object containing a list of devices managed by this entity
265 rpc GetManagedDevices(google.protobuf.Empty) returns(ManagedDevicesResponse);
266
Amit Ghosh09f28362020-06-12 21:52:19 +0100267 // Get the HW inventory details of the Device
268 rpc GetPhysicalInventory(PhysicalInventoryRequest) returns(stream PhysicalInventoryResponse);
269
270 // Get the details of a particular HW component
aghoshc301dcd2020-09-03 16:55:34 +0100271 rpc GetHWComponentInfo(HWComponentInfoGetRequest) returns(stream HWComponentInfoGetResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100272
273 // Sets the permissible attributes of a HW component
274 rpc SetHWComponentInfo(HWComponentInfoSetRequest) returns(HWComponentInfoSetResponse);
amit.ghosh188a84f2020-09-27 20:59:25 +0200275
276 // Sets the location to which logs need to be shipped
277 rpc SetLoggingEndpoint(SetLoggingEndpointRequest) returns(SetRemoteEndpointResponse);
278
279 // Gets the configured location to which the logs are being shipped
amit.ghosh5d97dba2020-11-12 16:45:27 +0100280 rpc GetLoggingEndpoint(HardwareID) returns(GetLoggingEndpointResponse);
amit.ghosh188a84f2020-09-27 20:59:25 +0200281
282 // Sets the location of the Message Bus to which events and metrics are shipped
283 rpc SetMsgBusEndpoint(SetMsgBusEndpointRequest) returns(SetRemoteEndpointResponse);
284
285 // Gets the configured location to which the events and metrics are being shipped
286 rpc GetMsgBusEndpoint(google.protobuf.Empty) returns(GetMsgBusEndpointResponse);
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200287
288 // Gets the entities of a device on which log can be configured. A few are expected, like OS, PON Management etc.
289 // In general an entity is any item within an hardware system that can emit logs, e.g. service, process, subsystem,
290 // interface, package etc.
291 rpc GetLoggableEntities(GetLoggableEntitiesRequest) returns(GetLogLevelResponse);
292
amit.ghosh5d97dba2020-11-12 16:45:27 +0100293 // Sets the log level of the device, for each given entity to a certain level.
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200294 // If only one EntitiesLogLevel is provided for the device and that request contains only a log level with
295 // no entity in the list it's assumed that the caller wants to set that level for all the entities.
296 rpc SetLogLevel(SetLogLevelRequest) returns(SetLogLevelResponse);
297
298 // Gets the configured log level for a certain entity on a certain device.
299 // If no entity is specified in the request all the entities with their log level should be returned.
300 rpc GetLogLevel(GetLogLevelRequest) returns(GetLogLevelResponse);
Chandrakanth Nalkudre Gowda415b83c2021-04-28 18:01:29 +0530301
302 // Performs the heartbeat check
303 rpc HeartbeatCheck(google.protobuf.Empty) returns (Heartbeat);
Chandrakanth Nalkudre Gowda2f6066c2021-05-13 12:36:32 +0530304
305 // Performs the reboot of the device
306 rpc RebootDevice(RebootDeviceRequest) returns(RebootDeviceResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100307}