blob: 6c93a0274549617aeb38c990ce3f3c43b2748315 [file] [log] [blame]
Zack Williams52209662019-02-07 10:15:31 -07001syntax = "proto3";
2
William Kurkian6ea97f82019-03-13 15:51:55 -04003option go_package = "github.com/opencord/voltha-protos/go/voltha";
Zack Williams52209662019-02-07 10:15:31 -07004
5package voltha;
6
7import "voltha_protos/meta.proto";
8import "google/api/annotations.proto";
9
10message ConfigEventType {
11 enum ConfigEventType {
12 add = 0; // A new config has been added
13 remove = 1; // A config has been removed
14 update = 2; // A config has been updated
15 }
16}
17
18message ConfigEvent {
19 ConfigEventType.ConfigEventType type = 1;
20
21 string hash = 2; // hash for this change, can be used for quick lookup
22 string data = 3; // the actual new data, in json format
23}
24
25message KpiEventType {
26 enum KpiEventType {
27 slice = 0; // slice: a set of path/metric data for same time-stamp
28 ts = 1; // time-series: array of data for same metric
29 }
30}
31
32/*
33 * Struct to convey a dictionary of metric metadata.
34 */
35message MetricMetaData {
36 string title = 1; // Metric group or individual metric name
37 double ts = 2; // UTC time-stamp of data (seconds since epoch) of
38 // when the metric or metric group was collected.
39 // If this is a 15-min historical group, it is the
40 // time of the collection and reporting, not the
41 // start or end of the 15-min group interval.
42
43 string logical_device_id = 3; // The logical device ID of the VOLTHA
44 // (equivalent to the DPID that ONOS has
45 // for the VOLTHA device without the
46 // 'of:' prefix
47 string serial_no = 4; // The OLT, ONU, ... device serial number
48 string device_id = 5; // The OLT, ONU, ... physical device ID
49
50 map<string, string> context = 6; // Name value pairs that provide additional
51 // context information on the metrics being
52 // reported.
53}
54
55/*
56 * Struct to convey a dictionary of metric->value pairs. Typically used in
57 * pure shared-timestamp or shared-timestamp + shared object prefix situations.
58 */
59message MetricValuePairs {
60
61 // Metric / value pairs.
62 map<string, float> metrics = 1;
63
64}
65
66/*
67 * Struct to group metadata for a metric (or group of metrics) with the key-value
68 * pairs of collected metrics
69 */
70message MetricInformation {
71 MetricMetaData metadata = 1;
72 map<string, float> metrics = 2;
73}
74
75/*
76 * Legacy KPI Event structured. In mid-August, the KPI event format was updated
77 * to a more easily parsable format. See VOL-1140
78 * for more information.
79 */
80message KpiEvent {
81
82 KpiEventType.KpiEventType type = 1;
83
84 // Fields used when for slice:
85
86 float ts = 2; // UTC time-stamp of data in slice mode (seconds since epoc)
87
88 map<string, MetricValuePairs> prefixes = 3;
89
90}
91
92message KpiEvent2 {
93 // Type of KPI Event
94 KpiEventType.KpiEventType type = 1;
95
96 // Fields used when for slice:
97 double ts = 2; // UTC time-stamp of data in slice mode (seconds since epoch)
98 // of the time this entire KpiEvent was published to the kafka bus
99
100 repeated MetricInformation slice_data = 3;
101}
102
103/*
104 * Identify to the area of the system impacted by the alarm
Devmalya Paulf98ca132019-07-09 06:14:19 -0400105 * To be deprecated once python version of OpenOLT adapter
106 * moves to the new event defination for device alarms
Zack Williams52209662019-02-07 10:15:31 -0700107 */
108message AlarmEventType {
109 enum AlarmEventType {
110 COMMUNICATION = 0;
111 ENVIRONMENT = 1;
112 EQUIPMENT = 2;
113 SERVICE = 3;
114 PROCESSING = 4;
115 SECURITY = 5;
116 }
117}
118
119/*
120 * Identify to the functional category originating the alarm
Devmalya Paulf98ca132019-07-09 06:14:19 -0400121 * To be deprecated once python version of OpenOLT adapter
122 * as well as OpenONU adapter moves to the new event
123 * defination for device alarms
Zack Williams52209662019-02-07 10:15:31 -0700124 */
125message AlarmEventCategory {
126 enum AlarmEventCategory {
127 PON = 0;
128 OLT = 1;
129 ONT = 2;
130 ONU = 3;
131 NNI = 4;
132 }
133}
134
135/*
136 * Active state of the alarm
Devmalya Paulf98ca132019-07-09 06:14:19 -0400137 * To be deprecated once python version of OpenOLT adapter
138 * as well as OpenONU adapter moves to the new event
139 * defination for device alarms
Zack Williams52209662019-02-07 10:15:31 -0700140 */
141message AlarmEventState {
142 enum AlarmEventState {
143 RAISED = 0;
144 CLEARED = 1;
145 }
146}
147
148/*
149 * Identify the overall impact of the alarm on the system
Devmalya Paulf98ca132019-07-09 06:14:19 -0400150 * To be deprecated once python version of OpenOLT adapter
151 * as well as OpenONU adapter moves to the new event
152 * defination for device alarms
Zack Williams52209662019-02-07 10:15:31 -0700153 */
154message AlarmEventSeverity {
155 enum AlarmEventSeverity {
156 INDETERMINATE = 0;
157 WARNING = 1;
158 MINOR = 2;
159 MAJOR = 3;
160 CRITICAL = 4;
161 }
162}
163
164/*
Devmalya Paulf98ca132019-07-09 06:14:19 -0400165 * To be deprecated once python version of OpenOLT adapter
166 * as well as OpenONU adapter moves to the new event
167 * defination for device alarms
Zack Williams52209662019-02-07 10:15:31 -0700168 */
169message AlarmEvent {
170 // Unique ID for this alarm. e.g. voltha.some_olt.1234
171 string id = 1;
172
173 // Refers to the area of the system impacted by the alarm
174 AlarmEventType.AlarmEventType type = 2;
175
176 // Refers to functional category of the alarm
177 AlarmEventCategory.AlarmEventCategory category = 3;
178
179 // Current active state of the alarm
180 AlarmEventState.AlarmEventState state = 4;
181
182 // Overall impact of the alarm on the system
183 AlarmEventSeverity.AlarmEventSeverity severity = 5;
184
185 // Timestamp at which the alarm was first raised
186 float raised_ts = 6;
187
188 // Timestamp at which the alarm was reported
189 float reported_ts = 7;
190
191 // Timestamp at which the alarm has changed since it was raised
192 float changed_ts = 8;
193
194 // Identifier of the originating resource of the alarm
195 string resource_id = 9;
196
197 // Textual explanation of the alarm
198 string description = 10;
199
200 // Key/Value storage for extra information that may give context to the alarm
201 map<string, string> context = 11;
202
203 // logical device id
204 string logical_device_id = 12;
205
206 // alarm_type name indicates clearly the name of the alarm
207 string alarm_type_name = 13;
208}
Devmalya Paulf98ca132019-07-09 06:14:19 -0400209/*
210 * Describes the events specific to device
211 */
212message DeviceEvent {
213 // Identifier of the originating resource of the event, for ex: device_id
214 string resource_id = 1;
215
216 // device_event_name indicates clearly the name of the device event
217 string device_event_name = 2;
218
219 // Textual explanation of the device event
220 string description = 3;
221
222 // Key/Value storage for extra information that may give context to the event
223 map<string, string> context = 4;
224
225}
226
227/*
228 * Identify the area of the system impacted by the event.
229 */
230message EventCategory {
231 enum EventCategory {
232 COMMUNICATION = 0;
233 ENVIRONMENT = 1;
234 EQUIPMENT = 2;
235 SERVICE = 3;
236 PROCESSING = 4;
237 SECURITY = 5;
238 // Add new event areas here
239 }
240}
241
242/*
243 * Identify the functional category originating the event
244 */
245message EventSubCategory {
246 enum EventSubCategory {
247 PON = 0;
248 OLT = 1;
249 ONT = 2;
250 ONU = 3;
251 NNI = 4;
252 // Add new event categories here.
253 }
254}
255
256/*
257 * Identify the type of event
258*/
259message EventType {
260 enum EventType {
261 CONFIG_EVENT = 0;
262 KPI_EVENT = 1;
263 KPI_EVENT2 = 2;
264 DEVICE_EVENT = 3;
265
266 }
267}
268
269/*
270 * Identify the functional category originating the event
271 */
272message EventHeader {
273 // Unique ID for this event. e.g. voltha.some_olt.1234
274 string id = 1;
275
276 // Refers to the functional area affect by the event
277 EventCategory.EventCategory category = 2;
278
279 // Refers to functional category of the event
280 EventSubCategory.EventSubCategory sub_category = 3;
281
282 // Refers to the type of the event
283 EventType.EventType type = 4;
284
285 // The version identifier for this event type, thus allowing each
286 // event type to evolve independently. The version should be in the
287 // format “MAJOR.MINOR” format and minor changes must only be additive
288 // and non-breaking.
289 string type_version = 5;
290
291 // Timestamp at which the event was first raised.
292 // This represents the UTC time stamp since epoch (in seconds) when the
293 // the event was first raised from the source entity.
294 // If the source entity doesn't send the raised_ts, this shall be set
295 // to timestamp when the event was received.
296 float raised_ts = 6;
297
298 // Timestamp at which the event was reported.
299 // This represents the UTC time stamp since epoch (in seconds) when the
300 // the event was reported (this time stamp is >= raised_ts).
301 // If the source entity that reported this event doesn't send the
302 // reported_ts, this shall be set to the same value as raised_ts.
303 float reported_ts = 7;
304
305
306}
307
308/*
309 * Event Structure
310 */
311message Event {
312 // event header
313 EventHeader header = 1;
314
315 // oneof event types referred by EventType.
316 oneof event_type {
317 // Refers to ConfigEvent
318 ConfigEvent config_event = 2;
319
320 // Refers to KpiEvent
321 KpiEvent kpi_event = 3;
322
323 // Refers to KpiEvent2
324 KpiEvent2 kpi_event2 = 4;
325
326 // Refers to DeviceEvent
327 DeviceEvent device_event = 5;
328
329 // Add other event types here.
330
331 }
332}
333