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