blob: 1a7e0b00aaea1d3e4bd9c6a81f8f6a15cc3e22a7 [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 Ghosh09f28362020-06-12 21:52:19 +010065
66 // Events for the complete HW Device
67 EVENT_HW_DEVICE_RESET = 500;
68 EVENT_HW_DEVICE_TEMPERATURE_ABOVE_CRITICAL = 501;
69 EVENT_HW_DEVICE_TEMPERATURE_ABOVE_FATAL = 502;
Amit Ghosh9d6658d2020-06-25 10:43:30 +010070 EVENT_HW_DEVICE_TEMPERATURE_ABOVE_CRITICAL_RECOVERED = 503;
71 EVENT_HW_DEVICE_TEMPERATURE_ABOVE_FATAL_RECOVERED = 504;
Chandrakanth Nalkudre Gowda2f6066c2021-05-13 12:36:32 +053072 EVENT_HW_DEVICE_REBOOT = 505;
amit.ghosh8fe610f2022-01-14 17:44:53 +010073 EVENT_HW_TEMPERATURE_SENSOR_FAILED = 506;
74 EVENT_HW_ALL_TEMPERATURE_SENSORS_FAILED = 507;
Amit Ghosh09f28362020-06-12 21:52:19 +010075
amit.ghoshc0c3c242022-03-16 11:00:27 +010076 // Events for the line cards on the HW Device
77 EVENT_LINE_CARD_PLUG_OUT = 600;
78 EVENT_LINE_CARD_PLUG_IN = 601;
79
Amit Ghosh09f28362020-06-12 21:52:19 +010080 // More to be added
81}
82
83message ValueType {
amit.ghosh93921ec2022-09-08 17:22:40 +020084 // For val no multiples of units shall be used.
85 // For example, for memory val should be in bytes and not in kilobytes or any
86 // other multiple of the unit byte.
Amit Ghosh09f28362020-06-12 21:52:19 +010087 oneof val{
88 int64 int_val = 1;
89 uint64 uint_val = 2;
90 float float_val = 3;
91 }
amit.ghosh93921ec2022-09-08 17:22:40 +020092
93 DataValueType typeOfVal = 4;
Amit Ghosh09f28362020-06-12 21:52:19 +010094}
95
96message WaterMarks {
97 ValueType high = 1;
98 ValueType low = 2;
99}
100
101message Thresholds {
102 oneof threshold {
103 WaterMarks upper = 1;
104 WaterMarks lower = 2;
105 }
106}
107
108message ThresholdInformation {
109 ValueType observed_value = 1;
110 Thresholds thresholds = 2;
111}
112
113message EventCfg {
114 EventIds event_id = 1;
115 bool is_configured = 2;
116 // Optional threshold values, applicable only for some specific events
117 Thresholds thresholds = 3;
118}
119
120message EventsCfg {
121 repeated EventCfg items = 1;
122}
123
124message ListEventsResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100125 enum Reason {
126 UNDEFINED_REASON = 0;
127 UNKNOWN_DEVICE = 1;
128 INTERNAL_ERROR = 2;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100129 DEVICE_UNREACHABLE = 3;
amit.ghoshae473032021-01-10 11:59:10 +0100130 }
Amit Ghosh09f28362020-06-12 21:52:19 +0100131 Status status = 1;
132 Reason reason = 2;
133 EventsCfg events = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100134 string reason_detail = 4;
Amit Ghosh09f28362020-06-12 21:52:19 +0100135}
136
137message EventsConfigurationRequest {
138 Uuid device_uuid = 1;
139 oneof operation {
140 EventsCfg changes = 2;
141 bool reset_to_default = 3;
142 }
amit.ghoshf1be1272022-08-24 19:31:03 +0200143 // For events which can be configured on a particular component this id can be used to identify the component
144 // For e.g. for events of the transceivers
145 Uuid component_uuid = 4;
Amit Ghosh09f28362020-06-12 21:52:19 +0100146}
147
148message EventsConfigurationResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100149 enum Reason {
150 UNDEFINED_REASON = 0;
151 UNKNOWN_DEVICE = 1;
152 INTERNAL_ERROR = 2;
153 INVALID_CONFIG = 3;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100154 DEVICE_UNREACHABLE = 4;
amit.ghoshae473032021-01-10 11:59:10 +0100155 }
Amit Ghosh09f28362020-06-12 21:52:19 +0100156 Status status = 1;
157 Reason reason = 2;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100158 string reason_detail = 3;
Amit Ghosh09f28362020-06-12 21:52:19 +0100159}
160
161message EventMetaData {
162 Uuid device_uuid = 1;
163 // uuid of the component
164 Uuid component_uuid = 2;
165 string component_name = 3;
166}
167
Chandrakanth Nalkudre Gowda68590a42021-04-22 15:19:21 +0530168// The Events are conveyed to external systems either by submitting them on a message bus or using gRPC server streaming.
169// The message bus topic to which are Events are submitted would be configured as startup
Amit Ghosh09f28362020-06-12 21:52:19 +0100170// configuration of the components
171
172message Event {
173 EventMetaData event_metadata = 1;
174 EventIds event_id = 2;
175 google.protobuf.Timestamp raised_ts = 3;
176 // Optional threshold information for an event
177 ThresholdInformation threshold_info = 4;
178 // Any additional info regarding the event
179 string add_info = 5;
180}
181
182service NativeEventsManagementService {
183
184 // List the supported events for the passed device
185 rpc ListEvents(HardwareID) returns(ListEventsResponse);
186
187 // Updates the configuration of the list of events in the request
aghoshc301dcd2020-09-03 16:55:34 +0100188 // The default behavior of the device is to report all the supported events
Amit Ghosh09f28362020-06-12 21:52:19 +0100189 // This configuration is persisted across reboots of the device or the device manager
190 rpc UpdateEventsConfiguration(EventsConfigurationRequest) returns(EventsConfigurationResponse);
Chandrakanth Nalkudre Gowda68590a42021-04-22 15:19:21 +0530191
192 // Initiate the server streaming of the events
193 rpc StreamEvents(google.protobuf.Empty) returns(stream Event);
Amit Ghosh09f28362020-06-12 21:52:19 +0100194}