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