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;
|
| 26 | }
|
| 27 |
|
| 28 | message HWComponentInfoGetRequest {
|
| 29 | Uuid device_uuid = 1;
|
| 30 | Uuid component_uuid = 2;
|
| 31 | string component_name = 3;
|
| 32 | }
|
| 33 |
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 34 | message HWComponentInfoGetResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 35 | enum Reason {
|
| 36 | UNDEFINED_REASON = 0;
|
| 37 | UNKNOWN_DEVICE = 1;
|
| 38 | UNKNOWN_COMPONENT = 2;
|
| 39 | INTERNAL_ERROR = 3;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame^] | 40 | DEVICE_UNREACHABLE = 4;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 41 | }
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 42 | Status status = 1;
|
| 43 | Reason reason = 2;
|
| 44 | Component component = 3;
|
| 45 | }
|
| 46 |
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 47 | message HWComponentInfoSetRequest {
|
| 48 | Uuid device_uuid = 1;
|
| 49 | Uuid component_uuid = 2;
|
| 50 | string component_name = 3;
|
| 51 | ModifiableComponent changes = 4;
|
| 52 | }
|
| 53 |
|
| 54 | message HWComponentInfoSetResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 55 | enum Reason {
|
| 56 | UNDEFINED_REASON = 0;
|
| 57 | UNKNOWN_DEVICE = 1;
|
| 58 | UNKNOWN_COMPONENT = 2;
|
| 59 | INVALID_PARAMS = 3;
|
| 60 | INTERNAL_ERROR = 4;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame^] | 61 | DEVICE_UNREACHABLE = 5;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 62 | }
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 63 | Status status = 1;
|
| 64 | Reason reason = 2;
|
| 65 | }
|
| 66 |
|
| 67 | message StartManagingDeviceResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 68 | 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 Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 79 | Status status = 1;
|
| 80 | Reason reason = 2;
|
| 81 | Uuid device_uuid = 3;
|
| 82 | }
|
| 83 |
|
Amit Ghosh | 366228e | 2020-07-06 13:46:42 +0100 | [diff] [blame] | 84 | message StopManagingDeviceRequest {
|
| 85 | string name = 1;
|
| 86 | }
|
| 87 |
|
| 88 | message StopManagingDeviceResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 89 | // 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 Ghosh | 366228e | 2020-07-06 13:46:42 +0100 | [diff] [blame] | 95 | Status status = 1;
|
| 96 | Reason reason = 2;
|
| 97 | }
|
| 98 |
|
Andrea Campanella | cb990bc | 2020-09-22 12:50:56 +0200 | [diff] [blame] | 99 | message ManagedDevicesResponse {
|
| 100 | repeated ModifiableComponent devices = 1;
|
| 101 | }
|
| 102 |
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 103 | message SetLoggingEndpointRequest {
|
| 104 | Uuid device_uuid = 1;
|
| 105 | string logging_endpoint = 2;
|
| 106 | string logging_protocol = 3;
|
| 107 | }
|
| 108 |
|
| 109 | message SetRemoteEndpointResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 110 | 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.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame^] | 117 | DEVICE_UNREACHABLE = 6;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 118 | }
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 119 | Status status = 1;
|
| 120 | Reason reason = 2;
|
| 121 | }
|
| 122 |
|
| 123 | message GetLoggingEndpointResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 124 | enum Reason {
|
| 125 | UNDEFINED_REASON = 0;
|
| 126 | UNKNOWN_DEVICE = 1;
|
| 127 | INTERNAL_ERROR = 2;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame^] | 128 | DEVICE_UNREACHABLE = 3;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 129 | }
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 130 | Status status = 1;
|
| 131 | Reason reason = 2;
|
| 132 | string logging_endpoint = 3;
|
| 133 | string logging_protocol = 4;
|
| 134 | }
|
| 135 |
|
| 136 | message SetMsgBusEndpointRequest {
|
| 137 | string msgbus_endpoint = 1;
|
| 138 | }
|
| 139 |
|
| 140 | message GetMsgBusEndpointResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 141 | enum Reason {
|
| 142 | UNDEFINED_REASON = 0;
|
| 143 | INTERNAL_ERROR = 1;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame^] | 144 | DEVICE_UNREACHABLE = 2;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 145 | }
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 146 | Status status = 1;
|
| 147 | Reason reason = 2;
|
| 148 | string msgbus_endpoint = 3;
|
| 149 | }
|
| 150 |
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 151 | message EntitiesLogLevel {
|
| 152 | LogLevel logLevel = 1;
|
| 153 | repeated string entities = 2;
|
| 154 | }
|
| 155 |
|
| 156 | message SetLogLevelRequest {
|
| 157 | Uuid device_uuid = 1;
|
| 158 | repeated EntitiesLogLevel loglevels = 2;
|
| 159 | }
|
| 160 |
|
| 161 | message SetLogLevelResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 162 | enum Reason {
|
| 163 | UNDEFINED_REASON = 0;
|
| 164 | UNKNOWN_DEVICE = 1;
|
| 165 | INTERNAL_ERROR = 2;
|
| 166 | UNKNOWN_LOG_ENTITY = 3;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame^] | 167 | DEVICE_UNREACHABLE = 4;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 168 | }
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 169 | Uuid device_uuid = 1;
|
| 170 | Status status = 2;
|
| 171 | Reason reason = 3;
|
| 172 | }
|
| 173 |
|
| 174 | message GetLogLevelRequest {
|
| 175 | Uuid device_uuid = 1;
|
| 176 | repeated string entities = 2;
|
| 177 | }
|
| 178 |
|
| 179 | message GetLogLevelResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 180 | enum Reason {
|
| 181 | UNDEFINED_REASON = 0;
|
| 182 | UNKNOWN_DEVICE = 1;
|
| 183 | INTERNAL_ERROR = 2;
|
| 184 | UNKNOWN_LOG_ENTITY = 3;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame^] | 185 | DEVICE_UNREACHABLE = 4;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 186 | }
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 187 | Uuid device_uuid = 1;
|
| 188 | repeated EntitiesLogLevel logLevels = 2;
|
| 189 | Status status = 3;
|
| 190 | Reason reason = 4;
|
| 191 | }
|
| 192 |
|
| 193 | message GetLoggableEntitiesRequest {
|
| 194 | Uuid device_uuid = 1;
|
| 195 | }
|
| 196 |
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 197 | service NativeHWManagementService {
|
| 198 | // Initializes context for a device and sets up required states
|
Amit Ghosh | 704462f | 2020-06-24 16:44:56 +0100 | [diff] [blame] | 199 | // 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 Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 208 |
|
Amit Ghosh | 366228e | 2020-07-06 13:46:42 +0100 | [diff] [blame] | 209 | // 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] | 210 | // This rpc can be called at any time, even before the StartManagingDevice operation
|
| 211 | // has completed, and should be able to cleanup.
|
Amit Ghosh | 366228e | 2020-07-06 13:46:42 +0100 | [diff] [blame] | 212 | rpc StopManagingDevice(StopManagingDeviceRequest) returns(StopManagingDeviceResponse);
|
| 213 |
|
Andrea Campanella | cb990bc | 2020-09-22 12:50:56 +0200 | [diff] [blame] | 214 | // Returns an object containing a list of devices managed by this entity
|
| 215 | rpc GetManagedDevices(google.protobuf.Empty) returns(ManagedDevicesResponse);
|
| 216 |
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 217 | // 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
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 221 | rpc GetHWComponentInfo(HWComponentInfoGetRequest) returns(stream HWComponentInfoGetResponse);
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 222 |
|
| 223 | // Sets the permissible attributes of a HW component
|
| 224 | rpc SetHWComponentInfo(HWComponentInfoSetRequest) returns(HWComponentInfoSetResponse);
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 225 |
|
| 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.ghosh | 5d97dba | 2020-11-12 16:45:27 +0100 | [diff] [blame] | 230 | rpc GetLoggingEndpoint(HardwareID) returns(GetLoggingEndpointResponse);
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 231 |
|
| 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 Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 237 |
|
| 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.ghosh | 5d97dba | 2020-11-12 16:45:27 +0100 | [diff] [blame] | 243 | // 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] | 244 | // 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 Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 251 | }
|