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 {
|
| 17 | Status status = 1;
|
| 18 | Reason reason = 2;
|
| 19 | Hardware inventory = 3;
|
| 20 | }
|
| 21 |
|
| 22 | message HWComponentInfoGetRequest {
|
| 23 | Uuid device_uuid = 1;
|
| 24 | Uuid component_uuid = 2;
|
| 25 | string component_name = 3;
|
| 26 | }
|
| 27 |
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 28 | message HWComponentInfoGetResponse {
|
| 29 | Status status = 1;
|
| 30 | Reason reason = 2;
|
| 31 | Component component = 3;
|
| 32 | }
|
| 33 |
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 34 | message HWComponentInfoSetRequest {
|
| 35 | Uuid device_uuid = 1;
|
| 36 | Uuid component_uuid = 2;
|
| 37 | string component_name = 3;
|
| 38 | ModifiableComponent changes = 4;
|
| 39 | }
|
| 40 |
|
| 41 | message HWComponentInfoSetResponse {
|
| 42 | Status status = 1;
|
| 43 | Reason reason = 2;
|
| 44 | }
|
| 45 |
|
| 46 | message StartManagingDeviceResponse {
|
| 47 | Status status = 1;
|
| 48 | Reason reason = 2;
|
| 49 | Uuid device_uuid = 3;
|
| 50 | }
|
| 51 |
|
Amit Ghosh | 366228e | 2020-07-06 13:46:42 +0100 | [diff] [blame] | 52 | message StopManagingDeviceRequest {
|
| 53 | string name = 1;
|
| 54 | }
|
| 55 |
|
| 56 | message StopManagingDeviceResponse {
|
| 57 | Status status = 1;
|
| 58 | Reason reason = 2;
|
| 59 | }
|
| 60 |
|
Andrea Campanella | cb990bc | 2020-09-22 12:50:56 +0200 | [diff] [blame] | 61 | message ManagedDevicesResponse {
|
| 62 | repeated ModifiableComponent devices = 1;
|
| 63 | }
|
| 64 |
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 65 | message SetLoggingEndpointRequest {
|
| 66 | Uuid device_uuid = 1;
|
| 67 | string logging_endpoint = 2;
|
| 68 | string logging_protocol = 3;
|
| 69 | }
|
| 70 |
|
| 71 | message SetRemoteEndpointResponse {
|
| 72 | Status status = 1;
|
| 73 | Reason reason = 2;
|
| 74 | }
|
| 75 |
|
| 76 | message GetLoggingEndpointResponse {
|
| 77 | Status status = 1;
|
| 78 | Reason reason = 2;
|
| 79 | string logging_endpoint = 3;
|
| 80 | string logging_protocol = 4;
|
| 81 | }
|
| 82 |
|
| 83 | message SetMsgBusEndpointRequest {
|
| 84 | string msgbus_endpoint = 1;
|
| 85 | }
|
| 86 |
|
| 87 | message GetMsgBusEndpointResponse {
|
| 88 | Status status = 1;
|
| 89 | Reason reason = 2;
|
| 90 | string msgbus_endpoint = 3;
|
| 91 | }
|
| 92 |
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 93 | message EntitiesLogLevel {
|
| 94 | LogLevel logLevel = 1;
|
| 95 | repeated string entities = 2;
|
| 96 | }
|
| 97 |
|
| 98 | message SetLogLevelRequest {
|
| 99 | Uuid device_uuid = 1;
|
| 100 | repeated EntitiesLogLevel loglevels = 2;
|
| 101 | }
|
| 102 |
|
| 103 | message SetLogLevelResponse {
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 104 | Uuid device_uuid = 1;
|
| 105 | Status status = 2;
|
| 106 | Reason reason = 3;
|
| 107 | }
|
| 108 |
|
| 109 | message GetLogLevelRequest {
|
| 110 | Uuid device_uuid = 1;
|
| 111 | repeated string entities = 2;
|
| 112 | }
|
| 113 |
|
| 114 | message GetLogLevelResponse {
|
| 115 | Uuid device_uuid = 1;
|
| 116 | repeated EntitiesLogLevel logLevels = 2;
|
| 117 | Status status = 3;
|
| 118 | Reason reason = 4;
|
| 119 | }
|
| 120 |
|
| 121 | message GetLoggableEntitiesRequest {
|
| 122 | Uuid device_uuid = 1;
|
| 123 | }
|
| 124 |
|
| 125 |
|
| 126 |
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 127 | service NativeHWManagementService {
|
| 128 | // Initializes context for a device and sets up required states
|
Amit Ghosh | 704462f | 2020-06-24 16:44:56 +0100 | [diff] [blame] | 129 | // In the call to StartManagingDevice, the fields of ModifiableComponent which are relevant
|
| 130 | // and their meanings in this context is mentioned below:
|
| 131 | // name = The unique name that needs to be assigned to this hardware;
|
| 132 | // class = COMPONENT_TYPE_UNDEFINED;
|
| 133 | // parent = nil;
|
| 134 | // alias = Optional;
|
| 135 | // asset_id = Optional;
|
| 136 | // uri = IP Address of the Hardware;
|
| 137 | rpc StartManagingDevice(ModifiableComponent) returns(stream StartManagingDeviceResponse);
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 138 |
|
Amit Ghosh | 366228e | 2020-07-06 13:46:42 +0100 | [diff] [blame] | 139 | // Stop management of a device and clean up any context and caches for that device
|
| 140 | rpc StopManagingDevice(StopManagingDeviceRequest) returns(StopManagingDeviceResponse);
|
| 141 |
|
Andrea Campanella | cb990bc | 2020-09-22 12:50:56 +0200 | [diff] [blame] | 142 | // Returns an object containing a list of devices managed by this entity
|
| 143 | rpc GetManagedDevices(google.protobuf.Empty) returns(ManagedDevicesResponse);
|
| 144 |
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 145 | // Get the HW inventory details of the Device
|
| 146 | rpc GetPhysicalInventory(PhysicalInventoryRequest) returns(stream PhysicalInventoryResponse);
|
| 147 |
|
| 148 | // Get the details of a particular HW component
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 149 | rpc GetHWComponentInfo(HWComponentInfoGetRequest) returns(stream HWComponentInfoGetResponse);
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 150 |
|
| 151 | // Sets the permissible attributes of a HW component
|
| 152 | rpc SetHWComponentInfo(HWComponentInfoSetRequest) returns(HWComponentInfoSetResponse);
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 153 |
|
| 154 | // Sets the location to which logs need to be shipped
|
| 155 | rpc SetLoggingEndpoint(SetLoggingEndpointRequest) returns(SetRemoteEndpointResponse);
|
| 156 |
|
| 157 | // Gets the configured location to which the logs are being shipped
|
amit.ghosh | 5d97dba | 2020-11-12 16:45:27 +0100 | [diff] [blame] | 158 | rpc GetLoggingEndpoint(HardwareID) returns(GetLoggingEndpointResponse);
|
amit.ghosh | 188a84f | 2020-09-27 20:59:25 +0200 | [diff] [blame] | 159 |
|
| 160 | // Sets the location of the Message Bus to which events and metrics are shipped
|
| 161 | rpc SetMsgBusEndpoint(SetMsgBusEndpointRequest) returns(SetRemoteEndpointResponse);
|
| 162 |
|
| 163 | // Gets the configured location to which the events and metrics are being shipped
|
| 164 | rpc GetMsgBusEndpoint(google.protobuf.Empty) returns(GetMsgBusEndpointResponse);
|
Andrea Campanella | b91e9a4 | 2020-10-09 14:31:43 +0200 | [diff] [blame] | 165 |
|
| 166 | // Gets the entities of a device on which log can be configured. A few are expected, like OS, PON Management etc.
|
| 167 | // In general an entity is any item within an hardware system that can emit logs, e.g. service, process, subsystem,
|
| 168 | // interface, package etc.
|
| 169 | rpc GetLoggableEntities(GetLoggableEntitiesRequest) returns(GetLogLevelResponse);
|
| 170 |
|
amit.ghosh | 5d97dba | 2020-11-12 16:45:27 +0100 | [diff] [blame] | 171 | // 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] | 172 | // If only one EntitiesLogLevel is provided for the device and that request contains only a log level with
|
| 173 | // no entity in the list it's assumed that the caller wants to set that level for all the entities.
|
| 174 | rpc SetLogLevel(SetLogLevelRequest) returns(SetLogLevelResponse);
|
| 175 |
|
| 176 | // Gets the configured log level for a certain entity on a certain device.
|
| 177 | // If no entity is specified in the request all the entities with their log level should be returned.
|
| 178 | rpc GetLogLevel(GetLogLevelRequest) returns(GetLogLevelResponse);
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 179 | }
|