blob: 7cde7d9fb1fc810383ea9a835c5111d0cb1991f5 [file] [log] [blame]
Amit Ghosh09f28362020-06-12 21:52:19 +01001syntax = "proto3";
2
3option go_package = "github.com/opencord/device-management-interface/v3/go/dmi";
4package dmi;
5
6import "dmi/commons.proto";
7import "dmi/hw.proto";
8import "google/protobuf/timestamp.proto";
Chandrakanth Nalkudre Gowda68590a42021-04-22 15:19:21 +05309import "google/protobuf/empty.proto";
Amit Ghosh09f28362020-06-12 21:52:19 +010010
11// Management of Events and protos for encoding of Events
12
13enum 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.ghosh93921ec2022-09-08 17:22:40 +020019 // 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 Ghosh09f28362020-06-12 21:52:19 +010025 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 Ghosh9d6658d2020-06-25 10:43:30 +010036 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 Ghosh09f28362020-06-12 21:52:19 +010047
48 // Events from the PSU
49 EVENT_PSU_PLUG_OUT = 200;
50 EVENT_PSU_PLUG_IN = 201;
51 EVENT_PSU_FAILURE = 202;
Amit Ghosh9d6658d2020-06-25 10:43:30 +010052 EVENT_PSU_FAILURE_RECOVERED = 203;
Amit Ghosh09f28362020-06-12 21:52:19 +010053
54 // Events for the Fans
55 EVENT_FAN_FAILURE = 300;
56 EVENT_FAN_PLUG_OUT = 301;
57 EVENT_FAN_PLUG_IN = 302;
Amit Ghosh9d6658d2020-06-25 10:43:30 +010058 EVENT_FAN_FAILURE_RECOVERED = 303;
Amit Ghosh09f28362020-06-12 21:52:19 +010059
60 // Events for the CPUs
61 EVENT_CPU_TEMPERATURE_ABOVE_CRITICAL = 400;
62 EVENT_CPU_TEMPERATURE_ABOVE_FATAL = 401;
Amit Ghosh9d6658d2020-06-25 10:43:30 +010063 EVENT_CPU_TEMPERATURE_ABOVE_CRITICAL_RECOVERED = 402;
64 EVENT_CPU_TEMPERATURE_ABOVE_FATAL_RECOVERED = 403;
amit.ghosh06f49782023-06-15 13:53:51 +020065 EVENT_CPU_USAGE_ABOVE_THRESHOLD = 404;
66 EVENT_CPU_USAGE_ABOVE_THRESHOLD_RECOVERED = 405;
Amit Ghosh09f28362020-06-12 21:52:19 +010067
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 Ghosh9d6658d2020-06-25 10:43:30 +010072 EVENT_HW_DEVICE_TEMPERATURE_ABOVE_CRITICAL_RECOVERED = 503;
73 EVENT_HW_DEVICE_TEMPERATURE_ABOVE_FATAL_RECOVERED = 504;
Chandrakanth Nalkudre Gowda2f6066c2021-05-13 12:36:32 +053074 EVENT_HW_DEVICE_REBOOT = 505;
amit.ghosh8fe610f2022-01-14 17:44:53 +010075 EVENT_HW_TEMPERATURE_SENSOR_FAILED = 506;
76 EVENT_HW_ALL_TEMPERATURE_SENSORS_FAILED = 507;
amit.ghosh06f49782023-06-15 13:53:51 +020077 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 Ghosh09f28362020-06-12 21:52:19 +010083
amit.ghoshc0c3c242022-03-16 11:00:27 +010084 // 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 Ghoshe45d9972025-06-26 14:52:48 +020088 // 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;
95
Amit Ghosh09f28362020-06-12 21:52:19 +010096 // More to be added
97}
98
99message ValueType {
amit.ghosh93921ec2022-09-08 17:22:40 +0200100 // For val no multiples of units shall be used.
101 // For example, for memory val should be in bytes and not in kilobytes or any
102 // other multiple of the unit byte.
Amit Ghosh09f28362020-06-12 21:52:19 +0100103 oneof val{
104 int64 int_val = 1;
105 uint64 uint_val = 2;
106 float float_val = 3;
107 }
amit.ghosh93921ec2022-09-08 17:22:40 +0200108
109 DataValueType typeOfVal = 4;
Amit Ghosh09f28362020-06-12 21:52:19 +0100110}
111
112message WaterMarks {
113 ValueType high = 1;
114 ValueType low = 2;
115}
116
117message Thresholds {
118 oneof threshold {
119 WaterMarks upper = 1;
120 WaterMarks lower = 2;
121 }
122}
123
124message ThresholdInformation {
125 ValueType observed_value = 1;
126 Thresholds thresholds = 2;
127}
128
129message EventCfg {
130 EventIds event_id = 1;
131 bool is_configured = 2;
132 // Optional threshold values, applicable only for some specific events
amit.ghosh06f49782023-06-15 13:53:51 +0200133 // If an event needs thresholds but the user does not pass the thresholds here, the Device Manager implementations
134 // could choose to use defaults applicable for the specific component (recommended) or return an error for such
135 // an EventConfigurationRequest with reason as INVALID_CONFIG
Amit Ghosh09f28362020-06-12 21:52:19 +0100136 Thresholds thresholds = 3;
amit.ghosh7a093bd2023-03-07 16:31:56 +0100137 // For events which can be configured on a particular component this id can be used to identify the component
138 // For e.g. for events of the transceivers
139 Uuid component_uuid = 4;
Amit Ghosh09f28362020-06-12 21:52:19 +0100140}
141
142message EventsCfg {
143 repeated EventCfg items = 1;
144}
145
146message ListEventsResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100147 enum Reason {
148 UNDEFINED_REASON = 0;
149 UNKNOWN_DEVICE = 1;
150 INTERNAL_ERROR = 2;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100151 DEVICE_UNREACHABLE = 3;
amit.ghoshae473032021-01-10 11:59:10 +0100152 }
Amit Ghosh09f28362020-06-12 21:52:19 +0100153 Status status = 1;
154 Reason reason = 2;
155 EventsCfg events = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100156 string reason_detail = 4;
Amit Ghosh09f28362020-06-12 21:52:19 +0100157}
158
159message EventsConfigurationRequest {
160 Uuid device_uuid = 1;
161 oneof operation {
162 EventsCfg changes = 2;
163 bool reset_to_default = 3;
164 }
165}
166
167message EventsConfigurationResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100168 enum Reason {
169 UNDEFINED_REASON = 0;
170 UNKNOWN_DEVICE = 1;
171 INTERNAL_ERROR = 2;
172 INVALID_CONFIG = 3;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100173 DEVICE_UNREACHABLE = 4;
amit.ghoshae473032021-01-10 11:59:10 +0100174 }
Amit Ghosh09f28362020-06-12 21:52:19 +0100175 Status status = 1;
176 Reason reason = 2;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100177 string reason_detail = 3;
Amit Ghosh09f28362020-06-12 21:52:19 +0100178}
179
180message EventMetaData {
181 Uuid device_uuid = 1;
182 // uuid of the component
183 Uuid component_uuid = 2;
184 string component_name = 3;
185}
186
Amit Ghoshe45d9972025-06-26 14:52:48 +0200187message AdminStateChange {
188 ComponentAdminState old = 1;
189 ComponentAdminState new = 2;
190}
191
192message OperStateChange {
193 ComponentOperState old = 1;
194 ComponentOperState new = 2;
195}
196
197message AlarmStateChange {
198 ComponentAlarmState old = 1;
199 ComponentAlarmState new = 2;
200}
201
202message UsageStateChange {
203 ComponentUsageState old = 1;
204 ComponentUsageState new = 2;
205}
206
207message StandbyStateChange {
208 ComponentStandbyState old = 1;
209 ComponentStandbyState new = 2;
210}
211
212message StateChangeInfo {
213 oneof state_change {
214 AdminStateChange admin_state_change = 1;
215 OperStateChange oper_state_change = 2;
216 AlarmStateChange alarm_state_change = 3;
217 UsageStateChange usage_state_change = 4;
218 StandbyStateChange standby_state_change = 5;
219 }
220}
Chandrakanth Nalkudre Gowda68590a42021-04-22 15:19:21 +0530221// The Events are conveyed to external systems either by submitting them on a message bus or using gRPC server streaming.
222// The message bus topic to which are Events are submitted would be configured as startup
Amit Ghosh09f28362020-06-12 21:52:19 +0100223// configuration of the components
224
225message Event {
226 EventMetaData event_metadata = 1;
227 EventIds event_id = 2;
228 google.protobuf.Timestamp raised_ts = 3;
229 // Optional threshold information for an event
230 ThresholdInformation threshold_info = 4;
231 // Any additional info regarding the event
232 string add_info = 5;
Amit Ghoshe45d9972025-06-26 14:52:48 +0200233 StateChangeInfo state_change_info = 6; // Only set for state change events
Amit Ghosh09f28362020-06-12 21:52:19 +0100234}
235
236service NativeEventsManagementService {
237
238 // List the supported events for the passed device
239 rpc ListEvents(HardwareID) returns(ListEventsResponse);
240
241 // Updates the configuration of the list of events in the request
aghoshc301dcd2020-09-03 16:55:34 +0100242 // The default behavior of the device is to report all the supported events
Amit Ghosh09f28362020-06-12 21:52:19 +0100243 // This configuration is persisted across reboots of the device or the device manager
244 rpc UpdateEventsConfiguration(EventsConfigurationRequest) returns(EventsConfigurationResponse);
Chandrakanth Nalkudre Gowda68590a42021-04-22 15:19:21 +0530245
246 // Initiate the server streaming of the events
247 rpc StreamEvents(google.protobuf.Empty) returns(stream Event);
Amit Ghosh09f28362020-06-12 21:52:19 +0100248}