Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 3 | option go_package = "github.com/opencord/voltha-protos/v3/go/voltha"; |
| 4 | option java_package = "org.opencord.voltha"; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 5 | |
| 6 | package voltha; |
| 7 | |
| 8 | import "voltha_protos/meta.proto"; |
| 9 | import "google/api/annotations.proto"; |
Scott Baker | 7c854aa | 2020-02-10 17:25:31 -0800 | [diff] [blame] | 10 | import "google/protobuf/timestamp.proto"; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 11 | |
| 12 | message ConfigEventType { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 13 | enum Types { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 14 | 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 | |
| 20 | message ConfigEvent { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 21 | ConfigEventType.Types type = 1; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 22 | |
| 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 | |
| 27 | message KpiEventType { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 28 | enum Types { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 29 | 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 | */ |
| 37 | message 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.kundargi | 7b85fa1 | 2020-02-27 13:19:22 +0530 | [diff] [blame] | 55 | |
| 56 | string uuid = 7; // Transaction identifier used to match On |
| 57 | // Demand gRPC requests with kafka responses |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 58 | } |
| 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 | */ |
| 64 | message 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 | */ |
| 75 | message 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 | */ |
| 85 | message KpiEvent { |
| 86 | |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 87 | KpiEventType.Types type = 1; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 88 | |
| 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 | |
| 97 | message KpiEvent2 { |
| 98 | // Type of KPI Event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 99 | KpiEventType.Types type = 1; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 100 | |
| 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 | /* |
| 109 | * Identify to the area of the system impacted by the alarm |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 110 | * To be deprecated once python version of OpenOLT adapter |
| 111 | * moves to the new event defination for device alarms |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 112 | */ |
| 113 | message AlarmEventType { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 114 | enum Types { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 115 | COMMUNICATION = 0; |
| 116 | ENVIRONMENT = 1; |
| 117 | EQUIPMENT = 2; |
| 118 | SERVICE = 3; |
| 119 | PROCESSING = 4; |
| 120 | SECURITY = 5; |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | /* |
| 125 | * Identify to the functional category originating the alarm |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 126 | * To be deprecated once python version of OpenOLT adapter |
| 127 | * as well as OpenONU adapter moves to the new event |
| 128 | * defination for device alarms |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 129 | */ |
| 130 | message AlarmEventCategory { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 131 | enum Types { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 132 | PON = 0; |
| 133 | OLT = 1; |
| 134 | ONT = 2; |
| 135 | ONU = 3; |
| 136 | NNI = 4; |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | /* |
| 141 | * Active state of the alarm |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 142 | * To be deprecated once python version of OpenOLT adapter |
| 143 | * as well as OpenONU adapter moves to the new event |
| 144 | * defination for device alarms |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 145 | */ |
| 146 | message AlarmEventState { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 147 | enum Types { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 148 | RAISED = 0; |
| 149 | CLEARED = 1; |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | /* |
| 154 | * Identify the overall impact of the alarm on the system |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 155 | * To be deprecated once python version of OpenOLT adapter |
| 156 | * as well as OpenONU adapter moves to the new event |
| 157 | * defination for device alarms |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 158 | */ |
| 159 | message AlarmEventSeverity { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 160 | enum Types { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 161 | INDETERMINATE = 0; |
| 162 | WARNING = 1; |
| 163 | MINOR = 2; |
| 164 | MAJOR = 3; |
| 165 | CRITICAL = 4; |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | /* |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 170 | * To be deprecated once python version of OpenOLT adapter |
| 171 | * as well as OpenONU adapter moves to the new event |
| 172 | * defination for device alarms |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 173 | */ |
| 174 | message AlarmEvent { |
| 175 | // Unique ID for this alarm. e.g. voltha.some_olt.1234 |
| 176 | string id = 1; |
| 177 | |
| 178 | // Refers to the area of the system impacted by the alarm |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 179 | AlarmEventType.Types type = 2; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 180 | |
| 181 | // Refers to functional category of the alarm |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 182 | AlarmEventCategory.Types category = 3; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 183 | |
| 184 | // Current active state of the alarm |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 185 | AlarmEventState.Types state = 4; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 186 | |
| 187 | // Overall impact of the alarm on the system |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 188 | AlarmEventSeverity.Types severity = 5; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 189 | |
| 190 | // Timestamp at which the alarm was first raised |
Scott Baker | 7c854aa | 2020-02-10 17:25:31 -0800 | [diff] [blame] | 191 | // TODO: Is this obsolete? Eventheader already has a raised_ts |
| 192 | google.protobuf.Timestamp raised_ts = 6; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 193 | |
| 194 | // Timestamp at which the alarm was reported |
Scott Baker | 7c854aa | 2020-02-10 17:25:31 -0800 | [diff] [blame] | 195 | // TODO: Is this obsolete? Eventheader already has a reported_ts |
| 196 | google.protobuf.Timestamp reported_ts = 7; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 197 | |
| 198 | // Timestamp at which the alarm has changed since it was raised |
Scott Baker | 7c854aa | 2020-02-10 17:25:31 -0800 | [diff] [blame] | 199 | google.protobuf.Timestamp changed_ts = 8; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 200 | |
| 201 | // Identifier of the originating resource of the alarm |
| 202 | string resource_id = 9; |
| 203 | |
| 204 | // Textual explanation of the alarm |
| 205 | string description = 10; |
| 206 | |
| 207 | // Key/Value storage for extra information that may give context to the alarm |
| 208 | map<string, string> context = 11; |
| 209 | |
| 210 | // logical device id |
| 211 | string logical_device_id = 12; |
| 212 | |
| 213 | // alarm_type name indicates clearly the name of the alarm |
| 214 | string alarm_type_name = 13; |
| 215 | } |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 216 | /* |
| 217 | * Describes the events specific to device |
| 218 | */ |
| 219 | message DeviceEvent { |
| 220 | // Identifier of the originating resource of the event, for ex: device_id |
| 221 | string resource_id = 1; |
| 222 | |
| 223 | // device_event_name indicates clearly the name of the device event |
| 224 | string device_event_name = 2; |
| 225 | |
| 226 | // Textual explanation of the device event |
| 227 | string description = 3; |
| 228 | |
| 229 | // Key/Value storage for extra information that may give context to the event |
| 230 | map<string, string> context = 4; |
| 231 | |
| 232 | } |
| 233 | |
| 234 | /* |
| 235 | * Identify the area of the system impacted by the event. |
| 236 | */ |
| 237 | message EventCategory { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 238 | enum Types { |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 239 | COMMUNICATION = 0; |
| 240 | ENVIRONMENT = 1; |
| 241 | EQUIPMENT = 2; |
| 242 | SERVICE = 3; |
| 243 | PROCESSING = 4; |
| 244 | SECURITY = 5; |
| 245 | // Add new event areas here |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | /* |
| 250 | * Identify the functional category originating the event |
| 251 | */ |
| 252 | message EventSubCategory { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 253 | enum Types { |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 254 | PON = 0; |
| 255 | OLT = 1; |
| 256 | ONT = 2; |
| 257 | ONU = 3; |
| 258 | NNI = 4; |
| 259 | // Add new event categories here. |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | /* |
| 264 | * Identify the type of event |
| 265 | */ |
| 266 | message EventType { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 267 | enum Types { |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 268 | CONFIG_EVENT = 0; |
| 269 | KPI_EVENT = 1; |
| 270 | KPI_EVENT2 = 2; |
| 271 | DEVICE_EVENT = 3; |
| 272 | |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | /* |
| 277 | * Identify the functional category originating the event |
| 278 | */ |
| 279 | message EventHeader { |
| 280 | // Unique ID for this event. e.g. voltha.some_olt.1234 |
| 281 | string id = 1; |
| 282 | |
| 283 | // Refers to the functional area affect by the event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 284 | EventCategory.Types category = 2; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 285 | |
| 286 | // Refers to functional category of the event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 287 | EventSubCategory.Types sub_category = 3; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 288 | |
| 289 | // Refers to the type of the event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 290 | EventType.Types type = 4; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 291 | |
| 292 | // The version identifier for this event type, thus allowing each |
| 293 | // event type to evolve independently. The version should be in the |
| 294 | // format “MAJOR.MINOR” format and minor changes must only be additive |
| 295 | // and non-breaking. |
| 296 | string type_version = 5; |
| 297 | |
| 298 | // Timestamp at which the event was first raised. |
| 299 | // This represents the UTC time stamp since epoch (in seconds) when the |
| 300 | // the event was first raised from the source entity. |
| 301 | // If the source entity doesn't send the raised_ts, this shall be set |
| 302 | // to timestamp when the event was received. |
Scott Baker | 7c854aa | 2020-02-10 17:25:31 -0800 | [diff] [blame] | 303 | google.protobuf.Timestamp raised_ts = 6; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 304 | |
| 305 | // Timestamp at which the event was reported. |
| 306 | // This represents the UTC time stamp since epoch (in seconds) when the |
| 307 | // the event was reported (this time stamp is >= raised_ts). |
| 308 | // If the source entity that reported this event doesn't send the |
| 309 | // reported_ts, this shall be set to the same value as raised_ts. |
Scott Baker | 7c854aa | 2020-02-10 17:25:31 -0800 | [diff] [blame] | 310 | google.protobuf.Timestamp reported_ts = 7; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 311 | |
| 312 | |
| 313 | } |
| 314 | |
| 315 | /* |
| 316 | * Event Structure |
| 317 | */ |
| 318 | message Event { |
| 319 | // event header |
| 320 | EventHeader header = 1; |
| 321 | |
| 322 | // oneof event types referred by EventType. |
| 323 | oneof event_type { |
| 324 | // Refers to ConfigEvent |
| 325 | ConfigEvent config_event = 2; |
| 326 | |
| 327 | // Refers to KpiEvent |
| 328 | KpiEvent kpi_event = 3; |
| 329 | |
| 330 | // Refers to KpiEvent2 |
| 331 | KpiEvent2 kpi_event2 = 4; |
| 332 | |
| 333 | // Refers to DeviceEvent |
| 334 | DeviceEvent device_event = 5; |
| 335 | |
| 336 | // Add other event types here. |
| 337 | |
| 338 | } |
| 339 | } |
| 340 | |