blob: 3a703c4b5f21932b2de69f54fd13ad5b25d07040 [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;
84 }
Amit Ghosh09f28362020-06-12 21:52:19 +010085 Status status = 1;
86 Reason reason = 2;
87 Uuid device_uuid = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +010088 string reason_detail = 4;
Amit Ghosh09f28362020-06-12 21:52:19 +010089}
90
Amit Ghosh366228e2020-07-06 13:46:42 +010091message StopManagingDeviceRequest {
92 string name = 1;
93}
94
95message StopManagingDeviceResponse {
amit.ghoshae473032021-01-10 11:59:10 +010096 // The only case in which an error is expected is if the name of the
97 // device to be stopped is not found
98 enum Reason {
99 UNDEFINED_REASON = 0;
100 UNKNOWN_DEVICE= 1;
101 }
Amit Ghosh366228e2020-07-06 13:46:42 +0100102 Status status = 1;
103 Reason reason = 2;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100104 string reason_detail = 3;
Amit Ghosh366228e2020-07-06 13:46:42 +0100105}
106
Andrea Campanellacb990bc2020-09-22 12:50:56 +0200107message ManagedDevicesResponse {
108 repeated ModifiableComponent devices = 1;
109}
110
amit.ghosh188a84f2020-09-27 20:59:25 +0200111message SetLoggingEndpointRequest {
112 Uuid device_uuid = 1;
113 string logging_endpoint = 2;
114 string logging_protocol = 3;
115}
116
117message SetRemoteEndpointResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100118 enum Reason {
119 UNDEFINED_REASON = 0;
120 UNKNOWN_DEVICE = 1;
121 INTERNAL_ERROR = 2;
122 LOGGING_ENDPOINT_ERROR = 3;
123 LOGGING_ENDPOINT_PROTOCOL_ERROR = 4;
124 MSGBUS_ENDPOINT_ERROR = 5;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100125 DEVICE_UNREACHABLE = 6;
amit.ghoshae473032021-01-10 11:59:10 +0100126 }
amit.ghosh188a84f2020-09-27 20:59:25 +0200127 Status status = 1;
128 Reason reason = 2;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100129 string reason_detail = 3;
amit.ghosh188a84f2020-09-27 20:59:25 +0200130}
131
132message GetLoggingEndpointResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100133 enum Reason {
134 UNDEFINED_REASON = 0;
135 UNKNOWN_DEVICE = 1;
136 INTERNAL_ERROR = 2;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100137 DEVICE_UNREACHABLE = 3;
amit.ghoshae473032021-01-10 11:59:10 +0100138 }
amit.ghosh188a84f2020-09-27 20:59:25 +0200139 Status status = 1;
140 Reason reason = 2;
141 string logging_endpoint = 3;
142 string logging_protocol = 4;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100143 string reason_detail = 5;
amit.ghosh188a84f2020-09-27 20:59:25 +0200144}
145
146message SetMsgBusEndpointRequest {
147 string msgbus_endpoint = 1;
148}
149
150message GetMsgBusEndpointResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100151 enum Reason {
152 UNDEFINED_REASON = 0;
153 INTERNAL_ERROR = 1;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100154 DEVICE_UNREACHABLE = 2;
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 msgbus_endpoint = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100159 string reason_detail = 4;
amit.ghosh188a84f2020-09-27 20:59:25 +0200160}
161
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200162message EntitiesLogLevel {
163 LogLevel logLevel = 1;
164 repeated string entities = 2;
165}
166
167message SetLogLevelRequest {
168 Uuid device_uuid = 1;
169 repeated EntitiesLogLevel loglevels = 2;
170}
171
172message SetLogLevelResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100173 enum Reason {
174 UNDEFINED_REASON = 0;
175 UNKNOWN_DEVICE = 1;
176 INTERNAL_ERROR = 2;
177 UNKNOWN_LOG_ENTITY = 3;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100178 DEVICE_UNREACHABLE = 4;
amit.ghoshae473032021-01-10 11:59:10 +0100179 }
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200180 Uuid device_uuid = 1;
181 Status status = 2;
182 Reason reason = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100183 string reason_detail = 4;
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200184}
185
186message GetLogLevelRequest {
187 Uuid device_uuid = 1;
188 repeated string entities = 2;
189}
190
191message GetLogLevelResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100192 enum Reason {
193 UNDEFINED_REASON = 0;
194 UNKNOWN_DEVICE = 1;
195 INTERNAL_ERROR = 2;
196 UNKNOWN_LOG_ENTITY = 3;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100197 DEVICE_UNREACHABLE = 4;
amit.ghoshae473032021-01-10 11:59:10 +0100198 }
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200199 Uuid device_uuid = 1;
200 repeated EntitiesLogLevel logLevels = 2;
201 Status status = 3;
202 Reason reason = 4;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100203 string reason_detail = 5;
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200204}
205
206message GetLoggableEntitiesRequest {
207 Uuid device_uuid = 1;
208}
209
Amit Ghosh09f28362020-06-12 21:52:19 +0100210service NativeHWManagementService {
211 // Initializes context for a device and sets up required states
Amit Ghosh704462f2020-06-24 16:44:56 +0100212 // In the call to StartManagingDevice, the fields of ModifiableComponent which are relevant
213 // and their meanings in this context is mentioned below:
214 // name = The unique name that needs to be assigned to this hardware;
215 // class = COMPONENT_TYPE_UNDEFINED;
216 // parent = nil;
217 // alias = Optional;
218 // asset_id = Optional;
219 // uri = IP Address of the Hardware;
220 rpc StartManagingDevice(ModifiableComponent) returns(stream StartManagingDeviceResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100221
Amit Ghosh366228e2020-07-06 13:46:42 +0100222 // Stop management of a device and clean up any context and caches for that device
amit.ghoshae473032021-01-10 11:59:10 +0100223 // This rpc can be called at any time, even before the StartManagingDevice operation
224 // has completed, and should be able to cleanup.
Amit Ghosh366228e2020-07-06 13:46:42 +0100225 rpc StopManagingDevice(StopManagingDeviceRequest) returns(StopManagingDeviceResponse);
226
Andrea Campanellacb990bc2020-09-22 12:50:56 +0200227 // Returns an object containing a list of devices managed by this entity
228 rpc GetManagedDevices(google.protobuf.Empty) returns(ManagedDevicesResponse);
229
Amit Ghosh09f28362020-06-12 21:52:19 +0100230 // Get the HW inventory details of the Device
231 rpc GetPhysicalInventory(PhysicalInventoryRequest) returns(stream PhysicalInventoryResponse);
232
233 // Get the details of a particular HW component
aghoshc301dcd2020-09-03 16:55:34 +0100234 rpc GetHWComponentInfo(HWComponentInfoGetRequest) returns(stream HWComponentInfoGetResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100235
236 // Sets the permissible attributes of a HW component
237 rpc SetHWComponentInfo(HWComponentInfoSetRequest) returns(HWComponentInfoSetResponse);
amit.ghosh188a84f2020-09-27 20:59:25 +0200238
239 // Sets the location to which logs need to be shipped
240 rpc SetLoggingEndpoint(SetLoggingEndpointRequest) returns(SetRemoteEndpointResponse);
241
242 // Gets the configured location to which the logs are being shipped
amit.ghosh5d97dba2020-11-12 16:45:27 +0100243 rpc GetLoggingEndpoint(HardwareID) returns(GetLoggingEndpointResponse);
amit.ghosh188a84f2020-09-27 20:59:25 +0200244
245 // Sets the location of the Message Bus to which events and metrics are shipped
246 rpc SetMsgBusEndpoint(SetMsgBusEndpointRequest) returns(SetRemoteEndpointResponse);
247
248 // Gets the configured location to which the events and metrics are being shipped
249 rpc GetMsgBusEndpoint(google.protobuf.Empty) returns(GetMsgBusEndpointResponse);
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200250
251 // Gets the entities of a device on which log can be configured. A few are expected, like OS, PON Management etc.
252 // In general an entity is any item within an hardware system that can emit logs, e.g. service, process, subsystem,
253 // interface, package etc.
254 rpc GetLoggableEntities(GetLoggableEntitiesRequest) returns(GetLogLevelResponse);
255
amit.ghosh5d97dba2020-11-12 16:45:27 +0100256 // Sets the log level of the device, for each given entity to a certain level.
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200257 // If only one EntitiesLogLevel is provided for the device and that request contains only a log level with
258 // no entity in the list it's assumed that the caller wants to set that level for all the entities.
259 rpc SetLogLevel(SetLogLevelRequest) returns(SetLogLevelResponse);
260
261 // Gets the configured log level for a certain entity on a certain device.
262 // If no entity is specified in the request all the entities with their log level should be returned.
263 rpc GetLogLevel(GetLogLevelRequest) returns(GetLogLevelResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100264}