Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | |
Scott Baker | 383964b | 2019-11-01 14:26:07 -0700 | [diff] [blame] | 3 | option go_package = "github.com/opencord/voltha-protos/v2/go/voltha"; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 4 | |
| 5 | package voltha; |
| 6 | |
| 7 | import "google/protobuf/any.proto"; |
| 8 | import "voltha_protos/common.proto"; |
| 9 | import "voltha_protos/meta.proto"; |
| 10 | import "voltha_protos/openflow_13.proto"; |
| 11 | import "voltha_protos/yang_options.proto"; |
| 12 | |
| 13 | // A Device Type |
| 14 | message DeviceType { |
| 15 | |
| 16 | // Unique name for the device type |
| 17 | string id = 1; |
| 18 | |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 19 | // Unique vendor id for the device type applicable to ONU |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 20 | // 4 bytes of vendor id from ONU serial number |
| 21 | string vendor_id = 5; |
| 22 | |
| 23 | repeated string vendor_ids = 6; |
| 24 | |
| 25 | // Name of the adapter that handles device type |
| 26 | string adapter = 2; |
| 27 | |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 28 | // Capabilities |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 29 | bool accepts_bulk_flow_update = 3; |
| 30 | bool accepts_add_remove_flow_updates = 4; |
| 31 | bool accepts_direct_logical_flows_update = 7; |
| 32 | |
| 33 | } |
| 34 | |
| 35 | // A plurality of device types |
| 36 | message DeviceTypes { |
| 37 | repeated DeviceType items = 1; |
| 38 | } |
| 39 | |
| 40 | message PmConfig { |
| 41 | enum PmType { |
| 42 | COUNTER = 0; |
| 43 | GAUGE = 1; |
| 44 | STATE = 2; |
| 45 | CONTEXT = 3; |
| 46 | } |
| 47 | string name = 1; |
| 48 | PmType type = 2; |
| 49 | bool enabled = 3; // Whether or not this metric makes it to Kafka |
| 50 | uint32 sample_freq = 4; // Sample rate in 10ths of a second |
| 51 | } |
| 52 | |
| 53 | message PmGroupConfig { |
| 54 | string group_name = 1; |
| 55 | uint32 group_freq = 2; // Frequency applicable to the grop |
| 56 | bool enabled = 3; // Enable/disable group level only |
| 57 | repeated PmConfig metrics = 4; |
| 58 | } |
| 59 | |
| 60 | message PmConfigs { |
| 61 | string id = 1; // To work around a chameleon POST bug |
| 62 | uint32 default_freq = 2; // Default sample rate |
| 63 | // Forces group names and group semantics |
| 64 | bool grouped = 3 [(access) = READ_ONLY]; |
| 65 | // Allows Pm to set an individual sample frequency |
| 66 | bool freq_override = 4 [(access) = READ_ONLY]; |
| 67 | repeated PmGroupConfig groups = 5; // The groups if grouped is true |
| 68 | repeated PmConfig metrics = 6; // The metrics themselves if grouped is false. |
| 69 | } |
| 70 | |
| 71 | // Describes instance of software image on the device |
| 72 | message Image { |
| 73 | string name = 1; // software patch name |
| 74 | string version = 2; // version of software |
| 75 | string hash = 3; // md5 hash |
| 76 | string install_datetime = 4; // combined date and time expressed in UTC. |
| 77 | // use ISO 8601 format for date and time |
| 78 | |
| 79 | // The active software image is one that is currently loaded and executing |
| 80 | // in the ONU or circuit pack. Under normal operation, one software image |
| 81 | // is always active while the other is inactive. Under no circumstances are |
| 82 | // both software images allowed to be active at the same time |
| 83 | bool is_active = 5; // True if the image is active |
| 84 | |
| 85 | // The committed software image is loaded and executed upon reboot of the |
| 86 | // ONU and/or circuit pack. During normal operation, one software image is |
| 87 | // always committed, while the other is uncommitted. |
| 88 | bool is_committed = 6; // True if the image is committed |
| 89 | |
| 90 | // A software image is valid if it has been verified to be an executable |
| 91 | // code image. The verification mechanism is not subject to standardization; |
| 92 | // however, it should include at least a data integrity (e.g., CRC) check of |
| 93 | // the entire code image. |
| 94 | bool is_valid = 7; // True if the image is valid |
| 95 | } |
| 96 | |
| 97 | // List of software on the device |
| 98 | message Images { |
| 99 | repeated Image image = 1; |
| 100 | } |
| 101 | |
| 102 | message ImageDownload { |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 103 | option (common.yang_child_rule) = MOVE_TO_PARENT_LEVEL; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 104 | |
| 105 | enum ImageDownloadState { |
| 106 | DOWNLOAD_UNKNOWN = 0; |
| 107 | DOWNLOAD_SUCCEEDED = 1; |
| 108 | DOWNLOAD_REQUESTED = 2; |
| 109 | DOWNLOAD_STARTED = 3; |
| 110 | DOWNLOAD_FAILED = 4; |
| 111 | DOWNLOAD_UNSUPPORTED = 5; |
| 112 | DOWNLOAD_CANCELLED = 6; |
| 113 | } |
| 114 | |
| 115 | enum ImageDownloadFailureReason { |
| 116 | NO_ERROR = 0; |
| 117 | INVALID_URL = 1; |
| 118 | DEVICE_BUSY = 2; |
| 119 | INSUFFICIENT_SPACE = 3; |
| 120 | UNKNOWN_ERROR = 4; |
| 121 | CANCELLED = 5; |
| 122 | } |
| 123 | |
| 124 | enum ImageActivateState { |
| 125 | IMAGE_UNKNOWN = 0; |
| 126 | IMAGE_INACTIVE = 1; |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 127 | IMAGE_ACTIVATING = 2; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 128 | IMAGE_ACTIVE = 3; |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 129 | IMAGE_REVERTING = 4; |
| 130 | IMAGE_REVERTED = 5; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 131 | } |
| 132 | |
| 133 | // Device Identifier |
| 134 | string id = 1; |
| 135 | |
| 136 | // Image unique identifier |
| 137 | string name = 2; |
| 138 | |
| 139 | // URL where the image is available |
| 140 | // should include username password |
| 141 | string url = 3; |
| 142 | |
| 143 | // CRC of the image to be verified aginst |
| 144 | uint32 crc = 4; |
| 145 | |
| 146 | // Download state |
| 147 | ImageDownloadState download_state = 5; |
| 148 | |
| 149 | // Downloaded version |
| 150 | string image_version = 6; |
| 151 | |
| 152 | // Bytes downloaded |
| 153 | uint32 downloaded_bytes = 7; |
| 154 | |
| 155 | // Download failure reason |
| 156 | ImageDownloadFailureReason reason= 8; |
| 157 | |
| 158 | // Additional info |
| 159 | string additional_info = 9; |
| 160 | |
| 161 | // Save current configuration |
| 162 | bool save_config = 10; |
| 163 | |
| 164 | // Image local location |
| 165 | string local_dir = 11; |
| 166 | |
| 167 | // Image activation state |
| 168 | ImageActivateState image_state = 12; |
| 169 | |
| 170 | // Image file size |
| 171 | uint32 file_size = 13; |
| 172 | } |
| 173 | |
| 174 | message ImageDownloads { |
| 175 | repeated ImageDownload items = 2; |
| 176 | } |
| 177 | |
| 178 | message Port { |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 179 | option (common.yang_child_rule) = MOVE_TO_PARENT_LEVEL; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 180 | |
| 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 | |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 197 | common.AdminState.AdminState admin_state = 5; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 198 | |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 199 | common.OperStatus.OperStatus 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 | |
| 216 | } |
| 217 | |
| 218 | message Ports { |
| 219 | repeated Port items = 1; |
| 220 | } |
| 221 | |
| 222 | // A Physical Device instance |
| 223 | message Device { |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 224 | option (common.yang_child_rule) = MOVE_TO_PARENT_LEVEL; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 225 | |
| 226 | // Voltha's device identifier |
| 227 | string id = 1 [(access) = READ_ONLY]; |
| 228 | |
| 229 | // Device type, refers to one of the registered device types |
| 230 | string type = 2 [(access) = READ_ONLY]; |
| 231 | |
| 232 | // Is this device a root device. Each logical switch has one root |
| 233 | // device that is associated with the logical flow switch. |
| 234 | bool root = 3 [(access) = READ_ONLY]; |
| 235 | |
| 236 | // Parent device id, in the device tree (for a root device, the parent_id |
| 237 | // is the logical_device.id) |
| 238 | string parent_id = 4 [(access) = READ_ONLY]; |
| 239 | uint32 parent_port_no = 20 [(access) = READ_ONLY]; |
| 240 | |
| 241 | // Vendor, version, serial number, etc. |
| 242 | string vendor = 5 [(access) = READ_ONLY]; |
| 243 | string model = 6 [(access) = READ_ONLY]; |
| 244 | string hardware_version = 7 [(access) = READ_ONLY]; |
| 245 | string firmware_version = 8 [(access) = READ_ONLY]; |
| 246 | // List of software on the device |
| 247 | Images images = 9 [(access) = READ_ONLY]; |
| 248 | string serial_number = 10 [(access) = READ_ONLY]; |
| 249 | string vendor_id = 24 [(access) = READ_ONLY]; |
| 250 | |
| 251 | // Addapter that takes care of device |
| 252 | string adapter = 11 [(access) = READ_ONLY]; |
| 253 | |
| 254 | // Device contact on vlan (if 0, no vlan) |
| 255 | uint32 vlan = 12; |
| 256 | |
| 257 | message ProxyAddress { |
| 258 | string device_id = 1; // Which device to use as proxy to this device |
| 259 | string device_type = 2; // The device type of the proxy device to use as the adapter name |
| 260 | uint32 channel_id = 3; // Sub-address within proxy |
| 261 | uint32 channel_group_id = 4; // Channel Group index |
| 262 | string channel_termination = 5; // Channel Termination name |
| 263 | uint32 onu_id = 6; // onu identifier; optional |
| 264 | uint32 onu_session_id = 7; // session identifier for the ONU; optional |
| 265 | }; |
| 266 | |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 267 | // Device contact MAC address (format: "xx:xx:xx:xx:xx:xx") |
| 268 | string mac_address = 13; |
| 269 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 270 | oneof address { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 271 | |
| 272 | // Device contact IPv4 address (format: "a.b.c.d" or can use hostname too) |
| 273 | string ipv4_address = 14; |
| 274 | |
| 275 | // Device contact IPv6 address using the canonical string form |
| 276 | // ("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx") |
| 277 | string ipv6_address = 15; |
| 278 | |
| 279 | string host_and_port = 21; |
| 280 | |
| 281 | }; |
| 282 | string extra_args = 23; // Used to pass additional device specific arguments |
| 283 | |
| 284 | ProxyAddress proxy_address = 19; |
| 285 | |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 286 | common.AdminState.AdminState admin_state = 16; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 287 | |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 288 | common.OperStatus.OperStatus oper_status = 17 [(access) = READ_ONLY]; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 289 | |
| 290 | string reason = 22 [(access) = READ_ONLY]; // Used in FAILED state |
| 291 | |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 292 | common.ConnectStatus.ConnectStatus connect_status = 18 [(access) = READ_ONLY]; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 293 | |
| 294 | // TODO additional common attribute here |
| 295 | |
| 296 | // Device type specific attributes |
| 297 | google.protobuf.Any custom = 64; |
| 298 | |
| 299 | repeated Port ports = 128 [(child_node) = {key: "port_no"}]; |
| 300 | openflow_13.Flows flows = 129 [(child_node) = {}]; |
| 301 | openflow_13.FlowGroups flow_groups = 130 [(child_node) = {}]; |
| 302 | // PmConfigs will eventually converted to a child node of the |
| 303 | // device to falicitata callbacks and to simplify manipulation. |
| 304 | PmConfigs pm_configs = 131 [(child_node) = {}]; |
| 305 | |
| 306 | repeated ImageDownload image_downloads = 133 [(child_node) = {key: "name"}]; |
| 307 | } |
| 308 | |
| 309 | message Devices { |
| 310 | repeated Device items = 1; |
| 311 | } |
| 312 | |
| 313 | message SimulateAlarmRequest { |
| 314 | enum OperationType { |
| 315 | RAISE = 0; |
| 316 | CLEAR = 1; |
| 317 | } |
| 318 | // Device Identifier |
| 319 | string id = 1; |
| 320 | string indicator = 2; |
| 321 | string intf_id = 3; |
| 322 | string port_type_name = 4; |
| 323 | string onu_device_id = 5; |
| 324 | int32 inverse_bit_error_rate = 6; |
| 325 | int32 drift = 7; |
| 326 | int32 new_eqd = 8; |
| 327 | string onu_serial_number = 9; |
| 328 | OperationType operation = 10; |
| 329 | } |