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. |
| 55 | } |
| 56 | |
| 57 | /* |
| 58 | * Struct to convey a dictionary of metric->value pairs. Typically used in |
| 59 | * pure shared-timestamp or shared-timestamp + shared object prefix situations. |
| 60 | */ |
| 61 | message MetricValuePairs { |
| 62 | |
| 63 | // Metric / value pairs. |
| 64 | map<string, float> metrics = 1; |
| 65 | |
| 66 | } |
| 67 | |
| 68 | /* |
| 69 | * Struct to group metadata for a metric (or group of metrics) with the key-value |
| 70 | * pairs of collected metrics |
| 71 | */ |
| 72 | message MetricInformation { |
| 73 | MetricMetaData metadata = 1; |
| 74 | map<string, float> metrics = 2; |
| 75 | } |
| 76 | |
| 77 | /* |
| 78 | * Legacy KPI Event structured. In mid-August, the KPI event format was updated |
| 79 | * to a more easily parsable format. See VOL-1140 |
| 80 | * for more information. |
| 81 | */ |
| 82 | message KpiEvent { |
| 83 | |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 84 | KpiEventType.Types type = 1; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 85 | |
| 86 | // Fields used when for slice: |
| 87 | |
| 88 | float ts = 2; // UTC time-stamp of data in slice mode (seconds since epoc) |
| 89 | |
| 90 | map<string, MetricValuePairs> prefixes = 3; |
| 91 | |
| 92 | } |
| 93 | |
| 94 | message KpiEvent2 { |
| 95 | // Type of KPI Event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 96 | KpiEventType.Types type = 1; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 97 | |
| 98 | // Fields used when for slice: |
| 99 | double ts = 2; // UTC time-stamp of data in slice mode (seconds since epoch) |
| 100 | // of the time this entire KpiEvent was published to the kafka bus |
| 101 | |
| 102 | repeated MetricInformation slice_data = 3; |
| 103 | } |
| 104 | |
| 105 | /* |
| 106 | * Identify to the area of the system impacted by the alarm |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 107 | * To be deprecated once python version of OpenOLT adapter |
| 108 | * moves to the new event defination for device alarms |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 109 | */ |
| 110 | message AlarmEventType { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 111 | enum Types { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 112 | COMMUNICATION = 0; |
| 113 | ENVIRONMENT = 1; |
| 114 | EQUIPMENT = 2; |
| 115 | SERVICE = 3; |
| 116 | PROCESSING = 4; |
| 117 | SECURITY = 5; |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | /* |
| 122 | * Identify to the functional category originating the alarm |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 123 | * To be deprecated once python version of OpenOLT adapter |
| 124 | * as well as OpenONU adapter moves to the new event |
| 125 | * defination for device alarms |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 126 | */ |
| 127 | message AlarmEventCategory { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 128 | enum Types { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 129 | PON = 0; |
| 130 | OLT = 1; |
| 131 | ONT = 2; |
| 132 | ONU = 3; |
| 133 | NNI = 4; |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | /* |
| 138 | * Active state of the alarm |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 139 | * To be deprecated once python version of OpenOLT adapter |
| 140 | * as well as OpenONU adapter moves to the new event |
| 141 | * defination for device alarms |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 142 | */ |
| 143 | message AlarmEventState { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 144 | enum Types { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 145 | RAISED = 0; |
| 146 | CLEARED = 1; |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | /* |
| 151 | * Identify the overall impact of the alarm on the system |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 152 | * To be deprecated once python version of OpenOLT adapter |
| 153 | * as well as OpenONU adapter moves to the new event |
| 154 | * defination for device alarms |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 155 | */ |
| 156 | message AlarmEventSeverity { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 157 | enum Types { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 158 | INDETERMINATE = 0; |
| 159 | WARNING = 1; |
| 160 | MINOR = 2; |
| 161 | MAJOR = 3; |
| 162 | CRITICAL = 4; |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | /* |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 167 | * To be deprecated once python version of OpenOLT adapter |
| 168 | * as well as OpenONU adapter moves to the new event |
| 169 | * defination for device alarms |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 170 | */ |
| 171 | message AlarmEvent { |
| 172 | // Unique ID for this alarm. e.g. voltha.some_olt.1234 |
| 173 | string id = 1; |
| 174 | |
| 175 | // Refers to the area of the system impacted by the alarm |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 176 | AlarmEventType.Types type = 2; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 177 | |
| 178 | // Refers to functional category of the alarm |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 179 | AlarmEventCategory.Types category = 3; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 180 | |
| 181 | // Current active state of the alarm |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 182 | AlarmEventState.Types state = 4; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 183 | |
| 184 | // Overall impact of the alarm on the system |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 185 | AlarmEventSeverity.Types severity = 5; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 186 | |
| 187 | // Timestamp at which the alarm was first raised |
Scott Baker | 7c854aa | 2020-02-10 17:25:31 -0800 | [diff] [blame] | 188 | // TODO: Is this obsolete? Eventheader already has a raised_ts |
| 189 | google.protobuf.Timestamp raised_ts = 6; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 190 | |
| 191 | // Timestamp at which the alarm was reported |
Scott Baker | 7c854aa | 2020-02-10 17:25:31 -0800 | [diff] [blame] | 192 | // TODO: Is this obsolete? Eventheader already has a reported_ts |
| 193 | google.protobuf.Timestamp reported_ts = 7; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 194 | |
| 195 | // Timestamp at which the alarm has changed since it was raised |
Scott Baker | 7c854aa | 2020-02-10 17:25:31 -0800 | [diff] [blame] | 196 | google.protobuf.Timestamp changed_ts = 8; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 197 | |
| 198 | // Identifier of the originating resource of the alarm |
| 199 | string resource_id = 9; |
| 200 | |
| 201 | // Textual explanation of the alarm |
| 202 | string description = 10; |
| 203 | |
| 204 | // Key/Value storage for extra information that may give context to the alarm |
| 205 | map<string, string> context = 11; |
| 206 | |
| 207 | // logical device id |
| 208 | string logical_device_id = 12; |
| 209 | |
| 210 | // alarm_type name indicates clearly the name of the alarm |
| 211 | string alarm_type_name = 13; |
| 212 | } |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 213 | /* |
| 214 | * Describes the events specific to device |
| 215 | */ |
| 216 | message DeviceEvent { |
| 217 | // Identifier of the originating resource of the event, for ex: device_id |
| 218 | string resource_id = 1; |
| 219 | |
| 220 | // device_event_name indicates clearly the name of the device event |
| 221 | string device_event_name = 2; |
| 222 | |
| 223 | // Textual explanation of the device event |
| 224 | string description = 3; |
| 225 | |
| 226 | // Key/Value storage for extra information that may give context to the event |
| 227 | map<string, string> context = 4; |
| 228 | |
| 229 | } |
| 230 | |
| 231 | /* |
| 232 | * Identify the area of the system impacted by the event. |
| 233 | */ |
| 234 | message EventCategory { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 235 | enum Types { |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 236 | COMMUNICATION = 0; |
| 237 | ENVIRONMENT = 1; |
| 238 | EQUIPMENT = 2; |
| 239 | SERVICE = 3; |
| 240 | PROCESSING = 4; |
| 241 | SECURITY = 5; |
| 242 | // Add new event areas here |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | /* |
| 247 | * Identify the functional category originating the event |
| 248 | */ |
| 249 | message EventSubCategory { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 250 | enum Types { |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 251 | PON = 0; |
| 252 | OLT = 1; |
| 253 | ONT = 2; |
| 254 | ONU = 3; |
| 255 | NNI = 4; |
| 256 | // Add new event categories here. |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | /* |
| 261 | * Identify the type of event |
| 262 | */ |
| 263 | message EventType { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 264 | enum Types { |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 265 | CONFIG_EVENT = 0; |
| 266 | KPI_EVENT = 1; |
| 267 | KPI_EVENT2 = 2; |
| 268 | DEVICE_EVENT = 3; |
| 269 | |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | /* |
| 274 | * Identify the functional category originating the event |
| 275 | */ |
| 276 | message EventHeader { |
| 277 | // Unique ID for this event. e.g. voltha.some_olt.1234 |
| 278 | string id = 1; |
| 279 | |
| 280 | // Refers to the functional area affect by the event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 281 | EventCategory.Types category = 2; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 282 | |
| 283 | // Refers to functional category of the event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 284 | EventSubCategory.Types sub_category = 3; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 285 | |
| 286 | // Refers to the type of the event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 287 | EventType.Types type = 4; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 288 | |
| 289 | // The version identifier for this event type, thus allowing each |
| 290 | // event type to evolve independently. The version should be in the |
| 291 | // format “MAJOR.MINOR” format and minor changes must only be additive |
| 292 | // and non-breaking. |
| 293 | string type_version = 5; |
| 294 | |
| 295 | // Timestamp at which the event was first raised. |
| 296 | // This represents the UTC time stamp since epoch (in seconds) when the |
| 297 | // the event was first raised from the source entity. |
| 298 | // If the source entity doesn't send the raised_ts, this shall be set |
| 299 | // to timestamp when the event was received. |
Scott Baker | 7c854aa | 2020-02-10 17:25:31 -0800 | [diff] [blame] | 300 | google.protobuf.Timestamp raised_ts = 6; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 301 | |
| 302 | // Timestamp at which the event was reported. |
| 303 | // This represents the UTC time stamp since epoch (in seconds) when the |
| 304 | // the event was reported (this time stamp is >= raised_ts). |
| 305 | // If the source entity that reported this event doesn't send the |
| 306 | // 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] | 307 | google.protobuf.Timestamp reported_ts = 7; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 308 | |
| 309 | |
| 310 | } |
| 311 | |
| 312 | /* |
| 313 | * Event Structure |
| 314 | */ |
| 315 | message Event { |
| 316 | // event header |
| 317 | EventHeader header = 1; |
| 318 | |
| 319 | // oneof event types referred by EventType. |
| 320 | oneof event_type { |
| 321 | // Refers to ConfigEvent |
| 322 | ConfigEvent config_event = 2; |
| 323 | |
| 324 | // Refers to KpiEvent |
| 325 | KpiEvent kpi_event = 3; |
| 326 | |
| 327 | // Refers to KpiEvent2 |
| 328 | KpiEvent2 kpi_event2 = 4; |
| 329 | |
| 330 | // Refers to DeviceEvent |
| 331 | DeviceEvent device_event = 5; |
| 332 | |
| 333 | // Add other event types here. |
| 334 | |
| 335 | } |
| 336 | } |
| 337 | |