blob: 6911df39f11002f1d93df20cb828154eeb1e339b [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";
9
10// Management of Events and protos for encoding of Events
11
12enum EventIds {
13 EVENT_NAME_UNDEFINED = 0;
14
15 // Events from the Transceivers
16 EVENT_TRANSCEIVER_PLUG_OUT = 100;
17 EVENT_TRANSCEIVER_PLUG_IN = 101;
18 EVENT_TRANSCEIVER_VOLTAGE_ABOVE_THRESHOLD = 102;
19 EVENT_TRANSCEIVER_VOLTAGE_BELOW_THRESHOLD = 103;
20 EVENT_TRANSCEIVER_TEMPERATURE_ABOVE_THRESHOLD = 104;
21 EVENT_TRANSCEIVER_TEMPERATURE_BELOW_THRESHOLD = 105;
22 EVENT_TRANSCEIVER_CURRENT_ABOVE_THRESHOLD = 106;
23 EVENT_TRANSCEIVER_CURRENT_BELOW_THRESHOLD = 107;
24 EVENT_TRANSCEIVER_RX_POWER_ABOVE_THRESHOLD = 108;
25 EVENT_TRANSCEIVER_RX_POWER_BELOW_THRESHOLD = 109;
26 EVENT_TRANSCEIVER_TX_POWER_ABOVE_THRESHOLD = 110;
27 EVENT_TRANSCEIVER_TX_POWER_BELOW_THRESHOLD = 111;
28 EVENT_TRANSCEIVER_FAILURE = 112;
29
30 // Events from the PSU
31 EVENT_PSU_PLUG_OUT = 200;
32 EVENT_PSU_PLUG_IN = 201;
33 EVENT_PSU_FAILURE = 202;
34
35 // Events for the Fans
36 EVENT_FAN_FAILURE = 300;
37 EVENT_FAN_PLUG_OUT = 301;
38 EVENT_FAN_PLUG_IN = 302;
39
40 // Events for the CPUs
41 EVENT_CPU_TEMPERATURE_ABOVE_CRITICAL = 400;
42 EVENT_CPU_TEMPERATURE_ABOVE_FATAL = 401;
43
44 // Events for the complete HW Device
45 EVENT_HW_DEVICE_RESET = 500;
46 EVENT_HW_DEVICE_TEMPERATURE_ABOVE_CRITICAL = 501;
47 EVENT_HW_DEVICE_TEMPERATURE_ABOVE_FATAL = 502;
48
49 // More to be added
50}
51
52message ValueType {
53 oneof val{
54 int64 int_val = 1;
55 uint64 uint_val = 2;
56 float float_val = 3;
57 }
58}
59
60message WaterMarks {
61 ValueType high = 1;
62 ValueType low = 2;
63}
64
65message Thresholds {
66 oneof threshold {
67 WaterMarks upper = 1;
68 WaterMarks lower = 2;
69 }
70}
71
72message ThresholdInformation {
73 ValueType observed_value = 1;
74 Thresholds thresholds = 2;
75}
76
77message EventCfg {
78 EventIds event_id = 1;
79 bool is_configured = 2;
80 // Optional threshold values, applicable only for some specific events
81 Thresholds thresholds = 3;
82}
83
84message EventsCfg {
85 repeated EventCfg items = 1;
86}
87
88message ListEventsResponse {
89 Status status = 1;
90 Reason reason = 2;
91 EventsCfg events = 3;
92}
93
94message EventsConfigurationRequest {
95 Uuid device_uuid = 1;
96 oneof operation {
97 EventsCfg changes = 2;
98 bool reset_to_default = 3;
99 }
100}
101
102message EventsConfigurationResponse {
103 Status status = 1;
104 Reason reason = 2;
105}
106
107message EventMetaData {
108 Uuid device_uuid = 1;
109 // uuid of the component
110 Uuid component_uuid = 2;
111 string component_name = 3;
112}
113
114// The Events are conveyed to external systems by submitting them on a kafka bus.
115// The topic to which are Events are submitted would be configured as startup
116// configuration of the components
117
118message Event {
119 EventMetaData event_metadata = 1;
120 EventIds event_id = 2;
121 google.protobuf.Timestamp raised_ts = 3;
122 // Optional threshold information for an event
123 ThresholdInformation threshold_info = 4;
124 // Any additional info regarding the event
125 string add_info = 5;
126}
127
128service NativeEventsManagementService {
129
130 // List the supported events for the passed device
131 rpc ListEvents(HardwareID) returns(ListEventsResponse);
132
133 // Updates the configuration of the list of events in the request
134 // The default behaviour of the device is to report all the supported events
135 // This configuration is persisted across reboots of the device or the device manager
136 rpc UpdateEventsConfiguration(EventsConfigurationRequest) returns(EventsConfigurationResponse);
137}