| 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";
|
| 8 | import "google/protobuf/timestamp.proto";
|
| Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 9 | import "google/protobuf/empty.proto";
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 10 |
|
| 11 | // Management of Events and protos for encoding of Events
|
| 12 |
|
| 13 | enum EventIds {
|
| 14 | EVENT_NAME_UNDEFINED = 0;
|
| 15 |
|
| 16 | // Events from the Transceivers
|
| 17 | EVENT_TRANSCEIVER_PLUG_OUT = 100;
|
| 18 | EVENT_TRANSCEIVER_PLUG_IN = 101;
|
| amit.ghosh | 93921ec | 2022-09-08 17:22:40 +0200 | [diff] [blame] | 19 | // The threshold based events on the transceivers should be configured on
|
| 20 | // the port components of that transceiver and not on the transceiver
|
| 21 | // component itself. This is because there could be different thresholds
|
| 22 | // on the different ports of a transceiver (for example for a transceiver of
|
| 23 | // type COMBO_GPON_XGSPON the power thresholds could be different for the
|
| 24 | // GPON and XGSPON ports)
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 25 | EVENT_TRANSCEIVER_VOLTAGE_ABOVE_THRESHOLD = 102;
|
| 26 | EVENT_TRANSCEIVER_VOLTAGE_BELOW_THRESHOLD = 103;
|
| 27 | EVENT_TRANSCEIVER_TEMPERATURE_ABOVE_THRESHOLD = 104;
|
| 28 | EVENT_TRANSCEIVER_TEMPERATURE_BELOW_THRESHOLD = 105;
|
| 29 | EVENT_TRANSCEIVER_CURRENT_ABOVE_THRESHOLD = 106;
|
| 30 | EVENT_TRANSCEIVER_CURRENT_BELOW_THRESHOLD = 107;
|
| 31 | EVENT_TRANSCEIVER_RX_POWER_ABOVE_THRESHOLD = 108;
|
| 32 | EVENT_TRANSCEIVER_RX_POWER_BELOW_THRESHOLD = 109;
|
| 33 | EVENT_TRANSCEIVER_TX_POWER_ABOVE_THRESHOLD = 110;
|
| 34 | EVENT_TRANSCEIVER_TX_POWER_BELOW_THRESHOLD = 111;
|
| 35 | EVENT_TRANSCEIVER_FAILURE = 112;
|
| Amit Ghosh | 9d6658d | 2020-06-25 10:43:30 +0100 | [diff] [blame] | 36 | EVENT_TRANSCEIVER_VOLTAGE_ABOVE_THRESHOLD_RECOVERED = 113;
|
| 37 | EVENT_TRANSCEIVER_VOLTAGE_BELOW_THRESHOLD_RECOVERED = 114;
|
| 38 | EVENT_TRANSCEIVER_TEMPERATURE_ABOVE_THRESHOLD_RECOVERED = 115;
|
| 39 | EVENT_TRANSCEIVER_TEMPERATURE_BELOW_THRESHOLD_RECOVERED = 116;
|
| 40 | EVENT_TRANSCEIVER_CURRENT_ABOVE_THRESHOLD_RECOVERED = 117;
|
| 41 | EVENT_TRANSCEIVER_CURRENT_BELOW_THRESHOLD_RECOVERED = 118;
|
| 42 | EVENT_TRANSCEIVER_RX_POWER_ABOVE_THRESHOLD_RECOVERED = 119;
|
| 43 | EVENT_TRANSCEIVER_RX_POWER_BELOW_THRESHOLD_RECOVERED = 120;
|
| 44 | EVENT_TRANSCEIVER_TX_POWER_ABOVE_THRESHOLD_RECOVERED = 121;
|
| 45 | EVENT_TRANSCEIVER_TX_POWER_BELOW_THRESHOLD_RECOVERED = 122;
|
| 46 | EVENT_TRANSCEIVER_FAILURE_RECOVERED = 123;
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 47 |
|
| 48 | // Events from the PSU
|
| 49 | EVENT_PSU_PLUG_OUT = 200;
|
| 50 | EVENT_PSU_PLUG_IN = 201;
|
| 51 | EVENT_PSU_FAILURE = 202;
|
| Amit Ghosh | 9d6658d | 2020-06-25 10:43:30 +0100 | [diff] [blame] | 52 | EVENT_PSU_FAILURE_RECOVERED = 203;
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 53 |
|
| 54 | // Events for the Fans
|
| 55 | EVENT_FAN_FAILURE = 300;
|
| 56 | EVENT_FAN_PLUG_OUT = 301;
|
| 57 | EVENT_FAN_PLUG_IN = 302;
|
| Amit Ghosh | 9d6658d | 2020-06-25 10:43:30 +0100 | [diff] [blame] | 58 | EVENT_FAN_FAILURE_RECOVERED = 303;
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 59 |
|
| 60 | // Events for the CPUs
|
| 61 | EVENT_CPU_TEMPERATURE_ABOVE_CRITICAL = 400;
|
| 62 | EVENT_CPU_TEMPERATURE_ABOVE_FATAL = 401;
|
| Amit Ghosh | 9d6658d | 2020-06-25 10:43:30 +0100 | [diff] [blame] | 63 | EVENT_CPU_TEMPERATURE_ABOVE_CRITICAL_RECOVERED = 402;
|
| 64 | EVENT_CPU_TEMPERATURE_ABOVE_FATAL_RECOVERED = 403;
|
| amit.ghosh | 06f4978 | 2023-06-15 13:53:51 +0200 | [diff] [blame] | 65 | EVENT_CPU_USAGE_ABOVE_THRESHOLD = 404;
|
| 66 | EVENT_CPU_USAGE_ABOVE_THRESHOLD_RECOVERED = 405;
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 67 |
|
| 68 | // Events for the complete HW Device
|
| 69 | EVENT_HW_DEVICE_RESET = 500;
|
| 70 | EVENT_HW_DEVICE_TEMPERATURE_ABOVE_CRITICAL = 501;
|
| 71 | EVENT_HW_DEVICE_TEMPERATURE_ABOVE_FATAL = 502;
|
| Amit Ghosh | 9d6658d | 2020-06-25 10:43:30 +0100 | [diff] [blame] | 72 | EVENT_HW_DEVICE_TEMPERATURE_ABOVE_CRITICAL_RECOVERED = 503;
|
| 73 | EVENT_HW_DEVICE_TEMPERATURE_ABOVE_FATAL_RECOVERED = 504;
|
| Chandrakanth Nalkudre Gowda | 2f6066c | 2021-05-13 12:36:32 +0530 | [diff] [blame] | 74 | EVENT_HW_DEVICE_REBOOT = 505;
|
| amit.ghosh | 8fe610f | 2022-01-14 17:44:53 +0100 | [diff] [blame] | 75 | EVENT_HW_TEMPERATURE_SENSOR_FAILED = 506;
|
| 76 | EVENT_HW_ALL_TEMPERATURE_SENSORS_FAILED = 507;
|
| amit.ghosh | 06f4978 | 2023-06-15 13:53:51 +0200 | [diff] [blame] | 77 | EVENT_HW_DISK_USAGE_ABOVE_THRESHOLD = 508;
|
| 78 | EVENT_HW_DISK_USAGE_ABOVE_THRESHOLD_RECOVERED = 509;
|
| 79 | EVENT_HW_MEMORY_USAGE_ABOVE_THRESHOLD = 510;
|
| 80 | EVENT_HW_MEMORY_USAGE_ABOVE_THRESHOLD_RECOVERED = 511;
|
| 81 | EVENT_HW_NTP_SYNC_FAILURE = 512;
|
| 82 | EVENT_HW_NTP_SYNC_FAILURE_RECOVERED = 513;
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 83 |
|
| amit.ghosh | c0c3c24 | 2022-03-16 11:00:27 +0100 | [diff] [blame] | 84 | // Events for the line cards on the HW Device
|
| 85 | EVENT_LINE_CARD_PLUG_OUT = 600;
|
| 86 | EVENT_LINE_CARD_PLUG_IN = 601;
|
| 87 |
|
| Amit Ghosh | e45d997 | 2025-06-26 14:52:48 +0200 | [diff] [blame] | 88 | // Indicates that the a state of a component has changed.
|
| 89 | // The StateChangeInfo message inside the event conveys the old and new states.
|
| 90 | EVENT_COMPONENT_ADMIN_STATE_CHANGED = 700;
|
| 91 | EVENT_COMPONENT_OPER_STATE_CHANGED = 701;
|
| 92 | EVENT_COMPONENT_ALARM_STATE_CHANGED = 702;
|
| 93 | EVENT_COMPONENT_USAGE_STATE_CHANGED = 703;
|
| 94 | EVENT_COMPONENT_STANDBY_STATE_CHANGED = 704;
|
| Amit Ghosh | d0151a3 | 2025-10-03 10:53:14 +0200 | [diff] [blame^] | 95 | // Generic event about a component, the payload contains GenericEventInfo in this case
|
| 96 | // Use this event id only for events which do not have already a specific event id
|
| 97 | EVENT_COMPONENT_GENERIC_EVENT = 705;
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 98 | // More to be added
|
| 99 | }
|
| 100 |
|
| 101 | message ValueType {
|
| amit.ghosh | 93921ec | 2022-09-08 17:22:40 +0200 | [diff] [blame] | 102 | // For val no multiples of units shall be used.
|
| 103 | // For example, for memory val should be in bytes and not in kilobytes or any
|
| 104 | // other multiple of the unit byte.
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 105 | oneof val{
|
| 106 | int64 int_val = 1;
|
| 107 | uint64 uint_val = 2;
|
| 108 | float float_val = 3;
|
| 109 | }
|
| amit.ghosh | 93921ec | 2022-09-08 17:22:40 +0200 | [diff] [blame] | 110 |
|
| 111 | DataValueType typeOfVal = 4;
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 112 | }
|
| 113 |
|
| 114 | message WaterMarks {
|
| 115 | ValueType high = 1;
|
| 116 | ValueType low = 2;
|
| 117 | }
|
| 118 |
|
| 119 | message Thresholds {
|
| 120 | oneof threshold {
|
| 121 | WaterMarks upper = 1;
|
| 122 | WaterMarks lower = 2;
|
| 123 | }
|
| 124 | }
|
| 125 |
|
| 126 | message ThresholdInformation {
|
| 127 | ValueType observed_value = 1;
|
| 128 | Thresholds thresholds = 2;
|
| 129 | }
|
| 130 |
|
| 131 | message EventCfg {
|
| 132 | EventIds event_id = 1;
|
| 133 | bool is_configured = 2;
|
| 134 | // Optional threshold values, applicable only for some specific events
|
| amit.ghosh | 06f4978 | 2023-06-15 13:53:51 +0200 | [diff] [blame] | 135 | // If an event needs thresholds but the user does not pass the thresholds here, the Device Manager implementations
|
| 136 | // could choose to use defaults applicable for the specific component (recommended) or return an error for such
|
| 137 | // an EventConfigurationRequest with reason as INVALID_CONFIG
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 138 | Thresholds thresholds = 3;
|
| amit.ghosh | 7a093bd | 2023-03-07 16:31:56 +0100 | [diff] [blame] | 139 | // For events which can be configured on a particular component this id can be used to identify the component
|
| 140 | // For e.g. for events of the transceivers
|
| 141 | Uuid component_uuid = 4;
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 142 | }
|
| 143 |
|
| 144 | message EventsCfg {
|
| 145 | repeated EventCfg items = 1;
|
| 146 | }
|
| 147 |
|
| 148 | message ListEventsResponse {
|
| amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 149 | enum Reason {
|
| 150 | UNDEFINED_REASON = 0;
|
| 151 | UNKNOWN_DEVICE = 1;
|
| 152 | INTERNAL_ERROR = 2;
|
| amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 153 | DEVICE_UNREACHABLE = 3;
|
| amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 154 | }
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 155 | Status status = 1;
|
| 156 | Reason reason = 2;
|
| 157 | EventsCfg events = 3;
|
| amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 158 | string reason_detail = 4;
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 159 | }
|
| 160 |
|
| 161 | message EventsConfigurationRequest {
|
| 162 | Uuid device_uuid = 1;
|
| 163 | oneof operation {
|
| 164 | EventsCfg changes = 2;
|
| 165 | bool reset_to_default = 3;
|
| 166 | }
|
| 167 | }
|
| 168 |
|
| 169 | message EventsConfigurationResponse {
|
| amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 170 | enum Reason {
|
| 171 | UNDEFINED_REASON = 0;
|
| 172 | UNKNOWN_DEVICE = 1;
|
| 173 | INTERNAL_ERROR = 2;
|
| 174 | INVALID_CONFIG = 3;
|
| amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 175 | DEVICE_UNREACHABLE = 4;
|
| amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 176 | }
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 177 | Status status = 1;
|
| 178 | Reason reason = 2;
|
| amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 179 | string reason_detail = 3;
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 180 | }
|
| 181 |
|
| 182 | message EventMetaData {
|
| 183 | Uuid device_uuid = 1;
|
| 184 | // uuid of the component
|
| 185 | Uuid component_uuid = 2;
|
| 186 | string component_name = 3;
|
| 187 | }
|
| 188 |
|
| Amit Ghosh | e45d997 | 2025-06-26 14:52:48 +0200 | [diff] [blame] | 189 | message AdminStateChange {
|
| 190 | ComponentAdminState old = 1;
|
| 191 | ComponentAdminState new = 2;
|
| 192 | }
|
| 193 |
|
| 194 | message OperStateChange {
|
| 195 | ComponentOperState old = 1;
|
| 196 | ComponentOperState new = 2;
|
| 197 | }
|
| 198 |
|
| 199 | message AlarmStateChange {
|
| 200 | ComponentAlarmState old = 1;
|
| 201 | ComponentAlarmState new = 2;
|
| 202 | }
|
| 203 |
|
| 204 | message UsageStateChange {
|
| 205 | ComponentUsageState old = 1;
|
| 206 | ComponentUsageState new = 2;
|
| 207 | }
|
| 208 |
|
| 209 | message StandbyStateChange {
|
| 210 | ComponentStandbyState old = 1;
|
| 211 | ComponentStandbyState new = 2;
|
| 212 | }
|
| 213 |
|
| 214 | message StateChangeInfo {
|
| 215 | oneof state_change {
|
| 216 | AdminStateChange admin_state_change = 1;
|
| 217 | OperStateChange oper_state_change = 2;
|
| 218 | AlarmStateChange alarm_state_change = 3;
|
| 219 | UsageStateChange usage_state_change = 4;
|
| 220 | StandbyStateChange standby_state_change = 5;
|
| 221 | }
|
| 222 | }
|
| Amit Ghosh | d0151a3 | 2025-10-03 10:53:14 +0200 | [diff] [blame^] | 223 |
|
| 224 | message GenericEventInfo {
|
| 225 | string message = 1; // Human-readable message
|
| 226 | string message_code = 2; // Related events should have the same code
|
| 227 |
|
| 228 | enum EventSeverity {
|
| 229 | EVENT_SEVERITY_UNSPECIFIED = 0;
|
| 230 | CRITICAL = 1;
|
| 231 | MAJOR = 2;
|
| 232 | MINOR = 3;
|
| 233 | NORMAL = 4;
|
| 234 | INFO = 5;
|
| 235 | }
|
| 236 |
|
| 237 | EventSeverity severity = 3; // Severity of the event
|
| 238 | }
|
| Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 239 | // The Events are conveyed to external systems either by submitting them on a message bus or using gRPC server streaming.
|
| 240 | // The message bus topic to which are Events are submitted would be configured as startup
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 241 | // configuration of the components
|
| 242 |
|
| 243 | message Event {
|
| 244 | EventMetaData event_metadata = 1;
|
| 245 | EventIds event_id = 2;
|
| 246 | google.protobuf.Timestamp raised_ts = 3;
|
| 247 | // Optional threshold information for an event
|
| 248 | ThresholdInformation threshold_info = 4;
|
| 249 | // Any additional info regarding the event
|
| Amit Ghosh | d0151a3 | 2025-10-03 10:53:14 +0200 | [diff] [blame^] | 250 | string add_info = 5; // Stringified JSON with extra details
|
| Amit Ghosh | e45d997 | 2025-06-26 14:52:48 +0200 | [diff] [blame] | 251 | StateChangeInfo state_change_info = 6; // Only set for state change events
|
| Amit Ghosh | d0151a3 | 2025-10-03 10:53:14 +0200 | [diff] [blame^] | 252 | GenericEventInfo generic_event_info = 7; // Only set for event_id = EVENT_COMPONENT_GENERIC_EVENT
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 253 | }
|
| 254 |
|
| 255 | service NativeEventsManagementService {
|
| 256 |
|
| 257 | // List the supported events for the passed device
|
| 258 | rpc ListEvents(HardwareID) returns(ListEventsResponse);
|
| 259 |
|
| 260 | // Updates the configuration of the list of events in the request
|
| aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 261 | // The default behavior of the device is to report all the supported events
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 262 | // This configuration is persisted across reboots of the device or the device manager
|
| 263 | rpc UpdateEventsConfiguration(EventsConfigurationRequest) returns(EventsConfigurationResponse);
|
| Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 264 |
|
| 265 | // Initiate the server streaming of the events
|
| 266 | rpc StreamEvents(google.protobuf.Empty) returns(stream Event);
|
| Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 267 | }
|