blob: 209f8b8d8ce17ad644d63ef228d8ac9ac1490f1f [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;
26}
27
28message HWComponentInfoGetRequest {
29 Uuid device_uuid = 1;
30 Uuid component_uuid = 2;
31 string component_name = 3;
32}
33
aghoshc301dcd2020-09-03 16:55:34 +010034message HWComponentInfoGetResponse {
amit.ghoshae473032021-01-10 11:59:10 +010035 enum Reason {
36 UNDEFINED_REASON = 0;
37 UNKNOWN_DEVICE = 1;
38 UNKNOWN_COMPONENT = 2;
39 INTERNAL_ERROR = 3;
amit.ghoshbd2022e2021-02-22 05:58:53 +010040 DEVICE_UNREACHABLE = 4;
amit.ghoshae473032021-01-10 11:59:10 +010041 }
aghoshc301dcd2020-09-03 16:55:34 +010042 Status status = 1;
43 Reason reason = 2;
44 Component component = 3;
45}
46
Amit Ghosh09f28362020-06-12 21:52:19 +010047message HWComponentInfoSetRequest {
48 Uuid device_uuid = 1;
49 Uuid component_uuid = 2;
50 string component_name = 3;
51 ModifiableComponent changes = 4;
52}
53
54message HWComponentInfoSetResponse {
amit.ghoshae473032021-01-10 11:59:10 +010055 enum Reason {
56 UNDEFINED_REASON = 0;
57 UNKNOWN_DEVICE = 1;
58 UNKNOWN_COMPONENT = 2;
59 INVALID_PARAMS = 3;
60 INTERNAL_ERROR = 4;
amit.ghoshbd2022e2021-02-22 05:58:53 +010061 DEVICE_UNREACHABLE = 5;
amit.ghoshae473032021-01-10 11:59:10 +010062 }
Amit Ghosh09f28362020-06-12 21:52:19 +010063 Status status = 1;
64 Reason reason = 2;
65}
66
67message StartManagingDeviceResponse {
amit.ghoshae473032021-01-10 11:59:10 +010068 enum Reason {
69 UNDEFINED_REASON = 0;
70 // DEVICE_ALREADY_MANAGED is returned when StartManagingDevice is called again for the same name AFTER a previously
71 // successful StartManagingDevice operation
72 DEVICE_ALREADY_MANAGED = 1;
73 // OPERATION_ALREADY_IN_PROGRESS is returned when StartManagingDevice is called again for the same name BEFORE
74 // a previous StartManagingDevice operation has completed
75 OPERATION_ALREADY_IN_PROGRESS = 2;
76 INVALID_PARAMS = 3;
77 INTERNAL_ERROR = 4;
78 }
Amit Ghosh09f28362020-06-12 21:52:19 +010079 Status status = 1;
80 Reason reason = 2;
81 Uuid device_uuid = 3;
82}
83
Amit Ghosh366228e2020-07-06 13:46:42 +010084message StopManagingDeviceRequest {
85 string name = 1;
86}
87
88message StopManagingDeviceResponse {
amit.ghoshae473032021-01-10 11:59:10 +010089 // The only case in which an error is expected is if the name of the
90 // device to be stopped is not found
91 enum Reason {
92 UNDEFINED_REASON = 0;
93 UNKNOWN_DEVICE= 1;
94 }
Amit Ghosh366228e2020-07-06 13:46:42 +010095 Status status = 1;
96 Reason reason = 2;
97}
98
Andrea Campanellacb990bc2020-09-22 12:50:56 +020099message ManagedDevicesResponse {
100 repeated ModifiableComponent devices = 1;
101}
102
amit.ghosh188a84f2020-09-27 20:59:25 +0200103message SetLoggingEndpointRequest {
104 Uuid device_uuid = 1;
105 string logging_endpoint = 2;
106 string logging_protocol = 3;
107}
108
109message SetRemoteEndpointResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100110 enum Reason {
111 UNDEFINED_REASON = 0;
112 UNKNOWN_DEVICE = 1;
113 INTERNAL_ERROR = 2;
114 LOGGING_ENDPOINT_ERROR = 3;
115 LOGGING_ENDPOINT_PROTOCOL_ERROR = 4;
116 MSGBUS_ENDPOINT_ERROR = 5;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100117 DEVICE_UNREACHABLE = 6;
amit.ghoshae473032021-01-10 11:59:10 +0100118 }
amit.ghosh188a84f2020-09-27 20:59:25 +0200119 Status status = 1;
120 Reason reason = 2;
121}
122
123message GetLoggingEndpointResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100124 enum Reason {
125 UNDEFINED_REASON = 0;
126 UNKNOWN_DEVICE = 1;
127 INTERNAL_ERROR = 2;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100128 DEVICE_UNREACHABLE = 3;
amit.ghoshae473032021-01-10 11:59:10 +0100129 }
amit.ghosh188a84f2020-09-27 20:59:25 +0200130 Status status = 1;
131 Reason reason = 2;
132 string logging_endpoint = 3;
133 string logging_protocol = 4;
134}
135
136message SetMsgBusEndpointRequest {
137 string msgbus_endpoint = 1;
138}
139
140message GetMsgBusEndpointResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100141 enum Reason {
142 UNDEFINED_REASON = 0;
143 INTERNAL_ERROR = 1;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100144 DEVICE_UNREACHABLE = 2;
amit.ghoshae473032021-01-10 11:59:10 +0100145 }
amit.ghosh188a84f2020-09-27 20:59:25 +0200146 Status status = 1;
147 Reason reason = 2;
148 string msgbus_endpoint = 3;
149}
150
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200151message EntitiesLogLevel {
152 LogLevel logLevel = 1;
153 repeated string entities = 2;
154}
155
156message SetLogLevelRequest {
157 Uuid device_uuid = 1;
158 repeated EntitiesLogLevel loglevels = 2;
159}
160
161message SetLogLevelResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100162 enum Reason {
163 UNDEFINED_REASON = 0;
164 UNKNOWN_DEVICE = 1;
165 INTERNAL_ERROR = 2;
166 UNKNOWN_LOG_ENTITY = 3;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100167 DEVICE_UNREACHABLE = 4;
amit.ghoshae473032021-01-10 11:59:10 +0100168 }
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200169 Uuid device_uuid = 1;
170 Status status = 2;
171 Reason reason = 3;
172}
173
174message GetLogLevelRequest {
175 Uuid device_uuid = 1;
176 repeated string entities = 2;
177}
178
179message GetLogLevelResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100180 enum Reason {
181 UNDEFINED_REASON = 0;
182 UNKNOWN_DEVICE = 1;
183 INTERNAL_ERROR = 2;
184 UNKNOWN_LOG_ENTITY = 3;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100185 DEVICE_UNREACHABLE = 4;
amit.ghoshae473032021-01-10 11:59:10 +0100186 }
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200187 Uuid device_uuid = 1;
188 repeated EntitiesLogLevel logLevels = 2;
189 Status status = 3;
190 Reason reason = 4;
191}
192
193message GetLoggableEntitiesRequest {
194 Uuid device_uuid = 1;
195}
196
Amit Ghosh09f28362020-06-12 21:52:19 +0100197service NativeHWManagementService {
198 // Initializes context for a device and sets up required states
Amit Ghosh704462f2020-06-24 16:44:56 +0100199 // In the call to StartManagingDevice, the fields of ModifiableComponent which are relevant
200 // and their meanings in this context is mentioned below:
201 // name = The unique name that needs to be assigned to this hardware;
202 // class = COMPONENT_TYPE_UNDEFINED;
203 // parent = nil;
204 // alias = Optional;
205 // asset_id = Optional;
206 // uri = IP Address of the Hardware;
207 rpc StartManagingDevice(ModifiableComponent) returns(stream StartManagingDeviceResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100208
Amit Ghosh366228e2020-07-06 13:46:42 +0100209 // Stop management of a device and clean up any context and caches for that device
amit.ghoshae473032021-01-10 11:59:10 +0100210 // This rpc can be called at any time, even before the StartManagingDevice operation
211 // has completed, and should be able to cleanup.
Amit Ghosh366228e2020-07-06 13:46:42 +0100212 rpc StopManagingDevice(StopManagingDeviceRequest) returns(StopManagingDeviceResponse);
213
Andrea Campanellacb990bc2020-09-22 12:50:56 +0200214 // Returns an object containing a list of devices managed by this entity
215 rpc GetManagedDevices(google.protobuf.Empty) returns(ManagedDevicesResponse);
216
Amit Ghosh09f28362020-06-12 21:52:19 +0100217 // Get the HW inventory details of the Device
218 rpc GetPhysicalInventory(PhysicalInventoryRequest) returns(stream PhysicalInventoryResponse);
219
220 // Get the details of a particular HW component
aghoshc301dcd2020-09-03 16:55:34 +0100221 rpc GetHWComponentInfo(HWComponentInfoGetRequest) returns(stream HWComponentInfoGetResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100222
223 // Sets the permissible attributes of a HW component
224 rpc SetHWComponentInfo(HWComponentInfoSetRequest) returns(HWComponentInfoSetResponse);
amit.ghosh188a84f2020-09-27 20:59:25 +0200225
226 // Sets the location to which logs need to be shipped
227 rpc SetLoggingEndpoint(SetLoggingEndpointRequest) returns(SetRemoteEndpointResponse);
228
229 // Gets the configured location to which the logs are being shipped
amit.ghosh5d97dba2020-11-12 16:45:27 +0100230 rpc GetLoggingEndpoint(HardwareID) returns(GetLoggingEndpointResponse);
amit.ghosh188a84f2020-09-27 20:59:25 +0200231
232 // Sets the location of the Message Bus to which events and metrics are shipped
233 rpc SetMsgBusEndpoint(SetMsgBusEndpointRequest) returns(SetRemoteEndpointResponse);
234
235 // Gets the configured location to which the events and metrics are being shipped
236 rpc GetMsgBusEndpoint(google.protobuf.Empty) returns(GetMsgBusEndpointResponse);
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200237
238 // Gets the entities of a device on which log can be configured. A few are expected, like OS, PON Management etc.
239 // In general an entity is any item within an hardware system that can emit logs, e.g. service, process, subsystem,
240 // interface, package etc.
241 rpc GetLoggableEntities(GetLoggableEntitiesRequest) returns(GetLogLevelResponse);
242
amit.ghosh5d97dba2020-11-12 16:45:27 +0100243 // Sets the log level of the device, for each given entity to a certain level.
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200244 // If only one EntitiesLogLevel is provided for the device and that request contains only a log level with
245 // no entity in the list it's assumed that the caller wants to set that level for all the entities.
246 rpc SetLogLevel(SetLogLevelRequest) returns(SetLogLevelResponse);
247
248 // Gets the configured log level for a certain entity on a certain device.
249 // If no entity is specified in the request all the entities with their log level should be returned.
250 rpc GetLogLevel(GetLogLevelRequest) returns(GetLogLevelResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100251}