blob: b4fceb90a029295fe311bae62e592c3430947e4f [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;
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 Ghosh9d6658d2020-06-25 10:43:30 +010030 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 Ghosh09f28362020-06-12 21:52:19 +010041
42 // Events from the PSU
43 EVENT_PSU_PLUG_OUT = 200;
44 EVENT_PSU_PLUG_IN = 201;
45 EVENT_PSU_FAILURE = 202;
Amit Ghosh9d6658d2020-06-25 10:43:30 +010046 EVENT_PSU_FAILURE_RECOVERED = 203;
Amit Ghosh09f28362020-06-12 21:52:19 +010047
48 // Events for the Fans
49 EVENT_FAN_FAILURE = 300;
50 EVENT_FAN_PLUG_OUT = 301;
51 EVENT_FAN_PLUG_IN = 302;
Amit Ghosh9d6658d2020-06-25 10:43:30 +010052 EVENT_FAN_FAILURE_RECOVERED = 303;
Amit Ghosh09f28362020-06-12 21:52:19 +010053
54 // Events for the CPUs
55 EVENT_CPU_TEMPERATURE_ABOVE_CRITICAL = 400;
56 EVENT_CPU_TEMPERATURE_ABOVE_FATAL = 401;
Amit Ghosh9d6658d2020-06-25 10:43:30 +010057 EVENT_CPU_TEMPERATURE_ABOVE_CRITICAL_RECOVERED = 402;
58 EVENT_CPU_TEMPERATURE_ABOVE_FATAL_RECOVERED = 403;
Amit Ghosh09f28362020-06-12 21:52:19 +010059
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 Ghosh9d6658d2020-06-25 10:43:30 +010064 EVENT_HW_DEVICE_TEMPERATURE_ABOVE_CRITICAL_RECOVERED = 503;
65 EVENT_HW_DEVICE_TEMPERATURE_ABOVE_FATAL_RECOVERED = 504;
Chandrakanth Nalkudre Gowda2f6066c2021-05-13 12:36:32 +053066 EVENT_HW_DEVICE_REBOOT = 505;
amit.ghosh8fe610f2022-01-14 17:44:53 +010067 EVENT_HW_TEMPERATURE_SENSOR_FAILED = 506;
68 EVENT_HW_ALL_TEMPERATURE_SENSORS_FAILED = 507;
Amit Ghosh09f28362020-06-12 21:52:19 +010069
amit.ghoshc0c3c242022-03-16 11:00:27 +010070 // Events for the line cards on the HW Device
71 EVENT_LINE_CARD_PLUG_OUT = 600;
72 EVENT_LINE_CARD_PLUG_IN = 601;
73
Amit Ghosh09f28362020-06-12 21:52:19 +010074 // More to be added
75}
76
77message ValueType {
78 oneof val{
79 int64 int_val = 1;
80 uint64 uint_val = 2;
81 float float_val = 3;
82 }
83}
84
85message WaterMarks {
86 ValueType high = 1;
87 ValueType low = 2;
88}
89
90message Thresholds {
91 oneof threshold {
92 WaterMarks upper = 1;
93 WaterMarks lower = 2;
94 }
95}
96
97message ThresholdInformation {
98 ValueType observed_value = 1;
99 Thresholds thresholds = 2;
100}
101
102message EventCfg {
103 EventIds event_id = 1;
104 bool is_configured = 2;
105 // Optional threshold values, applicable only for some specific events
106 Thresholds thresholds = 3;
107}
108
109message EventsCfg {
110 repeated EventCfg items = 1;
111}
112
113message ListEventsResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100114 enum Reason {
115 UNDEFINED_REASON = 0;
116 UNKNOWN_DEVICE = 1;
117 INTERNAL_ERROR = 2;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100118 DEVICE_UNREACHABLE = 3;
amit.ghoshae473032021-01-10 11:59:10 +0100119 }
Amit Ghosh09f28362020-06-12 21:52:19 +0100120 Status status = 1;
121 Reason reason = 2;
122 EventsCfg events = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100123 string reason_detail = 4;
Amit Ghosh09f28362020-06-12 21:52:19 +0100124}
125
126message EventsConfigurationRequest {
127 Uuid device_uuid = 1;
128 oneof operation {
129 EventsCfg changes = 2;
130 bool reset_to_default = 3;
131 }
amit.ghoshf1be1272022-08-24 19:31:03 +0200132 // For events which can be configured on a particular component this id can be used to identify the component
133 // For e.g. for events of the transceivers
134 Uuid component_uuid = 4;
Amit Ghosh09f28362020-06-12 21:52:19 +0100135}
136
137message EventsConfigurationResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100138 enum Reason {
139 UNDEFINED_REASON = 0;
140 UNKNOWN_DEVICE = 1;
141 INTERNAL_ERROR = 2;
142 INVALID_CONFIG = 3;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100143 DEVICE_UNREACHABLE = 4;
amit.ghoshae473032021-01-10 11:59:10 +0100144 }
Amit Ghosh09f28362020-06-12 21:52:19 +0100145 Status status = 1;
146 Reason reason = 2;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100147 string reason_detail = 3;
Amit Ghosh09f28362020-06-12 21:52:19 +0100148}
149
150message EventMetaData {
151 Uuid device_uuid = 1;
152 // uuid of the component
153 Uuid component_uuid = 2;
154 string component_name = 3;
155}
156
Chandrakanth Nalkudre Gowda68590a42021-04-22 15:19:21 +0530157// The Events are conveyed to external systems either by submitting them on a message bus or using gRPC server streaming.
158// The message bus topic to which are Events are submitted would be configured as startup
Amit Ghosh09f28362020-06-12 21:52:19 +0100159// configuration of the components
160
161message Event {
162 EventMetaData event_metadata = 1;
163 EventIds event_id = 2;
164 google.protobuf.Timestamp raised_ts = 3;
165 // Optional threshold information for an event
166 ThresholdInformation threshold_info = 4;
167 // Any additional info regarding the event
168 string add_info = 5;
169}
170
171service NativeEventsManagementService {
172
173 // List the supported events for the passed device
174 rpc ListEvents(HardwareID) returns(ListEventsResponse);
175
176 // Updates the configuration of the list of events in the request
aghoshc301dcd2020-09-03 16:55:34 +0100177 // The default behavior of the device is to report all the supported events
Amit Ghosh09f28362020-06-12 21:52:19 +0100178 // This configuration is persisted across reboots of the device or the device manager
179 rpc UpdateEventsConfiguration(EventsConfigurationRequest) returns(EventsConfigurationResponse);
Chandrakanth Nalkudre Gowda68590a42021-04-22 15:19:21 +0530180
181 // Initiate the server streaming of the events
182 rpc StreamEvents(google.protobuf.Empty) returns(stream Event);
Amit Ghosh09f28362020-06-12 21:52:19 +0100183}