blob: 130c6b3acb5ea8544e18155874d1e4cdaaa041d1 [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 Ghosh09f28362020-06-12 21:52:19 +010067
68 // More to be added
69}
70
71message ValueType {
72 oneof val{
73 int64 int_val = 1;
74 uint64 uint_val = 2;
75 float float_val = 3;
76 }
77}
78
79message WaterMarks {
80 ValueType high = 1;
81 ValueType low = 2;
82}
83
84message Thresholds {
85 oneof threshold {
86 WaterMarks upper = 1;
87 WaterMarks lower = 2;
88 }
89}
90
91message ThresholdInformation {
92 ValueType observed_value = 1;
93 Thresholds thresholds = 2;
94}
95
96message EventCfg {
97 EventIds event_id = 1;
98 bool is_configured = 2;
99 // Optional threshold values, applicable only for some specific events
100 Thresholds thresholds = 3;
101}
102
103message EventsCfg {
104 repeated EventCfg items = 1;
105}
106
107message ListEventsResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100108 enum Reason {
109 UNDEFINED_REASON = 0;
110 UNKNOWN_DEVICE = 1;
111 INTERNAL_ERROR = 2;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100112 DEVICE_UNREACHABLE = 3;
amit.ghoshae473032021-01-10 11:59:10 +0100113 }
Amit Ghosh09f28362020-06-12 21:52:19 +0100114 Status status = 1;
115 Reason reason = 2;
116 EventsCfg events = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100117 string reason_detail = 4;
Amit Ghosh09f28362020-06-12 21:52:19 +0100118}
119
120message EventsConfigurationRequest {
121 Uuid device_uuid = 1;
122 oneof operation {
123 EventsCfg changes = 2;
124 bool reset_to_default = 3;
125 }
126}
127
128message EventsConfigurationResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100129 enum Reason {
130 UNDEFINED_REASON = 0;
131 UNKNOWN_DEVICE = 1;
132 INTERNAL_ERROR = 2;
133 INVALID_CONFIG = 3;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100134 DEVICE_UNREACHABLE = 4;
amit.ghoshae473032021-01-10 11:59:10 +0100135 }
Amit Ghosh09f28362020-06-12 21:52:19 +0100136 Status status = 1;
137 Reason reason = 2;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100138 string reason_detail = 3;
Amit Ghosh09f28362020-06-12 21:52:19 +0100139}
140
141message EventMetaData {
142 Uuid device_uuid = 1;
143 // uuid of the component
144 Uuid component_uuid = 2;
145 string component_name = 3;
146}
147
Chandrakanth Nalkudre Gowda68590a42021-04-22 15:19:21 +0530148// The Events are conveyed to external systems either by submitting them on a message bus or using gRPC server streaming.
149// The message bus topic to which are Events are submitted would be configured as startup
Amit Ghosh09f28362020-06-12 21:52:19 +0100150// configuration of the components
151
152message Event {
153 EventMetaData event_metadata = 1;
154 EventIds event_id = 2;
155 google.protobuf.Timestamp raised_ts = 3;
156 // Optional threshold information for an event
157 ThresholdInformation threshold_info = 4;
158 // Any additional info regarding the event
159 string add_info = 5;
160}
161
162service NativeEventsManagementService {
163
164 // List the supported events for the passed device
165 rpc ListEvents(HardwareID) returns(ListEventsResponse);
166
167 // Updates the configuration of the list of events in the request
aghoshc301dcd2020-09-03 16:55:34 +0100168 // The default behavior of the device is to report all the supported events
Amit Ghosh09f28362020-06-12 21:52:19 +0100169 // This configuration is persisted across reboots of the device or the device manager
170 rpc UpdateEventsConfiguration(EventsConfigurationRequest) returns(EventsConfigurationResponse);
Chandrakanth Nalkudre Gowda68590a42021-04-22 15:19:21 +0530171
172 // Initiate the server streaming of the events
173 rpc StreamEvents(google.protobuf.Empty) returns(stream Event);
Amit Ghosh09f28362020-06-12 21:52:19 +0100174}