blob: 937680500b9d55a3f666f5d588c23e0ec68513e6 [file] [log] [blame]
Zack Williams52209662019-02-07 10:15:31 -07001syntax = "proto3";
2
khenaidoo5fc5cea2021-08-11 17:39:16 -04003option go_package = "github.com/opencord/voltha-protos/v5/go/voltha";
khenaidoo4c6543e2021-10-19 17:25:58 -04004option java_package = "org.opencord.voltha.events";
Zack Williams52209662019-02-07 10:15:31 -07005
khenaidoo4c6543e2021-10-19 17:25:58 -04006package event;
Zack Williams52209662019-02-07 10:15:31 -07007
Zack Williams52209662019-02-07 10:15:31 -07008import "google/api/annotations.proto";
Scott Baker7c854aa2020-02-10 17:25:31 -08009import "google/protobuf/timestamp.proto";
Himani Chawla9499e952020-12-17 13:12:52 +053010import "voltha_protos/common.proto";
Zack Williams52209662019-02-07 10:15:31 -070011
khenaidoo4c6543e2021-10-19 17:25:58 -040012
13message EventFilterRuleKey {
14
15 enum EventFilterRuleType {
16 filter_all = 0;
17 category = 1;
18 sub_category = 2;
19 kpi_event_type = 3;
20 config_event_type = 4;
21 device_event_type = 5;
22 }
23}
24
25message EventFilterRule {
26 EventFilterRuleKey.EventFilterRuleType key = 1;
27 string value = 2;
28}
29message EventFilter {
30 string id = 1 ;
31 bool enable = 2;
32 string device_id = 3;
33 string event_type = 4;
34 repeated EventFilterRule rules = 5;
35}
36
37message EventFilters {
38 repeated EventFilter filters = 1;
39}
40
Zack Williams52209662019-02-07 10:15:31 -070041message ConfigEventType {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +030042 enum Types {
Zack Williams52209662019-02-07 10:15:31 -070043 add = 0; // A new config has been added
44 remove = 1; // A config has been removed
45 update = 2; // A config has been updated
46 }
47}
48
49message ConfigEvent {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +030050 ConfigEventType.Types type = 1;
Zack Williams52209662019-02-07 10:15:31 -070051
52 string hash = 2; // hash for this change, can be used for quick lookup
53 string data = 3; // the actual new data, in json format
54}
55
56message KpiEventType {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +030057 enum Types {
Zack Williams52209662019-02-07 10:15:31 -070058 slice = 0; // slice: a set of path/metric data for same time-stamp
59 ts = 1; // time-series: array of data for same metric
60 }
61}
62
63/*
64 * Struct to convey a dictionary of metric metadata.
65 */
66message MetricMetaData {
Himani Chawla9499e952020-12-17 13:12:52 +053067 string title = 1; // Metric group or individual metric name
68 double ts = 2; // UTC time-stamp of data (seconds since epoch) of
69 // when the metric or metric group was collected.
70 // If this is a 15-min historical group, it is the
71 // time of the collection and reporting, not the
72 // start or end of the 15-min group interval.
Zack Williams52209662019-02-07 10:15:31 -070073
74 string logical_device_id = 3; // The logical device ID of the VOLTHA
Himani Chawla9499e952020-12-17 13:12:52 +053075 // (equivalent to the DPID that ONOS has
76 // for the VOLTHA device without the
77 // 'of:' prefix
78 string serial_no = 4; // The OLT, ONU, ... device serial number
79 string device_id = 5; // The OLT, ONU, ... physical device ID
Zack Williams52209662019-02-07 10:15:31 -070080
81 map<string, string> context = 6; // Name value pairs that provide additional
Himani Chawla9499e952020-12-17 13:12:52 +053082 // context information on the metrics being
83 // reported.
onkar.kundargi7b85fa12020-02-27 13:19:22 +053084
Himani Chawla9499e952020-12-17 13:12:52 +053085 string uuid = 7; // Transaction identifier used to match On
86 // Demand gRPC requests with kafka responses
Zack Williams52209662019-02-07 10:15:31 -070087}
88
89/*
90 * Struct to convey a dictionary of metric->value pairs. Typically used in
91 * pure shared-timestamp or shared-timestamp + shared object prefix situations.
92 */
93message MetricValuePairs {
94
95 // Metric / value pairs.
96 map<string, float> metrics = 1;
97
98}
99
100/*
101 * Struct to group metadata for a metric (or group of metrics) with the key-value
102 * pairs of collected metrics
103 */
104message MetricInformation {
105 MetricMetaData metadata = 1;
106 map<string, float> metrics = 2;
107}
108
109/*
110 * Legacy KPI Event structured. In mid-August, the KPI event format was updated
111 * to a more easily parsable format. See VOL-1140
112 * for more information.
113 */
114message KpiEvent {
115
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300116 KpiEventType.Types type = 1;
Zack Williams52209662019-02-07 10:15:31 -0700117
118 // Fields used when for slice:
119
120 float ts = 2; // UTC time-stamp of data in slice mode (seconds since epoc)
121
122 map<string, MetricValuePairs> prefixes = 3;
123
124}
125
126message KpiEvent2 {
127 // Type of KPI Event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300128 KpiEventType.Types type = 1;
Zack Williams52209662019-02-07 10:15:31 -0700129
130 // Fields used when for slice:
Himani Chawla9499e952020-12-17 13:12:52 +0530131 double ts = 2; // UTC time-stamp of data in slice mode (seconds since epoch)
132 // of the time this entire KpiEvent was published to the kafka bus
Zack Williams52209662019-02-07 10:15:31 -0700133
134 repeated MetricInformation slice_data = 3;
135}
136
137/*
Devmalya Paulf98ca132019-07-09 06:14:19 -0400138 * Describes the events specific to device
139 */
140message DeviceEvent {
141 // Identifier of the originating resource of the event, for ex: device_id
142 string resource_id = 1;
143
144 // device_event_name indicates clearly the name of the device event
145 string device_event_name = 2;
146
147 // Textual explanation of the device event
148 string description = 3;
149
150 // Key/Value storage for extra information that may give context to the event
151 map<string, string> context = 4;
152
153}
Himani Chawla9499e952020-12-17 13:12:52 +0530154/*
155 * Describes the events specific to an RPC request
156 */
157message RPCEvent {
158 // RPC name
159 string rpc = 1;
160
161 // The operation id of that request. Can be a log correlation ID
162 string operation_id = 2;
163
164 // Identifies the service name originating the event
165 string service = 3;
166
167 // Identifies the stack originating the event
168 string stack_id = 4;
169
170 // Identifies the resource upon which the action is taken, e.g. device_id
171 string resource_id = 5;
172
173 // Textual explanation of the event
174 string description = 6;
175
176 // Key/Value storage for extra information that may give context to the event
177 map<string, string> context = 7;
178
179 // Status of the RPC Event
180 common.OperationResp status = 8;
181}
Devmalya Paulf98ca132019-07-09 06:14:19 -0400182
183/*
184 * Identify the area of the system impacted by the event.
185 */
186message EventCategory {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300187 enum Types {
Devmalya Paulf98ca132019-07-09 06:14:19 -0400188 COMMUNICATION = 0;
189 ENVIRONMENT = 1;
190 EQUIPMENT = 2;
191 SERVICE = 3;
192 PROCESSING = 4;
193 SECURITY = 5;
194 // Add new event areas here
195 }
196}
197
198/*
199 * Identify the functional category originating the event
200 */
201message EventSubCategory {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300202 enum Types {
Devmalya Paulf98ca132019-07-09 06:14:19 -0400203 PON = 0;
204 OLT = 1;
205 ONT = 2;
206 ONU = 3;
207 NNI = 4;
Himani Chawla78c19ec2021-01-18 18:07:40 +0530208 NONE = 5; //Adding None for RPC Events
Devmalya Paulf98ca132019-07-09 06:14:19 -0400209 // Add new event categories here.
210 }
211}
212
213/*
214 * Identify the type of event
215*/
216message EventType {
Himani Chawla9499e952020-12-17 13:12:52 +0530217 enum Types {
218 CONFIG_EVENT = 0;
219 KPI_EVENT = 1;
220 KPI_EVENT2 = 2;
221 DEVICE_EVENT = 3;
222 RPC_EVENT = 4;
223 }
Devmalya Paulf98ca132019-07-09 06:14:19 -0400224}
225
226/*
227 * Identify the functional category originating the event
228 */
229message EventHeader {
230 // Unique ID for this event. e.g. voltha.some_olt.1234
231 string id = 1;
232
233 // Refers to the functional area affect by the event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300234 EventCategory.Types category = 2;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400235
236 // Refers to functional category of the event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300237 EventSubCategory.Types sub_category = 3;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400238
239 // Refers to the type of the event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300240 EventType.Types type = 4;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400241
242 // The version identifier for this event type, thus allowing each
243 // event type to evolve independently. The version should be in the
244 // format “MAJOR.MINOR” format and minor changes must only be additive
245 // and non-breaking.
246 string type_version = 5;
247
248 // Timestamp at which the event was first raised.
249 // This represents the UTC time stamp since epoch (in seconds) when the
250 // the event was first raised from the source entity.
251 // If the source entity doesn't send the raised_ts, this shall be set
252 // to timestamp when the event was received.
Scott Baker7c854aa2020-02-10 17:25:31 -0800253 google.protobuf.Timestamp raised_ts = 6;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400254
255 // Timestamp at which the event was reported.
256 // This represents the UTC time stamp since epoch (in seconds) when the
257 // the event was reported (this time stamp is >= raised_ts).
258 // If the source entity that reported this event doesn't send the
259 // reported_ts, this shall be set to the same value as raised_ts.
Scott Baker7c854aa2020-02-10 17:25:31 -0800260 google.protobuf.Timestamp reported_ts = 7;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400261}
262
263/*
264 * Event Structure
265 */
266message Event {
267 // event header
268 EventHeader header = 1;
269
270 // oneof event types referred by EventType.
271 oneof event_type {
272 // Refers to ConfigEvent
273 ConfigEvent config_event = 2;
274
275 // Refers to KpiEvent
Himani Chawla9499e952020-12-17 13:12:52 +0530276 KpiEvent kpi_event = 3;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400277
278 // Refers to KpiEvent2
Himani Chawla9499e952020-12-17 13:12:52 +0530279 KpiEvent2 kpi_event2 = 4;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400280
281 // Refers to DeviceEvent
282 DeviceEvent device_event = 5;
283
Himani Chawla9499e952020-12-17 13:12:52 +0530284 // Refers to an RPC Event
285 RPCEvent rpc_event = 6;
286
Devmalya Paulf98ca132019-07-09 06:14:19 -0400287 // Add other event types here.
288
289 }
290}
291