Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | |
Matteo Scandolo | b3c08ae | 2020-10-14 13:15:43 -0700 | [diff] [blame] | 3 | option go_package = "github.com/opencord/voltha-protos/v4/go/voltha"; |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 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"; |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame^] | 11 | import "voltha_protos/common.proto"; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 12 | |
| 13 | message ConfigEventType { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 14 | enum Types { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 15 | 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 | |
| 21 | message ConfigEvent { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 22 | ConfigEventType.Types type = 1; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 23 | |
| 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 | |
| 28 | message KpiEventType { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 29 | enum Types { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 30 | 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 | */ |
| 38 | message MetricMetaData { |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame^] | 39 | 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 Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 45 | |
| 46 | string logical_device_id = 3; // The logical device ID of the VOLTHA |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame^] | 47 | // (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 Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 52 | |
| 53 | map<string, string> context = 6; // Name value pairs that provide additional |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame^] | 54 | // context information on the metrics being |
| 55 | // reported. |
onkar.kundargi | 7b85fa1 | 2020-02-27 13:19:22 +0530 | [diff] [blame] | 56 | |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame^] | 57 | string uuid = 7; // Transaction identifier used to match On |
| 58 | // Demand gRPC requests with kafka responses |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 59 | } |
| 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 | */ |
| 65 | message 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 | */ |
| 76 | message 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 | */ |
| 86 | message KpiEvent { |
| 87 | |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 88 | KpiEventType.Types type = 1; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 89 | |
| 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 | |
| 98 | message KpiEvent2 { |
| 99 | // Type of KPI Event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 100 | KpiEventType.Types type = 1; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 101 | |
| 102 | // Fields used when for slice: |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame^] | 103 | 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 Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 105 | |
| 106 | repeated MetricInformation slice_data = 3; |
| 107 | } |
| 108 | |
| 109 | /* |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 110 | * Describes the events specific to device |
| 111 | */ |
| 112 | message 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 Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame^] | 126 | /* |
| 127 | * Describes the events specific to an RPC request |
| 128 | */ |
| 129 | message 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 Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 154 | |
| 155 | /* |
| 156 | * Identify the area of the system impacted by the event. |
| 157 | */ |
| 158 | message EventCategory { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 159 | enum Types { |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 160 | 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 | */ |
| 173 | message EventSubCategory { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 174 | enum Types { |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 175 | PON = 0; |
| 176 | OLT = 1; |
| 177 | ONT = 2; |
| 178 | ONU = 3; |
| 179 | NNI = 4; |
| 180 | // Add new event categories here. |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | /* |
| 185 | * Identify the type of event |
| 186 | */ |
| 187 | message EventType { |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame^] | 188 | enum Types { |
| 189 | CONFIG_EVENT = 0; |
| 190 | KPI_EVENT = 1; |
| 191 | KPI_EVENT2 = 2; |
| 192 | DEVICE_EVENT = 3; |
| 193 | RPC_EVENT = 4; |
| 194 | } |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 195 | } |
| 196 | |
| 197 | /* |
| 198 | * Identify the functional category originating the event |
| 199 | */ |
| 200 | message EventHeader { |
| 201 | // Unique ID for this event. e.g. voltha.some_olt.1234 |
| 202 | string id = 1; |
| 203 | |
| 204 | // Refers to the functional area affect by the event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 205 | EventCategory.Types category = 2; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 206 | |
| 207 | // Refers to functional category of the event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 208 | EventSubCategory.Types sub_category = 3; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 209 | |
| 210 | // Refers to the type of the event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 211 | EventType.Types type = 4; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 212 | |
| 213 | // The version identifier for this event type, thus allowing each |
| 214 | // event type to evolve independently. The version should be in the |
| 215 | // format “MAJOR.MINOR” format and minor changes must only be additive |
| 216 | // and non-breaking. |
| 217 | string type_version = 5; |
| 218 | |
| 219 | // Timestamp at which the event was first raised. |
| 220 | // This represents the UTC time stamp since epoch (in seconds) when the |
| 221 | // the event was first raised from the source entity. |
| 222 | // If the source entity doesn't send the raised_ts, this shall be set |
| 223 | // to timestamp when the event was received. |
Scott Baker | 7c854aa | 2020-02-10 17:25:31 -0800 | [diff] [blame] | 224 | google.protobuf.Timestamp raised_ts = 6; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 225 | |
| 226 | // Timestamp at which the event was reported. |
| 227 | // This represents the UTC time stamp since epoch (in seconds) when the |
| 228 | // the event was reported (this time stamp is >= raised_ts). |
| 229 | // If the source entity that reported this event doesn't send the |
| 230 | // 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] | 231 | google.protobuf.Timestamp reported_ts = 7; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 232 | } |
| 233 | |
| 234 | /* |
| 235 | * Event Structure |
| 236 | */ |
| 237 | message Event { |
| 238 | // event header |
| 239 | EventHeader header = 1; |
| 240 | |
| 241 | // oneof event types referred by EventType. |
| 242 | oneof event_type { |
| 243 | // Refers to ConfigEvent |
| 244 | ConfigEvent config_event = 2; |
| 245 | |
| 246 | // Refers to KpiEvent |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame^] | 247 | KpiEvent kpi_event = 3; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 248 | |
| 249 | // Refers to KpiEvent2 |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame^] | 250 | KpiEvent2 kpi_event2 = 4; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 251 | |
| 252 | // Refers to DeviceEvent |
| 253 | DeviceEvent device_event = 5; |
| 254 | |
Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame^] | 255 | // Refers to an RPC Event |
| 256 | RPCEvent rpc_event = 6; |
| 257 | |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 258 | // Add other event types here. |
| 259 | |
| 260 | } |
| 261 | } |
| 262 | |