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