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