blob: cf713ba66769f1115f93e524feaffa2292127283 [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;
21 }
Amit Ghosh09f28362020-06-12 21:52:19 +010022 Status status = 1;
23 Reason reason = 2;
24 Hardware inventory = 3;
25}
26
27message HWComponentInfoGetRequest {
28 Uuid device_uuid = 1;
29 Uuid component_uuid = 2;
30 string component_name = 3;
31}
32
aghoshc301dcd2020-09-03 16:55:34 +010033message HWComponentInfoGetResponse {
amit.ghoshae473032021-01-10 11:59:10 +010034 enum Reason {
35 UNDEFINED_REASON = 0;
36 UNKNOWN_DEVICE = 1;
37 UNKNOWN_COMPONENT = 2;
38 INTERNAL_ERROR = 3;
39 }
aghoshc301dcd2020-09-03 16:55:34 +010040 Status status = 1;
41 Reason reason = 2;
42 Component component = 3;
43}
44
Amit Ghosh09f28362020-06-12 21:52:19 +010045message HWComponentInfoSetRequest {
46 Uuid device_uuid = 1;
47 Uuid component_uuid = 2;
48 string component_name = 3;
49 ModifiableComponent changes = 4;
50}
51
52message HWComponentInfoSetResponse {
amit.ghoshae473032021-01-10 11:59:10 +010053 enum Reason {
54 UNDEFINED_REASON = 0;
55 UNKNOWN_DEVICE = 1;
56 UNKNOWN_COMPONENT = 2;
57 INVALID_PARAMS = 3;
58 INTERNAL_ERROR = 4;
59 }
Amit Ghosh09f28362020-06-12 21:52:19 +010060 Status status = 1;
61 Reason reason = 2;
62}
63
64message StartManagingDeviceResponse {
amit.ghoshae473032021-01-10 11:59:10 +010065 enum Reason {
66 UNDEFINED_REASON = 0;
67 // DEVICE_ALREADY_MANAGED is returned when StartManagingDevice is called again for the same name AFTER a previously
68 // successful StartManagingDevice operation
69 DEVICE_ALREADY_MANAGED = 1;
70 // OPERATION_ALREADY_IN_PROGRESS is returned when StartManagingDevice is called again for the same name BEFORE
71 // a previous StartManagingDevice operation has completed
72 OPERATION_ALREADY_IN_PROGRESS = 2;
73 INVALID_PARAMS = 3;
74 INTERNAL_ERROR = 4;
75 }
Amit Ghosh09f28362020-06-12 21:52:19 +010076 Status status = 1;
77 Reason reason = 2;
78 Uuid device_uuid = 3;
79}
80
Amit Ghosh366228e2020-07-06 13:46:42 +010081message StopManagingDeviceRequest {
82 string name = 1;
83}
84
85message StopManagingDeviceResponse {
amit.ghoshae473032021-01-10 11:59:10 +010086 // The only case in which an error is expected is if the name of the
87 // device to be stopped is not found
88 enum Reason {
89 UNDEFINED_REASON = 0;
90 UNKNOWN_DEVICE= 1;
91 }
Amit Ghosh366228e2020-07-06 13:46:42 +010092 Status status = 1;
93 Reason reason = 2;
94}
95
Andrea Campanellacb990bc2020-09-22 12:50:56 +020096message ManagedDevicesResponse {
97 repeated ModifiableComponent devices = 1;
98}
99
amit.ghosh188a84f2020-09-27 20:59:25 +0200100message SetLoggingEndpointRequest {
101 Uuid device_uuid = 1;
102 string logging_endpoint = 2;
103 string logging_protocol = 3;
104}
105
106message SetRemoteEndpointResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100107 enum Reason {
108 UNDEFINED_REASON = 0;
109 UNKNOWN_DEVICE = 1;
110 INTERNAL_ERROR = 2;
111 LOGGING_ENDPOINT_ERROR = 3;
112 LOGGING_ENDPOINT_PROTOCOL_ERROR = 4;
113 MSGBUS_ENDPOINT_ERROR = 5;
114 }
amit.ghosh188a84f2020-09-27 20:59:25 +0200115 Status status = 1;
116 Reason reason = 2;
117}
118
119message GetLoggingEndpointResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100120 enum Reason {
121 UNDEFINED_REASON = 0;
122 UNKNOWN_DEVICE = 1;
123 INTERNAL_ERROR = 2;
124 }
amit.ghosh188a84f2020-09-27 20:59:25 +0200125 Status status = 1;
126 Reason reason = 2;
127 string logging_endpoint = 3;
128 string logging_protocol = 4;
129}
130
131message SetMsgBusEndpointRequest {
132 string msgbus_endpoint = 1;
133}
134
135message GetMsgBusEndpointResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100136 enum Reason {
137 UNDEFINED_REASON = 0;
138 INTERNAL_ERROR = 1;
139 }
amit.ghosh188a84f2020-09-27 20:59:25 +0200140 Status status = 1;
141 Reason reason = 2;
142 string msgbus_endpoint = 3;
143}
144
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200145message EntitiesLogLevel {
146 LogLevel logLevel = 1;
147 repeated string entities = 2;
148}
149
150message SetLogLevelRequest {
151 Uuid device_uuid = 1;
152 repeated EntitiesLogLevel loglevels = 2;
153}
154
155message SetLogLevelResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100156 enum Reason {
157 UNDEFINED_REASON = 0;
158 UNKNOWN_DEVICE = 1;
159 INTERNAL_ERROR = 2;
160 UNKNOWN_LOG_ENTITY = 3;
161 }
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200162 Uuid device_uuid = 1;
163 Status status = 2;
164 Reason reason = 3;
165}
166
167message GetLogLevelRequest {
168 Uuid device_uuid = 1;
169 repeated string entities = 2;
170}
171
172message GetLogLevelResponse {
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;
178 }
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200179 Uuid device_uuid = 1;
180 repeated EntitiesLogLevel logLevels = 2;
181 Status status = 3;
182 Reason reason = 4;
183}
184
185message GetLoggableEntitiesRequest {
186 Uuid device_uuid = 1;
187}
188
Amit Ghosh09f28362020-06-12 21:52:19 +0100189service NativeHWManagementService {
190 // Initializes context for a device and sets up required states
Amit Ghosh704462f2020-06-24 16:44:56 +0100191 // In the call to StartManagingDevice, the fields of ModifiableComponent which are relevant
192 // and their meanings in this context is mentioned below:
193 // name = The unique name that needs to be assigned to this hardware;
194 // class = COMPONENT_TYPE_UNDEFINED;
195 // parent = nil;
196 // alias = Optional;
197 // asset_id = Optional;
198 // uri = IP Address of the Hardware;
199 rpc StartManagingDevice(ModifiableComponent) returns(stream StartManagingDeviceResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100200
Amit Ghosh366228e2020-07-06 13:46:42 +0100201 // Stop management of a device and clean up any context and caches for that device
amit.ghoshae473032021-01-10 11:59:10 +0100202 // This rpc can be called at any time, even before the StartManagingDevice operation
203 // has completed, and should be able to cleanup.
Amit Ghosh366228e2020-07-06 13:46:42 +0100204 rpc StopManagingDevice(StopManagingDeviceRequest) returns(StopManagingDeviceResponse);
205
Andrea Campanellacb990bc2020-09-22 12:50:56 +0200206 // Returns an object containing a list of devices managed by this entity
207 rpc GetManagedDevices(google.protobuf.Empty) returns(ManagedDevicesResponse);
208
Amit Ghosh09f28362020-06-12 21:52:19 +0100209 // Get the HW inventory details of the Device
210 rpc GetPhysicalInventory(PhysicalInventoryRequest) returns(stream PhysicalInventoryResponse);
211
212 // Get the details of a particular HW component
aghoshc301dcd2020-09-03 16:55:34 +0100213 rpc GetHWComponentInfo(HWComponentInfoGetRequest) returns(stream HWComponentInfoGetResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100214
215 // Sets the permissible attributes of a HW component
216 rpc SetHWComponentInfo(HWComponentInfoSetRequest) returns(HWComponentInfoSetResponse);
amit.ghosh188a84f2020-09-27 20:59:25 +0200217
218 // Sets the location to which logs need to be shipped
219 rpc SetLoggingEndpoint(SetLoggingEndpointRequest) returns(SetRemoteEndpointResponse);
220
221 // Gets the configured location to which the logs are being shipped
amit.ghosh5d97dba2020-11-12 16:45:27 +0100222 rpc GetLoggingEndpoint(HardwareID) returns(GetLoggingEndpointResponse);
amit.ghosh188a84f2020-09-27 20:59:25 +0200223
224 // Sets the location of the Message Bus to which events and metrics are shipped
225 rpc SetMsgBusEndpoint(SetMsgBusEndpointRequest) returns(SetRemoteEndpointResponse);
226
227 // Gets the configured location to which the events and metrics are being shipped
228 rpc GetMsgBusEndpoint(google.protobuf.Empty) returns(GetMsgBusEndpointResponse);
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200229
230 // Gets the entities of a device on which log can be configured. A few are expected, like OS, PON Management etc.
231 // In general an entity is any item within an hardware system that can emit logs, e.g. service, process, subsystem,
232 // interface, package etc.
233 rpc GetLoggableEntities(GetLoggableEntitiesRequest) returns(GetLogLevelResponse);
234
amit.ghosh5d97dba2020-11-12 16:45:27 +0100235 // Sets the log level of the device, for each given entity to a certain level.
Andrea Campanellab91e9a42020-10-09 14:31:43 +0200236 // If only one EntitiesLogLevel is provided for the device and that request contains only a log level with
237 // no entity in the list it's assumed that the caller wants to set that level for all the entities.
238 rpc SetLogLevel(SetLogLevelRequest) returns(SetLogLevelResponse);
239
240 // Gets the configured log level for a certain entity on a certain device.
241 // If no entity is specified in the request all the entities with their log level should be returned.
242 rpc GetLogLevel(GetLogLevelRequest) returns(GetLogLevelResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100243}