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