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";
|
| 9 |
|
| 10 | // Management of Events and protos for encoding of Events
|
| 11 |
|
| 12 | enum EventIds {
|
| 13 | EVENT_NAME_UNDEFINED = 0;
|
| 14 |
|
| 15 | // Events from the Transceivers
|
| 16 | EVENT_TRANSCEIVER_PLUG_OUT = 100;
|
| 17 | EVENT_TRANSCEIVER_PLUG_IN = 101;
|
| 18 | EVENT_TRANSCEIVER_VOLTAGE_ABOVE_THRESHOLD = 102;
|
| 19 | EVENT_TRANSCEIVER_VOLTAGE_BELOW_THRESHOLD = 103;
|
| 20 | EVENT_TRANSCEIVER_TEMPERATURE_ABOVE_THRESHOLD = 104;
|
| 21 | EVENT_TRANSCEIVER_TEMPERATURE_BELOW_THRESHOLD = 105;
|
| 22 | EVENT_TRANSCEIVER_CURRENT_ABOVE_THRESHOLD = 106;
|
| 23 | EVENT_TRANSCEIVER_CURRENT_BELOW_THRESHOLD = 107;
|
| 24 | EVENT_TRANSCEIVER_RX_POWER_ABOVE_THRESHOLD = 108;
|
| 25 | EVENT_TRANSCEIVER_RX_POWER_BELOW_THRESHOLD = 109;
|
| 26 | EVENT_TRANSCEIVER_TX_POWER_ABOVE_THRESHOLD = 110;
|
| 27 | EVENT_TRANSCEIVER_TX_POWER_BELOW_THRESHOLD = 111;
|
| 28 | EVENT_TRANSCEIVER_FAILURE = 112;
|
Amit Ghosh | 9d6658d | 2020-06-25 10:43:30 +0100 | [diff] [blame] | 29 | EVENT_TRANSCEIVER_VOLTAGE_ABOVE_THRESHOLD_RECOVERED = 113;
|
| 30 | EVENT_TRANSCEIVER_VOLTAGE_BELOW_THRESHOLD_RECOVERED = 114;
|
| 31 | EVENT_TRANSCEIVER_TEMPERATURE_ABOVE_THRESHOLD_RECOVERED = 115;
|
| 32 | EVENT_TRANSCEIVER_TEMPERATURE_BELOW_THRESHOLD_RECOVERED = 116;
|
| 33 | EVENT_TRANSCEIVER_CURRENT_ABOVE_THRESHOLD_RECOVERED = 117;
|
| 34 | EVENT_TRANSCEIVER_CURRENT_BELOW_THRESHOLD_RECOVERED = 118;
|
| 35 | EVENT_TRANSCEIVER_RX_POWER_ABOVE_THRESHOLD_RECOVERED = 119;
|
| 36 | EVENT_TRANSCEIVER_RX_POWER_BELOW_THRESHOLD_RECOVERED = 120;
|
| 37 | EVENT_TRANSCEIVER_TX_POWER_ABOVE_THRESHOLD_RECOVERED = 121;
|
| 38 | EVENT_TRANSCEIVER_TX_POWER_BELOW_THRESHOLD_RECOVERED = 122;
|
| 39 | EVENT_TRANSCEIVER_FAILURE_RECOVERED = 123;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 40 |
|
| 41 | // Events from the PSU
|
| 42 | EVENT_PSU_PLUG_OUT = 200;
|
| 43 | EVENT_PSU_PLUG_IN = 201;
|
| 44 | EVENT_PSU_FAILURE = 202;
|
Amit Ghosh | 9d6658d | 2020-06-25 10:43:30 +0100 | [diff] [blame] | 45 | EVENT_PSU_FAILURE_RECOVERED = 203;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 46 |
|
| 47 | // Events for the Fans
|
| 48 | EVENT_FAN_FAILURE = 300;
|
| 49 | EVENT_FAN_PLUG_OUT = 301;
|
| 50 | EVENT_FAN_PLUG_IN = 302;
|
Amit Ghosh | 9d6658d | 2020-06-25 10:43:30 +0100 | [diff] [blame] | 51 | EVENT_FAN_FAILURE_RECOVERED = 303;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 52 |
|
| 53 | // Events for the CPUs
|
| 54 | EVENT_CPU_TEMPERATURE_ABOVE_CRITICAL = 400;
|
| 55 | EVENT_CPU_TEMPERATURE_ABOVE_FATAL = 401;
|
Amit Ghosh | 9d6658d | 2020-06-25 10:43:30 +0100 | [diff] [blame] | 56 | EVENT_CPU_TEMPERATURE_ABOVE_CRITICAL_RECOVERED = 402;
|
| 57 | EVENT_CPU_TEMPERATURE_ABOVE_FATAL_RECOVERED = 403;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 58 |
|
| 59 | // Events for the complete HW Device
|
| 60 | EVENT_HW_DEVICE_RESET = 500;
|
| 61 | EVENT_HW_DEVICE_TEMPERATURE_ABOVE_CRITICAL = 501;
|
| 62 | EVENT_HW_DEVICE_TEMPERATURE_ABOVE_FATAL = 502;
|
Amit Ghosh | 9d6658d | 2020-06-25 10:43:30 +0100 | [diff] [blame] | 63 | EVENT_HW_DEVICE_TEMPERATURE_ABOVE_CRITICAL_RECOVERED = 503;
|
| 64 | EVENT_HW_DEVICE_TEMPERATURE_ABOVE_FATAL_RECOVERED = 504;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 65 |
|
| 66 | // More to be added
|
| 67 | }
|
| 68 |
|
| 69 | message ValueType {
|
| 70 | oneof val{
|
| 71 | int64 int_val = 1;
|
| 72 | uint64 uint_val = 2;
|
| 73 | float float_val = 3;
|
| 74 | }
|
| 75 | }
|
| 76 |
|
| 77 | message WaterMarks {
|
| 78 | ValueType high = 1;
|
| 79 | ValueType low = 2;
|
| 80 | }
|
| 81 |
|
| 82 | message Thresholds {
|
| 83 | oneof threshold {
|
| 84 | WaterMarks upper = 1;
|
| 85 | WaterMarks lower = 2;
|
| 86 | }
|
| 87 | }
|
| 88 |
|
| 89 | message ThresholdInformation {
|
| 90 | ValueType observed_value = 1;
|
| 91 | Thresholds thresholds = 2;
|
| 92 | }
|
| 93 |
|
| 94 | message EventCfg {
|
| 95 | EventIds event_id = 1;
|
| 96 | bool is_configured = 2;
|
| 97 | // Optional threshold values, applicable only for some specific events
|
| 98 | Thresholds thresholds = 3;
|
| 99 | }
|
| 100 |
|
| 101 | message EventsCfg {
|
| 102 | repeated EventCfg items = 1;
|
| 103 | }
|
| 104 |
|
| 105 | message ListEventsResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 106 | enum Reason {
|
| 107 | UNDEFINED_REASON = 0;
|
| 108 | UNKNOWN_DEVICE = 1;
|
| 109 | INTERNAL_ERROR = 2;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 110 | DEVICE_UNREACHABLE = 3;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 111 | }
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 112 | Status status = 1;
|
| 113 | Reason reason = 2;
|
| 114 | EventsCfg events = 3;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 115 | string reason_detail = 4;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 116 | }
|
| 117 |
|
| 118 | message EventsConfigurationRequest {
|
| 119 | Uuid device_uuid = 1;
|
| 120 | oneof operation {
|
| 121 | EventsCfg changes = 2;
|
| 122 | bool reset_to_default = 3;
|
| 123 | }
|
| 124 | }
|
| 125 |
|
| 126 | message EventsConfigurationResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 127 | enum Reason {
|
| 128 | UNDEFINED_REASON = 0;
|
| 129 | UNKNOWN_DEVICE = 1;
|
| 130 | INTERNAL_ERROR = 2;
|
| 131 | INVALID_CONFIG = 3;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 132 | DEVICE_UNREACHABLE = 4;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 133 | }
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 134 | Status status = 1;
|
| 135 | Reason reason = 2;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 136 | string reason_detail = 3;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 137 | }
|
| 138 |
|
| 139 | message EventMetaData {
|
| 140 | Uuid device_uuid = 1;
|
| 141 | // uuid of the component
|
| 142 | Uuid component_uuid = 2;
|
| 143 | string component_name = 3;
|
| 144 | }
|
| 145 |
|
| 146 | // The Events are conveyed to external systems by submitting them on a kafka bus.
|
| 147 | // The topic to which are Events are submitted would be configured as startup
|
| 148 | // configuration of the components
|
| 149 |
|
| 150 | message Event {
|
| 151 | EventMetaData event_metadata = 1;
|
| 152 | EventIds event_id = 2;
|
| 153 | google.protobuf.Timestamp raised_ts = 3;
|
| 154 | // Optional threshold information for an event
|
| 155 | ThresholdInformation threshold_info = 4;
|
| 156 | // Any additional info regarding the event
|
| 157 | string add_info = 5;
|
| 158 | }
|
| 159 |
|
| 160 | service NativeEventsManagementService {
|
| 161 |
|
| 162 | // List the supported events for the passed device
|
| 163 | rpc ListEvents(HardwareID) returns(ListEventsResponse);
|
| 164 |
|
| 165 | // Updates the configuration of the list of events in the request
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 166 | // 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] | 167 | // This configuration is persisted across reboots of the device or the device manager
|
| 168 | rpc UpdateEventsConfiguration(EventsConfigurationRequest) returns(EventsConfigurationResponse);
|
| 169 | }
|