blob: e33b45c2b57dd5a5e24c2b170f34a49b7ea2273f [file] [log] [blame]
Zack Williams52209662019-02-07 10:15:31 -07001syntax = "proto3";
2
Matteo Scandolob3c08ae2020-10-14 13:15:43 -07003option go_package = "github.com/opencord/voltha-protos/v4/go/voltha";
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +03004option java_package = "org.opencord.voltha";
Zack Williams52209662019-02-07 10:15:31 -07005
6package voltha;
7
8import "voltha_protos/meta.proto";
9import "google/api/annotations.proto";
Scott Baker7c854aa2020-02-10 17:25:31 -080010import "google/protobuf/timestamp.proto";
Zack Williams52209662019-02-07 10:15:31 -070011
12message ConfigEventType {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +030013 enum Types {
Zack Williams52209662019-02-07 10:15:31 -070014 add = 0; // A new config has been added
15 remove = 1; // A config has been removed
16 update = 2; // A config has been updated
17 }
18}
19
20message ConfigEvent {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +030021 ConfigEventType.Types type = 1;
Zack Williams52209662019-02-07 10:15:31 -070022
23 string hash = 2; // hash for this change, can be used for quick lookup
24 string data = 3; // the actual new data, in json format
25}
26
27message KpiEventType {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +030028 enum Types {
Zack Williams52209662019-02-07 10:15:31 -070029 slice = 0; // slice: a set of path/metric data for same time-stamp
30 ts = 1; // time-series: array of data for same metric
31 }
32}
33
34/*
35 * Struct to convey a dictionary of metric metadata.
36 */
37message MetricMetaData {
38 string title = 1; // Metric group or individual metric name
39 double ts = 2; // UTC time-stamp of data (seconds since epoch) of
40 // when the metric or metric group was collected.
41 // If this is a 15-min historical group, it is the
42 // time of the collection and reporting, not the
43 // start or end of the 15-min group interval.
44
45 string logical_device_id = 3; // The logical device ID of the VOLTHA
46 // (equivalent to the DPID that ONOS has
47 // for the VOLTHA device without the
48 // 'of:' prefix
49 string serial_no = 4; // The OLT, ONU, ... device serial number
50 string device_id = 5; // The OLT, ONU, ... physical device ID
51
52 map<string, string> context = 6; // Name value pairs that provide additional
53 // context information on the metrics being
54 // reported.
onkar.kundargi7b85fa12020-02-27 13:19:22 +053055
56 string uuid = 7; // Transaction identifier used to match On
57 // Demand gRPC requests with kafka responses
Zack Williams52209662019-02-07 10:15:31 -070058}
59
60/*
61 * Struct to convey a dictionary of metric->value pairs. Typically used in
62 * pure shared-timestamp or shared-timestamp + shared object prefix situations.
63 */
64message MetricValuePairs {
65
66 // Metric / value pairs.
67 map<string, float> metrics = 1;
68
69}
70
71/*
72 * Struct to group metadata for a metric (or group of metrics) with the key-value
73 * pairs of collected metrics
74 */
75message MetricInformation {
76 MetricMetaData metadata = 1;
77 map<string, float> metrics = 2;
78}
79
80/*
81 * Legacy KPI Event structured. In mid-August, the KPI event format was updated
82 * to a more easily parsable format. See VOL-1140
83 * for more information.
84 */
85message KpiEvent {
86
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +030087 KpiEventType.Types type = 1;
Zack Williams52209662019-02-07 10:15:31 -070088
89 // Fields used when for slice:
90
91 float ts = 2; // UTC time-stamp of data in slice mode (seconds since epoc)
92
93 map<string, MetricValuePairs> prefixes = 3;
94
95}
96
97message KpiEvent2 {
98 // Type of KPI Event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +030099 KpiEventType.Types type = 1;
Zack Williams52209662019-02-07 10:15:31 -0700100
101 // Fields used when for slice:
102 double ts = 2; // UTC time-stamp of data in slice mode (seconds since epoch)
103 // of the time this entire KpiEvent was published to the kafka bus
104
105 repeated MetricInformation slice_data = 3;
106}
107
108/*
Devmalya Paulf98ca132019-07-09 06:14:19 -0400109 * Describes the events specific to device
110 */
111message DeviceEvent {
112 // Identifier of the originating resource of the event, for ex: device_id
113 string resource_id = 1;
114
115 // device_event_name indicates clearly the name of the device event
116 string device_event_name = 2;
117
118 // Textual explanation of the device event
119 string description = 3;
120
121 // Key/Value storage for extra information that may give context to the event
122 map<string, string> context = 4;
123
124}
125
126/*
127 * Identify the area of the system impacted by the event.
128 */
129message EventCategory {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300130 enum Types {
Devmalya Paulf98ca132019-07-09 06:14:19 -0400131 COMMUNICATION = 0;
132 ENVIRONMENT = 1;
133 EQUIPMENT = 2;
134 SERVICE = 3;
135 PROCESSING = 4;
136 SECURITY = 5;
137 // Add new event areas here
138 }
139}
140
141/*
142 * Identify the functional category originating the event
143 */
144message EventSubCategory {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300145 enum Types {
Devmalya Paulf98ca132019-07-09 06:14:19 -0400146 PON = 0;
147 OLT = 1;
148 ONT = 2;
149 ONU = 3;
150 NNI = 4;
151 // Add new event categories here.
152 }
153}
154
155/*
156 * Identify the type of event
157*/
158message EventType {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300159 enum Types {
Devmalya Paulf98ca132019-07-09 06:14:19 -0400160 CONFIG_EVENT = 0;
161 KPI_EVENT = 1;
162 KPI_EVENT2 = 2;
163 DEVICE_EVENT = 3;
164
165 }
166}
167
168/*
169 * Identify the functional category originating the event
170 */
171message EventHeader {
172 // Unique ID for this event. e.g. voltha.some_olt.1234
173 string id = 1;
174
175 // Refers to the functional area affect by the event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300176 EventCategory.Types category = 2;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400177
178 // Refers to functional category of the event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300179 EventSubCategory.Types sub_category = 3;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400180
181 // Refers to the type of the event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300182 EventType.Types type = 4;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400183
184 // The version identifier for this event type, thus allowing each
185 // event type to evolve independently. The version should be in the
186 // format “MAJOR.MINOR” format and minor changes must only be additive
187 // and non-breaking.
188 string type_version = 5;
189
190 // Timestamp at which the event was first raised.
191 // This represents the UTC time stamp since epoch (in seconds) when the
192 // the event was first raised from the source entity.
193 // If the source entity doesn't send the raised_ts, this shall be set
194 // to timestamp when the event was received.
Scott Baker7c854aa2020-02-10 17:25:31 -0800195 google.protobuf.Timestamp raised_ts = 6;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400196
197 // Timestamp at which the event was reported.
198 // This represents the UTC time stamp since epoch (in seconds) when the
199 // the event was reported (this time stamp is >= raised_ts).
200 // If the source entity that reported this event doesn't send the
201 // reported_ts, this shall be set to the same value as raised_ts.
Scott Baker7c854aa2020-02-10 17:25:31 -0800202 google.protobuf.Timestamp reported_ts = 7;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400203
204
205}
206
207/*
208 * Event Structure
209 */
210message Event {
211 // event header
212 EventHeader header = 1;
213
214 // oneof event types referred by EventType.
215 oneof event_type {
216 // Refers to ConfigEvent
217 ConfigEvent config_event = 2;
218
219 // Refers to KpiEvent
220 KpiEvent kpi_event = 3;
221
222 // Refers to KpiEvent2
223 KpiEvent2 kpi_event2 = 4;
224
225 // Refers to DeviceEvent
226 DeviceEvent device_event = 5;
227
228 // Add other event types here.
229
230 }
231}
232