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;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 66 |
|
| 67 | // More to be added
|
| 68 | }
|
| 69 |
|
| 70 | message ValueType {
|
| 71 | oneof val{
|
| 72 | int64 int_val = 1;
|
| 73 | uint64 uint_val = 2;
|
| 74 | float float_val = 3;
|
| 75 | }
|
| 76 | }
|
| 77 |
|
| 78 | message WaterMarks {
|
| 79 | ValueType high = 1;
|
| 80 | ValueType low = 2;
|
| 81 | }
|
| 82 |
|
| 83 | message Thresholds {
|
| 84 | oneof threshold {
|
| 85 | WaterMarks upper = 1;
|
| 86 | WaterMarks lower = 2;
|
| 87 | }
|
| 88 | }
|
| 89 |
|
| 90 | message ThresholdInformation {
|
| 91 | ValueType observed_value = 1;
|
| 92 | Thresholds thresholds = 2;
|
| 93 | }
|
| 94 |
|
| 95 | message EventCfg {
|
| 96 | EventIds event_id = 1;
|
| 97 | bool is_configured = 2;
|
| 98 | // Optional threshold values, applicable only for some specific events
|
| 99 | Thresholds thresholds = 3;
|
| 100 | }
|
| 101 |
|
| 102 | message EventsCfg {
|
| 103 | repeated EventCfg items = 1;
|
| 104 | }
|
| 105 |
|
| 106 | message ListEventsResponse {
|
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;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 111 | DEVICE_UNREACHABLE = 3;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 112 | }
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 113 | Status status = 1;
|
| 114 | Reason reason = 2;
|
| 115 | EventsCfg events = 3;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 116 | string reason_detail = 4;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 117 | }
|
| 118 |
|
| 119 | message EventsConfigurationRequest {
|
| 120 | Uuid device_uuid = 1;
|
| 121 | oneof operation {
|
| 122 | EventsCfg changes = 2;
|
| 123 | bool reset_to_default = 3;
|
| 124 | }
|
| 125 | }
|
| 126 |
|
| 127 | message EventsConfigurationResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 128 | enum Reason {
|
| 129 | UNDEFINED_REASON = 0;
|
| 130 | UNKNOWN_DEVICE = 1;
|
| 131 | INTERNAL_ERROR = 2;
|
| 132 | INVALID_CONFIG = 3;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 133 | DEVICE_UNREACHABLE = 4;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 134 | }
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 135 | Status status = 1;
|
| 136 | Reason reason = 2;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 137 | string reason_detail = 3;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 138 | }
|
| 139 |
|
| 140 | message EventMetaData {
|
| 141 | Uuid device_uuid = 1;
|
| 142 | // uuid of the component
|
| 143 | Uuid component_uuid = 2;
|
| 144 | string component_name = 3;
|
| 145 | }
|
| 146 |
|
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 147 | // The Events are conveyed to external systems either by submitting them on a message bus or using gRPC server streaming.
|
| 148 | // 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] | 149 | // configuration of the components
|
| 150 |
|
| 151 | message Event {
|
| 152 | EventMetaData event_metadata = 1;
|
| 153 | EventIds event_id = 2;
|
| 154 | google.protobuf.Timestamp raised_ts = 3;
|
| 155 | // Optional threshold information for an event
|
| 156 | ThresholdInformation threshold_info = 4;
|
| 157 | // Any additional info regarding the event
|
| 158 | string add_info = 5;
|
| 159 | }
|
| 160 |
|
| 161 | service NativeEventsManagementService {
|
| 162 |
|
| 163 | // List the supported events for the passed device
|
| 164 | rpc ListEvents(HardwareID) returns(ListEventsResponse);
|
| 165 |
|
| 166 | // Updates the configuration of the list of events in the request
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 167 | // 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] | 168 | // This configuration is persisted across reboots of the device or the device manager
|
| 169 | rpc UpdateEventsConfiguration(EventsConfigurationRequest) returns(EventsConfigurationResponse);
|
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 170 |
|
| 171 | // Initiate the server streaming of the events
|
| 172 | rpc StreamEvents(google.protobuf.Empty) returns(stream Event);
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 173 | }
|