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;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 67 | }
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 68 | Status status = 1;
|
| 69 | Reason reason = 2;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 70 | string reason_detail = 3;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 71 | }
|
| 72 |
|
| 73 | message StartManagingDeviceResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 74 | 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 Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 85 | Status status = 1;
|
| 86 | Reason reason = 2;
|
| 87 | Uuid device_uuid = 3;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 88 | string reason_detail = 4;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 89 | }
|
| 90 |
|
Amit Ghosh | 366228e | 2020-07-06 13:46:42 +0100 | [diff] [blame] | 91 | message StopManagingDeviceRequest {
|
| 92 | string name = 1;
|
| 93 | }
|
| 94 |
|
| 95 | message StopManagingDeviceResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 96 | // 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;
|
amit.ghosh | 0c68741 | 2021-03-24 19:01:08 +0100 | [diff] [blame^] | 100 | UNKNOWN_DEVICE = 1;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 101 | }
|
Amit Ghosh | 366228e | 2020-07-06 13:46:42 +0100 | [diff] [blame] | 102 | Status status = 1;
|
| 103 | Reason reason = 2;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 104 | string reason_detail = 3;
|
Amit Ghosh | 366228e | 2020-07-06 13:46:42 +0100 | [diff] [blame] | 105 | }
|
| 106 |
|
amit.ghosh | 0c68741 | 2021-03-24 19:01:08 +0100 | [diff] [blame^] | 107 | message ManagedDeviceInfo {
|
| 108 | ModifiableComponent info = 1;
|
| 109 | Uuid device_uuid = 2;
|
| 110 | }
|
| 111 |
|
Andrea Campanella | cb990bc | 2020-09-22 12:50:56 +0200 | [diff] [blame] | 112 | message ManagedDevicesResponse {
|
amit.ghosh | 0c68741 | 2021-03-24 19:01:08 +0100 | [diff] [blame^] | 113 | enum Reason {
|
| 114 | UNDEFINED_REASON = 0;
|
| 115 | INTERNAL_ERROR = 1;
|
| 116 | }
|
| 117 | Status status = 1;
|
| 118 | Reason reason = 2;
|
| 119 | repeated ManagedDeviceInfo devices = 3;
|
Andrea Campanella | cb990bc | 2020-09-22 12:50:56 +0200 | [diff] [blame] | 120 | }
|
| 121 |
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 122 | message SetLoggingEndpointRequest {
|
| 123 | Uuid device_uuid = 1;
|
| 124 | string logging_endpoint = 2;
|
| 125 | string logging_protocol = 3;
|
| 126 | }
|
| 127 |
|
| 128 | message SetRemoteEndpointResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 129 | enum Reason {
|
| 130 | UNDEFINED_REASON = 0;
|
| 131 | UNKNOWN_DEVICE = 1;
|
| 132 | INTERNAL_ERROR = 2;
|
| 133 | LOGGING_ENDPOINT_ERROR = 3;
|
| 134 | LOGGING_ENDPOINT_PROTOCOL_ERROR = 4;
|
| 135 | MSGBUS_ENDPOINT_ERROR = 5;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 136 | DEVICE_UNREACHABLE = 6;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 137 | }
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 138 | Status status = 1;
|
| 139 | Reason reason = 2;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 140 | string reason_detail = 3;
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 141 | }
|
| 142 |
|
| 143 | message GetLoggingEndpointResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 144 | enum Reason {
|
| 145 | UNDEFINED_REASON = 0;
|
| 146 | UNKNOWN_DEVICE = 1;
|
| 147 | INTERNAL_ERROR = 2;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 148 | DEVICE_UNREACHABLE = 3;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 149 | }
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 150 | Status status = 1;
|
| 151 | Reason reason = 2;
|
| 152 | string logging_endpoint = 3;
|
| 153 | string logging_protocol = 4;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 154 | string reason_detail = 5;
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 155 | }
|
| 156 |
|
| 157 | message SetMsgBusEndpointRequest {
|
| 158 | string msgbus_endpoint = 1;
|
| 159 | }
|
| 160 |
|
| 161 | message GetMsgBusEndpointResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 162 | enum Reason {
|
| 163 | UNDEFINED_REASON = 0;
|
| 164 | INTERNAL_ERROR = 1;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 165 | DEVICE_UNREACHABLE = 2;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 166 | }
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 167 | Status status = 1;
|
| 168 | Reason reason = 2;
|
| 169 | string msgbus_endpoint = 3;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 170 | string reason_detail = 4;
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 171 | }
|
| 172 |
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 173 | message EntitiesLogLevel {
|
| 174 | LogLevel logLevel = 1;
|
| 175 | repeated string entities = 2;
|
| 176 | }
|
| 177 |
|
| 178 | message SetLogLevelRequest {
|
| 179 | Uuid device_uuid = 1;
|
| 180 | repeated EntitiesLogLevel loglevels = 2;
|
| 181 | }
|
| 182 |
|
| 183 | message SetLogLevelResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 184 | enum Reason {
|
| 185 | UNDEFINED_REASON = 0;
|
| 186 | UNKNOWN_DEVICE = 1;
|
| 187 | INTERNAL_ERROR = 2;
|
| 188 | UNKNOWN_LOG_ENTITY = 3;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 189 | DEVICE_UNREACHABLE = 4;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 190 | }
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 191 | Uuid device_uuid = 1;
|
| 192 | Status status = 2;
|
| 193 | Reason reason = 3;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 194 | string reason_detail = 4;
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 195 | }
|
| 196 |
|
| 197 | message GetLogLevelRequest {
|
| 198 | Uuid device_uuid = 1;
|
| 199 | repeated string entities = 2;
|
| 200 | }
|
| 201 |
|
| 202 | message GetLogLevelResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 203 | enum Reason {
|
| 204 | UNDEFINED_REASON = 0;
|
| 205 | UNKNOWN_DEVICE = 1;
|
| 206 | INTERNAL_ERROR = 2;
|
| 207 | UNKNOWN_LOG_ENTITY = 3;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 208 | DEVICE_UNREACHABLE = 4;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 209 | }
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 210 | Uuid device_uuid = 1;
|
| 211 | repeated EntitiesLogLevel logLevels = 2;
|
| 212 | Status status = 3;
|
| 213 | Reason reason = 4;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 214 | string reason_detail = 5;
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 215 | }
|
| 216 |
|
| 217 | message GetLoggableEntitiesRequest {
|
| 218 | Uuid device_uuid = 1;
|
| 219 | }
|
| 220 |
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 221 | service NativeHWManagementService {
|
| 222 | // Initializes context for a device and sets up required states
|
Amit Ghosh | 704462f | 2020-06-24 16:44:56 +0100 | [diff] [blame] | 223 | // In the call to StartManagingDevice, the fields of ModifiableComponent which are relevant
|
| 224 | // and their meanings in this context is mentioned below:
|
| 225 | // name = The unique name that needs to be assigned to this hardware;
|
| 226 | // class = COMPONENT_TYPE_UNDEFINED;
|
| 227 | // parent = nil;
|
| 228 | // alias = Optional;
|
| 229 | // asset_id = Optional;
|
| 230 | // uri = IP Address of the Hardware;
|
| 231 | rpc StartManagingDevice(ModifiableComponent) returns(stream StartManagingDeviceResponse);
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 232 |
|
Amit Ghosh | 366228e | 2020-07-06 13:46:42 +0100 | [diff] [blame] | 233 | // 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] | 234 | // This rpc can be called at any time, even before the StartManagingDevice operation
|
| 235 | // has completed, and should be able to cleanup.
|
Amit Ghosh | 366228e | 2020-07-06 13:46:42 +0100 | [diff] [blame] | 236 | rpc StopManagingDevice(StopManagingDeviceRequest) returns(StopManagingDeviceResponse);
|
| 237 |
|
Andrea Campanella | cb990bc | 2020-09-22 12:50:56 +0200 | [diff] [blame] | 238 | // Returns an object containing a list of devices managed by this entity
|
| 239 | rpc GetManagedDevices(google.protobuf.Empty) returns(ManagedDevicesResponse);
|
| 240 |
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 241 | // Get the HW inventory details of the Device
|
| 242 | rpc GetPhysicalInventory(PhysicalInventoryRequest) returns(stream PhysicalInventoryResponse);
|
| 243 |
|
| 244 | // Get the details of a particular HW component
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 245 | rpc GetHWComponentInfo(HWComponentInfoGetRequest) returns(stream HWComponentInfoGetResponse);
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 246 |
|
| 247 | // Sets the permissible attributes of a HW component
|
| 248 | rpc SetHWComponentInfo(HWComponentInfoSetRequest) returns(HWComponentInfoSetResponse);
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 249 |
|
| 250 | // Sets the location to which logs need to be shipped
|
| 251 | rpc SetLoggingEndpoint(SetLoggingEndpointRequest) returns(SetRemoteEndpointResponse);
|
| 252 |
|
| 253 | // Gets the configured location to which the logs are being shipped
|
amit.ghosh | 5d97dba | 2020-11-12 16:45:27 +0100 | [diff] [blame] | 254 | rpc GetLoggingEndpoint(HardwareID) returns(GetLoggingEndpointResponse);
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 255 |
|
| 256 | // Sets the location of the Message Bus to which events and metrics are shipped
|
| 257 | rpc SetMsgBusEndpoint(SetMsgBusEndpointRequest) returns(SetRemoteEndpointResponse);
|
| 258 |
|
| 259 | // Gets the configured location to which the events and metrics are being shipped
|
| 260 | rpc GetMsgBusEndpoint(google.protobuf.Empty) returns(GetMsgBusEndpointResponse);
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 261 |
|
| 262 | // Gets the entities of a device on which log can be configured. A few are expected, like OS, PON Management etc.
|
| 263 | // In general an entity is any item within an hardware system that can emit logs, e.g. service, process, subsystem,
|
| 264 | // interface, package etc.
|
| 265 | rpc GetLoggableEntities(GetLoggableEntitiesRequest) returns(GetLogLevelResponse);
|
| 266 |
|
amit.ghosh | 5d97dba | 2020-11-12 16:45:27 +0100 | [diff] [blame] | 267 | // 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] | 268 | // If only one EntitiesLogLevel is provided for the device and that request contains only a log level with
|
| 269 | // no entity in the list it's assumed that the caller wants to set that level for all the entities.
|
| 270 | rpc SetLogLevel(SetLogLevelRequest) returns(SetLogLevelResponse);
|
| 271 |
|
| 272 | // Gets the configured log level for a certain entity on a certain device.
|
| 273 | // If no entity is specified in the request all the entities with their log level should be returned.
|
| 274 | rpc GetLogLevel(GetLogLevelRequest) returns(GetLogLevelResponse);
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 275 | }
|