Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | |
khenaidoo | 5fc5cea | 2021-08-11 17:39:16 -0400 | [diff] [blame] | 3 | option go_package = "github.com/opencord/voltha-protos/v5/go/voltha"; |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 4 | option java_package = "org.opencord.voltha.events"; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 5 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 6 | package event; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 7 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 8 | import "google/api/annotations.proto"; |
Scott Baker | 7c854aa | 2020-02-10 17:25:31 -0800 | [diff] [blame] | 9 | import "google/protobuf/timestamp.proto"; |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 10 | import "voltha_protos/common.proto"; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 11 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 12 | |
| 13 | message EventFilterRuleKey { |
| 14 | |
| 15 | enum EventFilterRuleType { |
| 16 | filter_all = 0; |
| 17 | category = 1; |
| 18 | sub_category = 2; |
| 19 | kpi_event_type = 3; |
| 20 | config_event_type = 4; |
| 21 | device_event_type = 5; |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | message EventFilterRule { |
| 26 | EventFilterRuleKey.EventFilterRuleType key = 1; |
| 27 | string value = 2; |
| 28 | } |
| 29 | message EventFilter { |
| 30 | string id = 1 ; |
| 31 | bool enable = 2; |
| 32 | string device_id = 3; |
| 33 | string event_type = 4; |
| 34 | repeated EventFilterRule rules = 5; |
| 35 | } |
| 36 | |
| 37 | message EventFilters { |
| 38 | repeated EventFilter filters = 1; |
| 39 | } |
| 40 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 41 | message ConfigEventType { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 42 | enum Types { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 43 | add = 0; // A new config has been added |
| 44 | remove = 1; // A config has been removed |
| 45 | update = 2; // A config has been updated |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | message ConfigEvent { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 50 | ConfigEventType.Types type = 1; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 51 | |
| 52 | string hash = 2; // hash for this change, can be used for quick lookup |
| 53 | string data = 3; // the actual new data, in json format |
| 54 | } |
| 55 | |
| 56 | message KpiEventType { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 57 | enum Types { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 58 | slice = 0; // slice: a set of path/metric data for same time-stamp |
| 59 | ts = 1; // time-series: array of data for same metric |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | /* |
| 64 | * Struct to convey a dictionary of metric metadata. |
| 65 | */ |
| 66 | message MetricMetaData { |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 67 | string title = 1; // Metric group or individual metric name |
| 68 | double ts = 2; // UTC time-stamp of data (seconds since epoch) of |
| 69 | // when the metric or metric group was collected. |
| 70 | // If this is a 15-min historical group, it is the |
| 71 | // time of the collection and reporting, not the |
| 72 | // start or end of the 15-min group interval. |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 73 | |
| 74 | string logical_device_id = 3; // The logical device ID of the VOLTHA |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 75 | // (equivalent to the DPID that ONOS has |
| 76 | // for the VOLTHA device without the |
| 77 | // 'of:' prefix |
| 78 | string serial_no = 4; // The OLT, ONU, ... device serial number |
| 79 | string device_id = 5; // The OLT, ONU, ... physical device ID |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 80 | |
| 81 | map<string, string> context = 6; // Name value pairs that provide additional |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 82 | // context information on the metrics being |
| 83 | // reported. |
onkar.kundargi | 7b85fa1 | 2020-02-27 13:19:22 +0530 | [diff] [blame] | 84 | |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 85 | string uuid = 7; // Transaction identifier used to match On |
| 86 | // Demand gRPC requests with kafka responses |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | /* |
| 90 | * Struct to convey a dictionary of metric->value pairs. Typically used in |
| 91 | * pure shared-timestamp or shared-timestamp + shared object prefix situations. |
| 92 | */ |
| 93 | message MetricValuePairs { |
| 94 | |
| 95 | // Metric / value pairs. |
| 96 | map<string, float> metrics = 1; |
| 97 | |
| 98 | } |
| 99 | |
| 100 | /* |
| 101 | * Struct to group metadata for a metric (or group of metrics) with the key-value |
| 102 | * pairs of collected metrics |
| 103 | */ |
| 104 | message MetricInformation { |
| 105 | MetricMetaData metadata = 1; |
| 106 | map<string, float> metrics = 2; |
| 107 | } |
| 108 | |
| 109 | /* |
| 110 | * Legacy KPI Event structured. In mid-August, the KPI event format was updated |
| 111 | * to a more easily parsable format. See VOL-1140 |
| 112 | * for more information. |
| 113 | */ |
| 114 | message KpiEvent { |
| 115 | |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 116 | KpiEventType.Types type = 1; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 117 | |
| 118 | // Fields used when for slice: |
| 119 | |
| 120 | float ts = 2; // UTC time-stamp of data in slice mode (seconds since epoc) |
| 121 | |
| 122 | map<string, MetricValuePairs> prefixes = 3; |
| 123 | |
| 124 | } |
| 125 | |
| 126 | message KpiEvent2 { |
| 127 | // Type of KPI Event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 128 | KpiEventType.Types type = 1; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 129 | |
| 130 | // Fields used when for slice: |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 131 | double ts = 2; // UTC time-stamp of data in slice mode (seconds since epoch) |
| 132 | // of the time this entire KpiEvent was published to the kafka bus |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 133 | |
| 134 | repeated MetricInformation slice_data = 3; |
| 135 | } |
| 136 | |
| 137 | /* |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 138 | * Describes the events specific to device |
| 139 | */ |
| 140 | message DeviceEvent { |
| 141 | // Identifier of the originating resource of the event, for ex: device_id |
| 142 | string resource_id = 1; |
| 143 | |
| 144 | // device_event_name indicates clearly the name of the device event |
| 145 | string device_event_name = 2; |
| 146 | |
| 147 | // Textual explanation of the device event |
| 148 | string description = 3; |
| 149 | |
| 150 | // Key/Value storage for extra information that may give context to the event |
| 151 | map<string, string> context = 4; |
| 152 | |
| 153 | } |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 154 | /* |
| 155 | * Describes the events specific to an RPC request |
| 156 | */ |
| 157 | message RPCEvent { |
| 158 | // RPC name |
| 159 | string rpc = 1; |
| 160 | |
| 161 | // The operation id of that request. Can be a log correlation ID |
| 162 | string operation_id = 2; |
| 163 | |
| 164 | // Identifies the service name originating the event |
| 165 | string service = 3; |
| 166 | |
| 167 | // Identifies the stack originating the event |
| 168 | string stack_id = 4; |
| 169 | |
| 170 | // Identifies the resource upon which the action is taken, e.g. device_id |
| 171 | string resource_id = 5; |
| 172 | |
| 173 | // Textual explanation of the event |
| 174 | string description = 6; |
| 175 | |
| 176 | // Key/Value storage for extra information that may give context to the event |
| 177 | map<string, string> context = 7; |
| 178 | |
| 179 | // Status of the RPC Event |
| 180 | common.OperationResp status = 8; |
| 181 | } |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 182 | |
| 183 | /* |
| 184 | * Identify the area of the system impacted by the event. |
| 185 | */ |
| 186 | message EventCategory { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 187 | enum Types { |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 188 | COMMUNICATION = 0; |
| 189 | ENVIRONMENT = 1; |
| 190 | EQUIPMENT = 2; |
| 191 | SERVICE = 3; |
| 192 | PROCESSING = 4; |
| 193 | SECURITY = 5; |
| 194 | // Add new event areas here |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | /* |
| 199 | * Identify the functional category originating the event |
| 200 | */ |
| 201 | message EventSubCategory { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 202 | enum Types { |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 203 | PON = 0; |
| 204 | OLT = 1; |
| 205 | ONT = 2; |
| 206 | ONU = 3; |
| 207 | NNI = 4; |
Himani Chawla | 78c19ec | 2021-01-18 18:07:40 +0530 | [diff] [blame] | 208 | NONE = 5; //Adding None for RPC Events |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 209 | // Add new event categories here. |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | /* |
| 214 | * Identify the type of event |
| 215 | */ |
| 216 | message EventType { |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 217 | enum Types { |
| 218 | CONFIG_EVENT = 0; |
| 219 | KPI_EVENT = 1; |
| 220 | KPI_EVENT2 = 2; |
| 221 | DEVICE_EVENT = 3; |
| 222 | RPC_EVENT = 4; |
| 223 | } |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 224 | } |
| 225 | |
| 226 | /* |
| 227 | * Identify the functional category originating the event |
| 228 | */ |
| 229 | message EventHeader { |
| 230 | // Unique ID for this event. e.g. voltha.some_olt.1234 |
| 231 | string id = 1; |
| 232 | |
| 233 | // Refers to the functional area affect by the event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 234 | EventCategory.Types category = 2; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 235 | |
| 236 | // Refers to functional category of the event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 237 | EventSubCategory.Types sub_category = 3; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 238 | |
| 239 | // Refers to the type of the event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 240 | EventType.Types type = 4; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 241 | |
| 242 | // The version identifier for this event type, thus allowing each |
| 243 | // event type to evolve independently. The version should be in the |
| 244 | // format “MAJOR.MINOR” format and minor changes must only be additive |
| 245 | // and non-breaking. |
| 246 | string type_version = 5; |
| 247 | |
| 248 | // Timestamp at which the event was first raised. |
| 249 | // This represents the UTC time stamp since epoch (in seconds) when the |
| 250 | // the event was first raised from the source entity. |
| 251 | // If the source entity doesn't send the raised_ts, this shall be set |
| 252 | // to timestamp when the event was received. |
Scott Baker | 7c854aa | 2020-02-10 17:25:31 -0800 | [diff] [blame] | 253 | google.protobuf.Timestamp raised_ts = 6; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 254 | |
| 255 | // Timestamp at which the event was reported. |
| 256 | // This represents the UTC time stamp since epoch (in seconds) when the |
| 257 | // the event was reported (this time stamp is >= raised_ts). |
| 258 | // If the source entity that reported this event doesn't send the |
| 259 | // 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] | 260 | google.protobuf.Timestamp reported_ts = 7; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 261 | } |
| 262 | |
| 263 | /* |
| 264 | * Event Structure |
| 265 | */ |
| 266 | message Event { |
| 267 | // event header |
| 268 | EventHeader header = 1; |
| 269 | |
| 270 | // oneof event types referred by EventType. |
| 271 | oneof event_type { |
| 272 | // Refers to ConfigEvent |
| 273 | ConfigEvent config_event = 2; |
| 274 | |
| 275 | // Refers to KpiEvent |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 276 | KpiEvent kpi_event = 3; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 277 | |
| 278 | // Refers to KpiEvent2 |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 279 | KpiEvent2 kpi_event2 = 4; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 280 | |
| 281 | // Refers to DeviceEvent |
| 282 | DeviceEvent device_event = 5; |
| 283 | |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 284 | // Refers to an RPC Event |
| 285 | RPCEvent rpc_event = 6; |
| 286 | |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 287 | // Add other event types here. |
| 288 | |
| 289 | } |
| 290 | } |
| 291 | |