blob: 4dd8347a1cc522a969ddab47faf68272f2b49e43 [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";
Himani Chawla9499e952020-12-17 13:12:52 +053011import "voltha_protos/common.proto";
Zack Williams52209662019-02-07 10:15:31 -070012
13message ConfigEventType {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +030014 enum Types {
Zack Williams52209662019-02-07 10:15:31 -070015 add = 0; // A new config has been added
16 remove = 1; // A config has been removed
17 update = 2; // A config has been updated
18 }
19}
20
21message ConfigEvent {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +030022 ConfigEventType.Types type = 1;
Zack Williams52209662019-02-07 10:15:31 -070023
24 string hash = 2; // hash for this change, can be used for quick lookup
25 string data = 3; // the actual new data, in json format
26}
27
28message KpiEventType {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +030029 enum Types {
Zack Williams52209662019-02-07 10:15:31 -070030 slice = 0; // slice: a set of path/metric data for same time-stamp
31 ts = 1; // time-series: array of data for same metric
32 }
33}
34
35/*
36 * Struct to convey a dictionary of metric metadata.
37 */
38message MetricMetaData {
Himani Chawla9499e952020-12-17 13:12:52 +053039 string title = 1; // Metric group or individual metric name
40 double ts = 2; // UTC time-stamp of data (seconds since epoch) of
41 // when the metric or metric group was collected.
42 // If this is a 15-min historical group, it is the
43 // time of the collection and reporting, not the
44 // start or end of the 15-min group interval.
Zack Williams52209662019-02-07 10:15:31 -070045
46 string logical_device_id = 3; // The logical device ID of the VOLTHA
Himani Chawla9499e952020-12-17 13:12:52 +053047 // (equivalent to the DPID that ONOS has
48 // for the VOLTHA device without the
49 // 'of:' prefix
50 string serial_no = 4; // The OLT, ONU, ... device serial number
51 string device_id = 5; // The OLT, ONU, ... physical device ID
Zack Williams52209662019-02-07 10:15:31 -070052
53 map<string, string> context = 6; // Name value pairs that provide additional
Himani Chawla9499e952020-12-17 13:12:52 +053054 // context information on the metrics being
55 // reported.
onkar.kundargi7b85fa12020-02-27 13:19:22 +053056
Himani Chawla9499e952020-12-17 13:12:52 +053057 string uuid = 7; // Transaction identifier used to match On
58 // Demand gRPC requests with kafka responses
Zack Williams52209662019-02-07 10:15:31 -070059}
60
61/*
62 * Struct to convey a dictionary of metric->value pairs. Typically used in
63 * pure shared-timestamp or shared-timestamp + shared object prefix situations.
64 */
65message MetricValuePairs {
66
67 // Metric / value pairs.
68 map<string, float> metrics = 1;
69
70}
71
72/*
73 * Struct to group metadata for a metric (or group of metrics) with the key-value
74 * pairs of collected metrics
75 */
76message MetricInformation {
77 MetricMetaData metadata = 1;
78 map<string, float> metrics = 2;
79}
80
81/*
82 * Legacy KPI Event structured. In mid-August, the KPI event format was updated
83 * to a more easily parsable format. See VOL-1140
84 * for more information.
85 */
86message KpiEvent {
87
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +030088 KpiEventType.Types type = 1;
Zack Williams52209662019-02-07 10:15:31 -070089
90 // Fields used when for slice:
91
92 float ts = 2; // UTC time-stamp of data in slice mode (seconds since epoc)
93
94 map<string, MetricValuePairs> prefixes = 3;
95
96}
97
98message KpiEvent2 {
99 // Type of KPI Event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300100 KpiEventType.Types type = 1;
Zack Williams52209662019-02-07 10:15:31 -0700101
102 // Fields used when for slice:
Himani Chawla9499e952020-12-17 13:12:52 +0530103 double ts = 2; // UTC time-stamp of data in slice mode (seconds since epoch)
104 // of the time this entire KpiEvent was published to the kafka bus
Zack Williams52209662019-02-07 10:15:31 -0700105
106 repeated MetricInformation slice_data = 3;
107}
108
109/*
Devmalya Paulf98ca132019-07-09 06:14:19 -0400110 * Describes the events specific to device
111 */
112message DeviceEvent {
113 // Identifier of the originating resource of the event, for ex: device_id
114 string resource_id = 1;
115
116 // device_event_name indicates clearly the name of the device event
117 string device_event_name = 2;
118
119 // Textual explanation of the device event
120 string description = 3;
121
122 // Key/Value storage for extra information that may give context to the event
123 map<string, string> context = 4;
124
125}
Himani Chawla9499e952020-12-17 13:12:52 +0530126/*
127 * Describes the events specific to an RPC request
128 */
129message RPCEvent {
130 // RPC name
131 string rpc = 1;
132
133 // The operation id of that request. Can be a log correlation ID
134 string operation_id = 2;
135
136 // Identifies the service name originating the event
137 string service = 3;
138
139 // Identifies the stack originating the event
140 string stack_id = 4;
141
142 // Identifies the resource upon which the action is taken, e.g. device_id
143 string resource_id = 5;
144
145 // Textual explanation of the event
146 string description = 6;
147
148 // Key/Value storage for extra information that may give context to the event
149 map<string, string> context = 7;
150
151 // Status of the RPC Event
152 common.OperationResp status = 8;
153}
Devmalya Paulf98ca132019-07-09 06:14:19 -0400154
155/*
156 * Identify the area of the system impacted by the event.
157 */
158message EventCategory {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300159 enum Types {
Devmalya Paulf98ca132019-07-09 06:14:19 -0400160 COMMUNICATION = 0;
161 ENVIRONMENT = 1;
162 EQUIPMENT = 2;
163 SERVICE = 3;
164 PROCESSING = 4;
165 SECURITY = 5;
166 // Add new event areas here
167 }
168}
169
170/*
171 * Identify the functional category originating the event
172 */
173message EventSubCategory {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300174 enum Types {
Devmalya Paulf98ca132019-07-09 06:14:19 -0400175 PON = 0;
176 OLT = 1;
177 ONT = 2;
178 ONU = 3;
179 NNI = 4;
180 // Add new event categories here.
181 }
182}
183
184/*
185 * Identify the type of event
186*/
187message EventType {
Himani Chawla9499e952020-12-17 13:12:52 +0530188 enum Types {
189 CONFIG_EVENT = 0;
190 KPI_EVENT = 1;
191 KPI_EVENT2 = 2;
192 DEVICE_EVENT = 3;
193 RPC_EVENT = 4;
194 }
Devmalya Paulf98ca132019-07-09 06:14:19 -0400195}
196
197/*
198 * Identify the functional category originating the event
199 */
200message EventHeader {
201 // Unique ID for this event. e.g. voltha.some_olt.1234
202 string id = 1;
203
204 // Refers to the functional area affect by the event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300205 EventCategory.Types category = 2;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400206
207 // Refers to functional category of the event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300208 EventSubCategory.Types sub_category = 3;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400209
210 // Refers to the type of the event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300211 EventType.Types type = 4;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400212
213 // The version identifier for this event type, thus allowing each
214 // event type to evolve independently. The version should be in the
215 // format “MAJOR.MINOR” format and minor changes must only be additive
216 // and non-breaking.
217 string type_version = 5;
218
219 // Timestamp at which the event was first raised.
220 // This represents the UTC time stamp since epoch (in seconds) when the
221 // the event was first raised from the source entity.
222 // If the source entity doesn't send the raised_ts, this shall be set
223 // to timestamp when the event was received.
Scott Baker7c854aa2020-02-10 17:25:31 -0800224 google.protobuf.Timestamp raised_ts = 6;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400225
226 // Timestamp at which the event was reported.
227 // This represents the UTC time stamp since epoch (in seconds) when the
228 // the event was reported (this time stamp is >= raised_ts).
229 // If the source entity that reported this event doesn't send the
230 // reported_ts, this shall be set to the same value as raised_ts.
Scott Baker7c854aa2020-02-10 17:25:31 -0800231 google.protobuf.Timestamp reported_ts = 7;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400232}
233
234/*
235 * Event Structure
236 */
237message Event {
238 // event header
239 EventHeader header = 1;
240
241 // oneof event types referred by EventType.
242 oneof event_type {
243 // Refers to ConfigEvent
244 ConfigEvent config_event = 2;
245
246 // Refers to KpiEvent
Himani Chawla9499e952020-12-17 13:12:52 +0530247 KpiEvent kpi_event = 3;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400248
249 // Refers to KpiEvent2
Himani Chawla9499e952020-12-17 13:12:52 +0530250 KpiEvent2 kpi_event2 = 4;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400251
252 // Refers to DeviceEvent
253 DeviceEvent device_event = 5;
254
Himani Chawla9499e952020-12-17 13:12:52 +0530255 // Refers to an RPC Event
256 RPCEvent rpc_event = 6;
257
Devmalya Paulf98ca132019-07-09 06:14:19 -0400258 // Add other event types here.
259
260 }
261}
262