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 | /* |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 109 | * Describes the events specific to device |
| 110 | */ |
| 111 | message DeviceEvent { |
| 112 | // Identifier of the originating resource of the event, for ex: device_id |
| 113 | string resource_id = 1; |
| 114 | |
| 115 | // device_event_name indicates clearly the name of the device event |
| 116 | string device_event_name = 2; |
| 117 | |
| 118 | // Textual explanation of the device event |
| 119 | string description = 3; |
| 120 | |
| 121 | // Key/Value storage for extra information that may give context to the event |
| 122 | map<string, string> context = 4; |
| 123 | |
| 124 | } |
| 125 | |
| 126 | /* |
| 127 | * Identify the area of the system impacted by the event. |
| 128 | */ |
| 129 | message EventCategory { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 130 | enum Types { |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 131 | COMMUNICATION = 0; |
| 132 | ENVIRONMENT = 1; |
| 133 | EQUIPMENT = 2; |
| 134 | SERVICE = 3; |
| 135 | PROCESSING = 4; |
| 136 | SECURITY = 5; |
| 137 | // Add new event areas here |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | /* |
| 142 | * Identify the functional category originating the event |
| 143 | */ |
| 144 | message EventSubCategory { |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 145 | enum Types { |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 146 | PON = 0; |
| 147 | OLT = 1; |
| 148 | ONT = 2; |
| 149 | ONU = 3; |
| 150 | NNI = 4; |
| 151 | // Add new event categories here. |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | /* |
| 156 | * Identify the type of event |
| 157 | */ |
| 158 | message EventType { |
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 | CONFIG_EVENT = 0; |
| 161 | KPI_EVENT = 1; |
| 162 | KPI_EVENT2 = 2; |
| 163 | DEVICE_EVENT = 3; |
| 164 | |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | /* |
| 169 | * Identify the functional category originating the event |
| 170 | */ |
| 171 | message EventHeader { |
| 172 | // Unique ID for this event. e.g. voltha.some_olt.1234 |
| 173 | string id = 1; |
| 174 | |
| 175 | // Refers to the functional area affect by the event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 176 | EventCategory.Types category = 2; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 177 | |
| 178 | // Refers to functional category of the event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 179 | EventSubCategory.Types sub_category = 3; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 180 | |
| 181 | // Refers to the type of the event |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 182 | EventType.Types type = 4; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 183 | |
| 184 | // The version identifier for this event type, thus allowing each |
| 185 | // event type to evolve independently. The version should be in the |
| 186 | // format “MAJOR.MINOR” format and minor changes must only be additive |
| 187 | // and non-breaking. |
| 188 | string type_version = 5; |
| 189 | |
| 190 | // Timestamp at which the event was first raised. |
| 191 | // This represents the UTC time stamp since epoch (in seconds) when the |
| 192 | // the event was first raised from the source entity. |
| 193 | // If the source entity doesn't send the raised_ts, this shall be set |
| 194 | // to timestamp when the event was received. |
Scott Baker | 7c854aa | 2020-02-10 17:25:31 -0800 | [diff] [blame] | 195 | google.protobuf.Timestamp raised_ts = 6; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 196 | |
| 197 | // Timestamp at which the event was reported. |
| 198 | // This represents the UTC time stamp since epoch (in seconds) when the |
| 199 | // the event was reported (this time stamp is >= raised_ts). |
| 200 | // If the source entity that reported this event doesn't send the |
| 201 | // 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] | 202 | google.protobuf.Timestamp reported_ts = 7; |
Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 203 | |
| 204 | |
| 205 | } |
| 206 | |
| 207 | /* |
| 208 | * Event Structure |
| 209 | */ |
| 210 | message Event { |
| 211 | // event header |
| 212 | EventHeader header = 1; |
| 213 | |
| 214 | // oneof event types referred by EventType. |
| 215 | oneof event_type { |
| 216 | // Refers to ConfigEvent |
| 217 | ConfigEvent config_event = 2; |
| 218 | |
| 219 | // Refers to KpiEvent |
| 220 | KpiEvent kpi_event = 3; |
| 221 | |
| 222 | // Refers to KpiEvent2 |
| 223 | KpiEvent2 kpi_event2 = 4; |
| 224 | |
| 225 | // Refers to DeviceEvent |
| 226 | DeviceEvent device_event = 5; |
| 227 | |
| 228 | // Add other event types here. |
| 229 | |
| 230 | } |
| 231 | } |
| 232 | |