blob: 5092bab33056eab6f6e64e8769a06e718cdade96 [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;
Himani Chawla78c19ec2021-01-18 18:07:40 +0530180 NONE = 5; //Adding None for RPC Events
Devmalya Paulf98ca132019-07-09 06:14:19 -0400181 // Add new event categories here.
182 }
183}
184
185/*
186 * Identify the type of event
187*/
188message EventType {
Himani Chawla9499e952020-12-17 13:12:52 +0530189 enum Types {
190 CONFIG_EVENT = 0;
191 KPI_EVENT = 1;
192 KPI_EVENT2 = 2;
193 DEVICE_EVENT = 3;
194 RPC_EVENT = 4;
195 }
Devmalya Paulf98ca132019-07-09 06:14:19 -0400196}
197
198/*
199 * Identify the functional category originating the event
200 */
201message EventHeader {
202 // Unique ID for this event. e.g. voltha.some_olt.1234
203 string id = 1;
204
205 // Refers to the functional area affect by the event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300206 EventCategory.Types category = 2;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400207
208 // Refers to functional category of the event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300209 EventSubCategory.Types sub_category = 3;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400210
211 // Refers to the type of the event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300212 EventType.Types type = 4;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400213
214 // The version identifier for this event type, thus allowing each
215 // event type to evolve independently. The version should be in the
216 // format “MAJOR.MINOR” format and minor changes must only be additive
217 // and non-breaking.
218 string type_version = 5;
219
220 // Timestamp at which the event was first raised.
221 // This represents the UTC time stamp since epoch (in seconds) when the
222 // the event was first raised from the source entity.
223 // If the source entity doesn't send the raised_ts, this shall be set
224 // to timestamp when the event was received.
Scott Baker7c854aa2020-02-10 17:25:31 -0800225 google.protobuf.Timestamp raised_ts = 6;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400226
227 // Timestamp at which the event was reported.
228 // This represents the UTC time stamp since epoch (in seconds) when the
229 // the event was reported (this time stamp is >= raised_ts).
230 // If the source entity that reported this event doesn't send the
231 // reported_ts, this shall be set to the same value as raised_ts.
Scott Baker7c854aa2020-02-10 17:25:31 -0800232 google.protobuf.Timestamp reported_ts = 7;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400233}
234
235/*
236 * Event Structure
237 */
238message Event {
239 // event header
240 EventHeader header = 1;
241
242 // oneof event types referred by EventType.
243 oneof event_type {
244 // Refers to ConfigEvent
245 ConfigEvent config_event = 2;
246
247 // Refers to KpiEvent
Himani Chawla9499e952020-12-17 13:12:52 +0530248 KpiEvent kpi_event = 3;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400249
250 // Refers to KpiEvent2
Himani Chawla9499e952020-12-17 13:12:52 +0530251 KpiEvent2 kpi_event2 = 4;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400252
253 // Refers to DeviceEvent
254 DeviceEvent device_event = 5;
255
Himani Chawla9499e952020-12-17 13:12:52 +0530256 // Refers to an RPC Event
257 RPCEvent rpc_event = 6;
258
Devmalya Paulf98ca132019-07-09 06:14:19 -0400259 // Add other event types here.
260
261 }
262}
263