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"; |
| 5 | option java_outer_classname = "VolthaDevice"; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 6 | |
| 7 | package voltha; |
| 8 | |
| 9 | import "google/protobuf/any.proto"; |
Maninder | c4e609e | 2020-12-23 16:28:22 +0530 | [diff] [blame^] | 10 | import "google/protobuf/timestamp.proto"; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 11 | import "voltha_protos/common.proto"; |
| 12 | import "voltha_protos/meta.proto"; |
| 13 | import "voltha_protos/openflow_13.proto"; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 14 | |
| 15 | // A Device Type |
| 16 | message DeviceType { |
| 17 | |
| 18 | // Unique name for the device type |
| 19 | string id = 1; |
| 20 | |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 21 | // Unique vendor id for the device type applicable to ONU |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 22 | // 4 bytes of vendor id from ONU serial number |
| 23 | string vendor_id = 5; |
| 24 | |
| 25 | repeated string vendor_ids = 6; |
| 26 | |
| 27 | // Name of the adapter that handles device type |
| 28 | string adapter = 2; |
| 29 | |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 30 | // Capabilities |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 31 | bool accepts_bulk_flow_update = 3; |
| 32 | bool accepts_add_remove_flow_updates = 4; |
| 33 | bool accepts_direct_logical_flows_update = 7; |
| 34 | |
| 35 | } |
| 36 | |
| 37 | // A plurality of device types |
| 38 | message DeviceTypes { |
| 39 | repeated DeviceType items = 1; |
| 40 | } |
| 41 | |
| 42 | message PmConfig { |
| 43 | enum PmType { |
| 44 | COUNTER = 0; |
| 45 | GAUGE = 1; |
| 46 | STATE = 2; |
| 47 | CONTEXT = 3; |
| 48 | } |
| 49 | string name = 1; |
| 50 | PmType type = 2; |
| 51 | bool enabled = 3; // Whether or not this metric makes it to Kafka |
| 52 | uint32 sample_freq = 4; // Sample rate in 10ths of a second |
| 53 | } |
| 54 | |
| 55 | message PmGroupConfig { |
| 56 | string group_name = 1; |
| 57 | uint32 group_freq = 2; // Frequency applicable to the grop |
| 58 | bool enabled = 3; // Enable/disable group level only |
| 59 | repeated PmConfig metrics = 4; |
| 60 | } |
| 61 | |
| 62 | message PmConfigs { |
| 63 | string id = 1; // To work around a chameleon POST bug |
| 64 | uint32 default_freq = 2; // Default sample rate |
| 65 | // Forces group names and group semantics |
| 66 | bool grouped = 3 [(access) = READ_ONLY]; |
| 67 | // Allows Pm to set an individual sample frequency |
| 68 | bool freq_override = 4 [(access) = READ_ONLY]; |
| 69 | repeated PmGroupConfig groups = 5; // The groups if grouped is true |
| 70 | repeated PmConfig metrics = 6; // The metrics themselves if grouped is false. |
Rohan Agrawal | 065c818 | 2020-06-29 11:05:32 +0000 | [diff] [blame] | 71 | uint32 max_skew = 7; //Default value is set to 5 seconds |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | // Describes instance of software image on the device |
| 75 | message Image { |
| 76 | string name = 1; // software patch name |
| 77 | string version = 2; // version of software |
| 78 | string hash = 3; // md5 hash |
| 79 | string install_datetime = 4; // combined date and time expressed in UTC. |
| 80 | // use ISO 8601 format for date and time |
| 81 | |
| 82 | // The active software image is one that is currently loaded and executing |
| 83 | // in the ONU or circuit pack. Under normal operation, one software image |
| 84 | // is always active while the other is inactive. Under no circumstances are |
| 85 | // both software images allowed to be active at the same time |
| 86 | bool is_active = 5; // True if the image is active |
| 87 | |
| 88 | // The committed software image is loaded and executed upon reboot of the |
| 89 | // ONU and/or circuit pack. During normal operation, one software image is |
| 90 | // always committed, while the other is uncommitted. |
| 91 | bool is_committed = 6; // True if the image is committed |
| 92 | |
| 93 | // A software image is valid if it has been verified to be an executable |
| 94 | // code image. The verification mechanism is not subject to standardization; |
| 95 | // however, it should include at least a data integrity (e.g., CRC) check of |
| 96 | // the entire code image. |
| 97 | bool is_valid = 7; // True if the image is valid |
| 98 | } |
| 99 | |
| 100 | // List of software on the device |
| 101 | message Images { |
| 102 | repeated Image image = 1; |
| 103 | } |
| 104 | |
Kent Hagerman | 66e56b4 | 2020-07-09 14:30:23 -0400 | [diff] [blame] | 105 | //TODO: ImageDownload is not actively used (05/19/2020). When this is tackled, can remove extra/unnecessary fields. |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 106 | message ImageDownload { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 107 | enum ImageDownloadState { |
| 108 | DOWNLOAD_UNKNOWN = 0; |
| 109 | DOWNLOAD_SUCCEEDED = 1; |
| 110 | DOWNLOAD_REQUESTED = 2; |
| 111 | DOWNLOAD_STARTED = 3; |
| 112 | DOWNLOAD_FAILED = 4; |
| 113 | DOWNLOAD_UNSUPPORTED = 5; |
| 114 | DOWNLOAD_CANCELLED = 6; |
| 115 | } |
| 116 | |
| 117 | enum ImageDownloadFailureReason { |
| 118 | NO_ERROR = 0; |
| 119 | INVALID_URL = 1; |
| 120 | DEVICE_BUSY = 2; |
| 121 | INSUFFICIENT_SPACE = 3; |
| 122 | UNKNOWN_ERROR = 4; |
| 123 | CANCELLED = 5; |
| 124 | } |
| 125 | |
| 126 | enum ImageActivateState { |
| 127 | IMAGE_UNKNOWN = 0; |
| 128 | IMAGE_INACTIVE = 1; |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 129 | IMAGE_ACTIVATING = 2; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 130 | IMAGE_ACTIVE = 3; |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 131 | IMAGE_REVERTING = 4; |
| 132 | IMAGE_REVERTED = 5; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | // Device Identifier |
| 136 | string id = 1; |
| 137 | |
| 138 | // Image unique identifier |
| 139 | string name = 2; |
| 140 | |
| 141 | // URL where the image is available |
| 142 | // should include username password |
| 143 | string url = 3; |
| 144 | |
| 145 | // CRC of the image to be verified aginst |
| 146 | uint32 crc = 4; |
| 147 | |
| 148 | // Download state |
| 149 | ImageDownloadState download_state = 5; |
| 150 | |
| 151 | // Downloaded version |
| 152 | string image_version = 6; |
| 153 | |
| 154 | // Bytes downloaded |
| 155 | uint32 downloaded_bytes = 7; |
| 156 | |
| 157 | // Download failure reason |
| 158 | ImageDownloadFailureReason reason= 8; |
| 159 | |
| 160 | // Additional info |
| 161 | string additional_info = 9; |
| 162 | |
| 163 | // Save current configuration |
| 164 | bool save_config = 10; |
| 165 | |
| 166 | // Image local location |
| 167 | string local_dir = 11; |
| 168 | |
| 169 | // Image activation state |
| 170 | ImageActivateState image_state = 12; |
Kent Hagerman | 66e56b4 | 2020-07-09 14:30:23 -0400 | [diff] [blame] | 171 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 172 | // Image file size |
| 173 | uint32 file_size = 13; |
| 174 | } |
| 175 | |
| 176 | message ImageDownloads { |
| 177 | repeated ImageDownload items = 2; |
| 178 | } |
| 179 | |
| 180 | message Port { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 181 | enum PortType { |
| 182 | UNKNOWN = 0; |
| 183 | ETHERNET_NNI = 1; |
| 184 | ETHERNET_UNI = 2; |
| 185 | PON_OLT = 3; |
| 186 | PON_ONU = 4; |
| 187 | VENET_OLT = 5; |
| 188 | VENET_ONU = 6; |
| 189 | } |
| 190 | |
| 191 | uint32 port_no = 1; // Device-unique port number |
| 192 | |
| 193 | string label = 2; // Arbitrary port label |
| 194 | |
| 195 | PortType type = 3; // Type of port |
| 196 | |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 197 | common.AdminState.Types admin_state = 5; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 198 | |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 199 | common.OperStatus.Types oper_status = 6; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 200 | |
| 201 | string device_id = 7; // Unique .id of device that owns this port |
| 202 | |
| 203 | message PeerPort { |
| 204 | string device_id = 1; |
| 205 | uint32 port_no = 2; |
| 206 | } |
| 207 | repeated PeerPort peers = 8; |
| 208 | |
| 209 | fixed64 rx_packets = 9; |
| 210 | fixed64 rx_bytes = 10; |
| 211 | fixed64 rx_errors = 11; |
| 212 | fixed64 tx_packets = 12; |
| 213 | fixed64 tx_bytes = 13; |
| 214 | fixed64 tx_errors = 14; |
| 215 | |
khenaidoo | ce41ea4 | 2020-06-09 18:10:16 -0400 | [diff] [blame] | 216 | // ofp_port represents the characteristics of a port, e.g. hardware |
| 217 | // address and supported features. This field is relevant only for |
| 218 | // UNI and NNI ports. For PON ports, it can be left empty. |
| 219 | openflow_13.ofp_port ofp_port = 15; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 220 | } |
| 221 | |
| 222 | message Ports { |
| 223 | repeated Port items = 1; |
| 224 | } |
| 225 | |
Maninder | c4e609e | 2020-12-23 16:28:22 +0530 | [diff] [blame^] | 226 | // A complete device state |
| 227 | message DeviceState { |
| 228 | common.AdminState.Types admin_state = 1; |
| 229 | common.OperStatus.Types oper_status = 2; |
| 230 | common.ConnectStatus.Types connect_status = 3; |
| 231 | } |
| 232 | |
| 233 | // A device state change |
| 234 | message DeviceStatesChange { |
| 235 | DeviceState previous = 1; |
| 236 | DeviceState current = 2; |
| 237 | } |
| 238 | |
| 239 | // A device update filter |
| 240 | message DeviceUpdateFilter { |
| 241 | // Device Id |
| 242 | string device_id = 1; |
| 243 | |
| 244 | // Provide update starting from this timestamp, inclusive |
| 245 | google.protobuf.Timestamp from_timestamp = 2; |
| 246 | |
| 247 | // Provide update starting to this timestamp, inclusive |
| 248 | google.protobuf.Timestamp to_timestamp = 3; |
| 249 | |
| 250 | // The operation that triggered the update, e.g. portCreated |
| 251 | string operation = 4; |
| 252 | |
| 253 | // The ID of that operation, e.g. log correlation ID |
| 254 | string operation_id = 5; |
| 255 | |
| 256 | // Component initiating the request, e.g. openolt |
| 257 | string requested_by = 6; |
| 258 | |
| 259 | // Operation status |
| 260 | common.OperationResp status = 7; |
| 261 | } |
| 262 | |
| 263 | // A device update |
| 264 | message DeviceUpdate { |
| 265 | // Device Id |
| 266 | string device_id = 1; |
| 267 | |
| 268 | // Timestamp of the update |
| 269 | google.protobuf.Timestamp timestamp = 2; |
| 270 | |
| 271 | // The operation that triggered the update, e.g. portCreated |
| 272 | string operation = 3; |
| 273 | |
| 274 | // The ID of that operation, e.g. log correlation ID |
| 275 | string operation_id = 4; |
| 276 | |
| 277 | // Component initiating the request, e.g. openolt |
| 278 | string requested_by = 5; |
| 279 | |
| 280 | // State change, if any, as a result of that update |
| 281 | DeviceStatesChange state_change = 6; |
| 282 | |
| 283 | // Operation status |
| 284 | common.OperationResp status = 7; |
| 285 | |
| 286 | // A brief description to provide more context to this update |
| 287 | string description = 8; |
| 288 | } |
| 289 | |
| 290 | message DeviceUpdates { |
| 291 | repeated DeviceUpdate items = 1; |
| 292 | } |
| 293 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 294 | // A Physical Device instance |
| 295 | message Device { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 296 | // Voltha's device identifier |
| 297 | string id = 1 [(access) = READ_ONLY]; |
| 298 | |
| 299 | // Device type, refers to one of the registered device types |
| 300 | string type = 2 [(access) = READ_ONLY]; |
| 301 | |
| 302 | // Is this device a root device. Each logical switch has one root |
| 303 | // device that is associated with the logical flow switch. |
| 304 | bool root = 3 [(access) = READ_ONLY]; |
| 305 | |
| 306 | // Parent device id, in the device tree (for a root device, the parent_id |
| 307 | // is the logical_device.id) |
| 308 | string parent_id = 4 [(access) = READ_ONLY]; |
| 309 | uint32 parent_port_no = 20 [(access) = READ_ONLY]; |
| 310 | |
| 311 | // Vendor, version, serial number, etc. |
| 312 | string vendor = 5 [(access) = READ_ONLY]; |
| 313 | string model = 6 [(access) = READ_ONLY]; |
| 314 | string hardware_version = 7 [(access) = READ_ONLY]; |
| 315 | string firmware_version = 8 [(access) = READ_ONLY]; |
| 316 | // List of software on the device |
| 317 | Images images = 9 [(access) = READ_ONLY]; |
| 318 | string serial_number = 10 [(access) = READ_ONLY]; |
| 319 | string vendor_id = 24 [(access) = READ_ONLY]; |
| 320 | |
| 321 | // Addapter that takes care of device |
| 322 | string adapter = 11 [(access) = READ_ONLY]; |
| 323 | |
| 324 | // Device contact on vlan (if 0, no vlan) |
| 325 | uint32 vlan = 12; |
| 326 | |
| 327 | message ProxyAddress { |
| 328 | string device_id = 1; // Which device to use as proxy to this device |
| 329 | string device_type = 2; // The device type of the proxy device to use as the adapter name |
| 330 | uint32 channel_id = 3; // Sub-address within proxy |
| 331 | uint32 channel_group_id = 4; // Channel Group index |
| 332 | string channel_termination = 5; // Channel Termination name |
| 333 | uint32 onu_id = 6; // onu identifier; optional |
| 334 | uint32 onu_session_id = 7; // session identifier for the ONU; optional |
| 335 | }; |
| 336 | |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 337 | // Device contact MAC address (format: "xx:xx:xx:xx:xx:xx") |
| 338 | string mac_address = 13; |
| 339 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 340 | oneof address { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 341 | |
| 342 | // Device contact IPv4 address (format: "a.b.c.d" or can use hostname too) |
| 343 | string ipv4_address = 14; |
| 344 | |
| 345 | // Device contact IPv6 address using the canonical string form |
| 346 | // ("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx") |
| 347 | string ipv6_address = 15; |
| 348 | |
| 349 | string host_and_port = 21; |
| 350 | |
| 351 | }; |
| 352 | string extra_args = 23; // Used to pass additional device specific arguments |
| 353 | |
| 354 | ProxyAddress proxy_address = 19; |
| 355 | |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 356 | common.AdminState.Types admin_state = 16; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 357 | |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 358 | common.OperStatus.Types oper_status = 17 [(access) = READ_ONLY]; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 359 | |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 360 | common.ConnectStatus.Types connect_status = 18 [(access) = READ_ONLY]; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 361 | |
| 362 | // TODO additional common attribute here |
| 363 | |
| 364 | // Device type specific attributes |
| 365 | google.protobuf.Any custom = 64; |
| 366 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 367 | // PmConfigs will eventually converted to a child node of the |
| 368 | // device to falicitata callbacks and to simplify manipulation. |
| 369 | PmConfigs pm_configs = 131 [(child_node) = {}]; |
| 370 | |
| 371 | repeated ImageDownload image_downloads = 133 [(child_node) = {key: "name"}]; |
| 372 | } |
| 373 | |
| 374 | message Devices { |
| 375 | repeated Device items = 1; |
| 376 | } |
| 377 | |
| 378 | message SimulateAlarmRequest { |
| 379 | enum OperationType { |
| 380 | RAISE = 0; |
| 381 | CLEAR = 1; |
| 382 | } |
| 383 | // Device Identifier |
| 384 | string id = 1; |
| 385 | string indicator = 2; |
| 386 | string intf_id = 3; |
| 387 | string port_type_name = 4; |
| 388 | string onu_device_id = 5; |
| 389 | int32 inverse_bit_error_rate = 6; |
| 390 | int32 drift = 7; |
| 391 | int32 new_eqd = 8; |
| 392 | string onu_serial_number = 9; |
| 393 | OperationType operation = 10; |
| 394 | } |