blob: 2865de13b65a6be0e704797b1f522919233bc4ce [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
70 // More to be added
71}
72
73message ValueType {
74 oneof val{
75 int64 int_val = 1;
76 uint64 uint_val = 2;
77 float float_val = 3;
78 }
79}
80
81message WaterMarks {
82 ValueType high = 1;
83 ValueType low = 2;
84}
85
86message Thresholds {
87 oneof threshold {
88 WaterMarks upper = 1;
89 WaterMarks lower = 2;
90 }
91}
92
93message ThresholdInformation {
94 ValueType observed_value = 1;
95 Thresholds thresholds = 2;
96}
97
98message 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
105message EventsCfg {
106 repeated EventCfg items = 1;
107}
108
109message ListEventsResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100110 enum Reason {
111 UNDEFINED_REASON = 0;
112 UNKNOWN_DEVICE = 1;
113 INTERNAL_ERROR = 2;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100114 DEVICE_UNREACHABLE = 3;
amit.ghoshae473032021-01-10 11:59:10 +0100115 }
Amit Ghosh09f28362020-06-12 21:52:19 +0100116 Status status = 1;
117 Reason reason = 2;
118 EventsCfg events = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100119 string reason_detail = 4;
Amit Ghosh09f28362020-06-12 21:52:19 +0100120}
121
122message EventsConfigurationRequest {
123 Uuid device_uuid = 1;
124 oneof operation {
125 EventsCfg changes = 2;
126 bool reset_to_default = 3;
127 }
128}
129
130message EventsConfigurationResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100131 enum Reason {
132 UNDEFINED_REASON = 0;
133 UNKNOWN_DEVICE = 1;
134 INTERNAL_ERROR = 2;
135 INVALID_CONFIG = 3;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100136 DEVICE_UNREACHABLE = 4;
amit.ghoshae473032021-01-10 11:59:10 +0100137 }
Amit Ghosh09f28362020-06-12 21:52:19 +0100138 Status status = 1;
139 Reason reason = 2;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100140 string reason_detail = 3;
Amit Ghosh09f28362020-06-12 21:52:19 +0100141}
142
143message 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 Gowda68590a42021-04-22 15:19:21 +0530150// 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 Ghosh09f28362020-06-12 21:52:19 +0100152// configuration of the components
153
154message 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
164service 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
aghoshc301dcd2020-09-03 16:55:34 +0100170 // The default behavior of the device is to report all the supported events
Amit Ghosh09f28362020-06-12 21:52:19 +0100171 // This configuration is persisted across reboots of the device or the device manager
172 rpc UpdateEventsConfiguration(EventsConfigurationRequest) returns(EventsConfigurationResponse);
Chandrakanth Nalkudre Gowda68590a42021-04-22 15:19:21 +0530173
174 // Initiate the server streaming of the events
175 rpc StreamEvents(google.protobuf.Empty) returns(stream Event);
Amit Ghosh09f28362020-06-12 21:52:19 +0100176}