Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 1 | syntax = "proto3";
|
| 2 |
|
| 3 | option go_package = "github.com/opencord/device-management-interface/v3/go/dmi";
|
| 4 | package dmi;
|
| 5 |
|
| 6 | import "dmi/commons.proto";
|
| 7 | import "dmi/hw.proto";
|
Andrea Campanella | cb990bc | 2020-09-22 12:50:56 +0200 | [diff] [blame] | 8 | import "google/protobuf/empty.proto";
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 9 |
|
| 10 | // Protos for the management of a hardware and it's components
|
| 11 |
|
| 12 | message PhysicalInventoryRequest {
|
| 13 | Uuid device_uuid = 1;
|
| 14 | }
|
| 15 |
|
| 16 | message PhysicalInventoryResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 17 | enum Reason {
|
| 18 | UNDEFINED_REASON = 0;
|
| 19 | UNKNOWN_DEVICE = 1;
|
| 20 | INTERNAL_ERROR = 2;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 21 | DEVICE_UNREACHABLE = 3;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 22 | }
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 23 | Status status = 1;
|
| 24 | Reason reason = 2;
|
| 25 | Hardware inventory = 3;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 26 | // 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 Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 30 | }
|
| 31 |
|
| 32 | message HWComponentInfoGetRequest {
|
| 33 | Uuid device_uuid = 1;
|
| 34 | Uuid component_uuid = 2;
|
| 35 | string component_name = 3;
|
| 36 | }
|
| 37 |
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 38 | message HWComponentInfoGetResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 39 | enum Reason {
|
| 40 | UNDEFINED_REASON = 0;
|
| 41 | UNKNOWN_DEVICE = 1;
|
| 42 | UNKNOWN_COMPONENT = 2;
|
| 43 | INTERNAL_ERROR = 3;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 44 | DEVICE_UNREACHABLE = 4;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 45 | }
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 46 | Status status = 1;
|
| 47 | Reason reason = 2;
|
| 48 | Component component = 3;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 49 | string reason_detail = 4;
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 50 | }
|
| 51 |
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 52 | message HWComponentInfoSetRequest {
|
| 53 | Uuid device_uuid = 1;
|
| 54 | Uuid component_uuid = 2;
|
| 55 | string component_name = 3;
|
| 56 | ModifiableComponent changes = 4;
|
| 57 | }
|
| 58 |
|
| 59 | message HWComponentInfoSetResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 60 | enum Reason {
|
| 61 | UNDEFINED_REASON = 0;
|
| 62 | UNKNOWN_DEVICE = 1;
|
| 63 | UNKNOWN_COMPONENT = 2;
|
| 64 | INVALID_PARAMS = 3;
|
| 65 | INTERNAL_ERROR = 4;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 66 | DEVICE_UNREACHABLE = 5;
|
Girish Gowdra | 997432d | 2022-03-10 15:59:33 -0800 | [diff] [blame] | 67 | SET_UNSUPPORTED = 6;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 68 | }
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 69 | Status status = 1;
|
| 70 | Reason reason = 2;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 71 | string reason_detail = 3;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 72 | }
|
| 73 |
|
| 74 | message StartManagingDeviceResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 75 | 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.ghosh | 6bdb0f7 | 2021-06-02 14:42:29 +0200 | [diff] [blame] | 85 | // 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.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 91 | }
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 92 | Status status = 1;
|
| 93 | Reason reason = 2;
|
| 94 | Uuid device_uuid = 3;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 95 | string reason_detail = 4;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 96 | }
|
| 97 |
|
Amit Ghosh | 366228e | 2020-07-06 13:46:42 +0100 | [diff] [blame] | 98 | message StopManagingDeviceRequest {
|
| 99 | string name = 1;
|
| 100 | }
|
| 101 |
|
| 102 | message StopManagingDeviceResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 103 | // 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.ghosh | 0c68741 | 2021-03-24 19:01:08 +0100 | [diff] [blame] | 107 | UNKNOWN_DEVICE = 1;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 108 | }
|
Amit Ghosh | 366228e | 2020-07-06 13:46:42 +0100 | [diff] [blame] | 109 | Status status = 1;
|
| 110 | Reason reason = 2;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 111 | string reason_detail = 3;
|
Amit Ghosh | 366228e | 2020-07-06 13:46:42 +0100 | [diff] [blame] | 112 | }
|
| 113 |
|
amit.ghosh | 0c68741 | 2021-03-24 19:01:08 +0100 | [diff] [blame] | 114 | message ManagedDeviceInfo {
|
| 115 | ModifiableComponent info = 1;
|
| 116 | Uuid device_uuid = 2;
|
| 117 | }
|
| 118 |
|
Andrea Campanella | cb990bc | 2020-09-22 12:50:56 +0200 | [diff] [blame] | 119 | message ManagedDevicesResponse {
|
amit.ghosh | 0c68741 | 2021-03-24 19:01:08 +0100 | [diff] [blame] | 120 | 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 Campanella | cb990bc | 2020-09-22 12:50:56 +0200 | [diff] [blame] | 127 | }
|
| 128 |
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 129 | message SetLoggingEndpointRequest {
|
| 130 | Uuid device_uuid = 1;
|
| 131 | string logging_endpoint = 2;
|
| 132 | string logging_protocol = 3;
|
| 133 | }
|
| 134 |
|
| 135 | message SetRemoteEndpointResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 136 | 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.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 143 | DEVICE_UNREACHABLE = 6;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 144 | }
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 145 | Status status = 1;
|
| 146 | Reason reason = 2;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 147 | string reason_detail = 3;
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 148 | }
|
| 149 |
|
| 150 | message GetLoggingEndpointResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 151 | enum Reason {
|
| 152 | UNDEFINED_REASON = 0;
|
| 153 | UNKNOWN_DEVICE = 1;
|
| 154 | INTERNAL_ERROR = 2;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 155 | DEVICE_UNREACHABLE = 3;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 156 | }
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 157 | Status status = 1;
|
| 158 | Reason reason = 2;
|
| 159 | string logging_endpoint = 3;
|
| 160 | string logging_protocol = 4;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 161 | string reason_detail = 5;
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 162 | }
|
| 163 |
|
| 164 | message SetMsgBusEndpointRequest {
|
| 165 | string msgbus_endpoint = 1;
|
| 166 | }
|
| 167 |
|
| 168 | message GetMsgBusEndpointResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 169 | enum Reason {
|
| 170 | UNDEFINED_REASON = 0;
|
| 171 | INTERNAL_ERROR = 1;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 172 | DEVICE_UNREACHABLE = 2;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 173 | }
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 174 | Status status = 1;
|
| 175 | Reason reason = 2;
|
| 176 | string msgbus_endpoint = 3;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 177 | string reason_detail = 4;
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 178 | }
|
| 179 |
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 180 | message EntitiesLogLevel {
|
| 181 | LogLevel logLevel = 1;
|
| 182 | repeated string entities = 2;
|
| 183 | }
|
| 184 |
|
| 185 | message SetLogLevelRequest {
|
| 186 | Uuid device_uuid = 1;
|
| 187 | repeated EntitiesLogLevel loglevels = 2;
|
| 188 | }
|
| 189 |
|
| 190 | message SetLogLevelResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 191 | enum Reason {
|
| 192 | UNDEFINED_REASON = 0;
|
| 193 | UNKNOWN_DEVICE = 1;
|
| 194 | INTERNAL_ERROR = 2;
|
| 195 | UNKNOWN_LOG_ENTITY = 3;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 196 | DEVICE_UNREACHABLE = 4;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 197 | }
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 198 | Uuid device_uuid = 1;
|
| 199 | Status status = 2;
|
| 200 | Reason reason = 3;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 201 | string reason_detail = 4;
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 202 | }
|
| 203 |
|
| 204 | message GetLogLevelRequest {
|
| 205 | Uuid device_uuid = 1;
|
| 206 | repeated string entities = 2;
|
| 207 | }
|
| 208 |
|
| 209 | message GetLogLevelResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 210 | enum Reason {
|
| 211 | UNDEFINED_REASON = 0;
|
| 212 | UNKNOWN_DEVICE = 1;
|
| 213 | INTERNAL_ERROR = 2;
|
| 214 | UNKNOWN_LOG_ENTITY = 3;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 215 | DEVICE_UNREACHABLE = 4;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 216 | }
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 217 | Uuid device_uuid = 1;
|
| 218 | repeated EntitiesLogLevel logLevels = 2;
|
| 219 | Status status = 3;
|
| 220 | Reason reason = 4;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 221 | string reason_detail = 5;
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 222 | }
|
| 223 |
|
| 224 | message GetLoggableEntitiesRequest {
|
| 225 | Uuid device_uuid = 1;
|
| 226 | }
|
| 227 |
|
Chandrakanth Nalkudre Gowda | 415b83c | 2021-04-28 18:01:29 +0530 | [diff] [blame] | 228 | message Heartbeat {
|
| 229 | fixed32 heartbeat_signature = 1;
|
| 230 | }
|
| 231 |
|
Chandrakanth Nalkudre Gowda | 2f6066c | 2021-05-13 12:36:32 +0530 | [diff] [blame] | 232 | message RebootDeviceRequest {
|
| 233 | Uuid device_uuid = 1;
|
| 234 | }
|
| 235 |
|
| 236 | message RebootDeviceResponse {
|
| 237 | enum Reason {
|
| 238 | UNDEFINED_REASON = 0;
|
| 239 | UNKNOWN_DEVICE = 1;
|
| 240 | INTERNAL_ERROR = 2;
|
| 241 | DEVICE_UNREACHABLE = 3;
|
| 242 | }
|
| 243 | Status status = 3;
|
| 244 | Reason reason = 4;
|
| 245 | string reason_detail = 5;
|
| 246 | }
|
| 247 |
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 248 | service NativeHWManagementService {
|
| 249 | // Initializes context for a device and sets up required states
|
Amit Ghosh | 704462f | 2020-06-24 16:44:56 +0100 | [diff] [blame] | 250 | // In the call to StartManagingDevice, the fields of ModifiableComponent which are relevant
|
| 251 | // and their meanings in this context is mentioned below:
|
| 252 | // name = The unique name that needs to be assigned to this hardware;
|
| 253 | // class = COMPONENT_TYPE_UNDEFINED;
|
| 254 | // parent = nil;
|
| 255 | // alias = Optional;
|
| 256 | // asset_id = Optional;
|
| 257 | // uri = IP Address of the Hardware;
|
| 258 | rpc StartManagingDevice(ModifiableComponent) returns(stream StartManagingDeviceResponse);
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 259 |
|
Amit Ghosh | 366228e | 2020-07-06 13:46:42 +0100 | [diff] [blame] | 260 | // Stop management of a device and clean up any context and caches for that device
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 261 | // This rpc can be called at any time, even before the StartManagingDevice operation
|
| 262 | // has completed, and should be able to cleanup.
|
Amit Ghosh | 366228e | 2020-07-06 13:46:42 +0100 | [diff] [blame] | 263 | rpc StopManagingDevice(StopManagingDeviceRequest) returns(StopManagingDeviceResponse);
|
| 264 |
|
Andrea Campanella | cb990bc | 2020-09-22 12:50:56 +0200 | [diff] [blame] | 265 | // Returns an object containing a list of devices managed by this entity
|
| 266 | rpc GetManagedDevices(google.protobuf.Empty) returns(ManagedDevicesResponse);
|
| 267 |
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 268 | // Get the HW inventory details of the Device
|
| 269 | rpc GetPhysicalInventory(PhysicalInventoryRequest) returns(stream PhysicalInventoryResponse);
|
| 270 |
|
| 271 | // Get the details of a particular HW component
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 272 | rpc GetHWComponentInfo(HWComponentInfoGetRequest) returns(stream HWComponentInfoGetResponse);
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 273 |
|
| 274 | // Sets the permissible attributes of a HW component
|
| 275 | rpc SetHWComponentInfo(HWComponentInfoSetRequest) returns(HWComponentInfoSetResponse);
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 276 |
|
| 277 | // Sets the location to which logs need to be shipped
|
| 278 | rpc SetLoggingEndpoint(SetLoggingEndpointRequest) returns(SetRemoteEndpointResponse);
|
| 279 |
|
| 280 | // Gets the configured location to which the logs are being shipped
|
amit.ghosh | 5d97dba | 2020-11-12 16:45:27 +0100 | [diff] [blame] | 281 | rpc GetLoggingEndpoint(HardwareID) returns(GetLoggingEndpointResponse);
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 282 |
|
| 283 | // Sets the location of the Message Bus to which events and metrics are shipped
|
| 284 | rpc SetMsgBusEndpoint(SetMsgBusEndpointRequest) returns(SetRemoteEndpointResponse);
|
| 285 |
|
| 286 | // Gets the configured location to which the events and metrics are being shipped
|
| 287 | rpc GetMsgBusEndpoint(google.protobuf.Empty) returns(GetMsgBusEndpointResponse);
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 288 |
|
| 289 | // Gets the entities of a device on which log can be configured. A few are expected, like OS, PON Management etc.
|
| 290 | // In general an entity is any item within an hardware system that can emit logs, e.g. service, process, subsystem,
|
| 291 | // interface, package etc.
|
| 292 | rpc GetLoggableEntities(GetLoggableEntitiesRequest) returns(GetLogLevelResponse);
|
| 293 |
|
amit.ghosh | 5d97dba | 2020-11-12 16:45:27 +0100 | [diff] [blame] | 294 | // Sets the log level of the device, for each given entity to a certain level.
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 295 | // If only one EntitiesLogLevel is provided for the device and that request contains only a log level with
|
| 296 | // no entity in the list it's assumed that the caller wants to set that level for all the entities.
|
| 297 | rpc SetLogLevel(SetLogLevelRequest) returns(SetLogLevelResponse);
|
| 298 |
|
| 299 | // Gets the configured log level for a certain entity on a certain device.
|
| 300 | // If no entity is specified in the request all the entities with their log level should be returned.
|
| 301 | rpc GetLogLevel(GetLogLevelRequest) returns(GetLogLevelResponse);
|
Chandrakanth Nalkudre Gowda | 415b83c | 2021-04-28 18:01:29 +0530 | [diff] [blame] | 302 |
|
| 303 | // Performs the heartbeat check
|
| 304 | rpc HeartbeatCheck(google.protobuf.Empty) returns (Heartbeat);
|
Chandrakanth Nalkudre Gowda | 2f6066c | 2021-05-13 12:36:32 +0530 | [diff] [blame] | 305 |
|
| 306 | // Performs the reboot of the device
|
| 307 | rpc RebootDevice(RebootDeviceRequest) returns(RebootDeviceResponse);
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 308 | }
|