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 | |
| 20 | // Unique venor id for the device type applicable to ONU |
| 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 | |
| 29 | // Capabilitities |
| 30 | |
| 31 | bool accepts_bulk_flow_update = 3; |
| 32 | bool accepts_add_remove_flow_updates = 4; |
| 33 | |
| 34 | } |
| 35 | |
| 36 | // A plurality of device types |
| 37 | message DeviceTypes { |
| 38 | repeated DeviceType items = 1; |
| 39 | } |
| 40 | |
| 41 | message PmConfig { |
| 42 | enum PmType { |
| 43 | COUNTER = 0; |
| 44 | GUAGE = 1; |
| 45 | STATE = 2; |
| 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 { |
| 103 | option (yang_child_rule) = MOVE_TO_PARENT_LEVEL; |
| 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 | } |
| 113 | |
| 114 | enum ImageDownloadFailureReason { |
| 115 | NO_ERROR = 0; |
| 116 | INVALID_URL = 1; |
| 117 | DEVICE_BUSY = 2; |
| 118 | INSUFFICIENT_SPACE = 3; |
| 119 | UNKNOWN_ERROR = 4; |
| 120 | } |
| 121 | |
| 122 | enum ImageActivateState { |
| 123 | IMAGE_UNKNOWN = 0; |
| 124 | IMAGE_INACTIVE = 1; |
| 125 | IMAGE_ACTIVATE = 2; |
| 126 | IMAGE_ACTIVE = 3; |
| 127 | IMAGE_REVERT = 4; |
| 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 |
| 144 | ImageDownloadState state = 5; |
| 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 |
| 246 | uint32 channel_id = 2; // Sub-address within proxy |
| 247 | uint32 channel_group_id = 5; // Channel Group index |
| 248 | string channel_termination = 6; // Channel Termination name |
| 249 | uint32 onu_id = 3; // onu identifier; optional |
| 250 | uint32 onu_session_id = 4; // session identifier for the ONU; optional |
| 251 | }; |
| 252 | |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 253 | // Device contact MAC address (format: "xx:xx:xx:xx:xx:xx") |
| 254 | string mac_address = 13; |
khenaidoo | abad44c | 2018-08-03 16:58:35 -0400 | [diff] [blame] | 255 | |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 256 | oneof address { |
khenaidoo | abad44c | 2018-08-03 16:58:35 -0400 | [diff] [blame] | 257 | // Device contact IPv4 address (format: "a.b.c.d" or can use hostname too) |
| 258 | string ipv4_address = 14; |
| 259 | |
| 260 | // Device contact IPv6 address using the canonical string form |
| 261 | // ("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx") |
| 262 | string ipv6_address = 15; |
| 263 | |
| 264 | string host_and_port = 21; |
| 265 | |
| 266 | }; |
| 267 | string extra_args = 23; // Used to pass additional device specific arguments |
| 268 | |
| 269 | ProxyAddress proxy_address = 19; |
| 270 | |
| 271 | AdminState.AdminState admin_state = 16; |
| 272 | |
| 273 | OperStatus.OperStatus oper_status = 17 [(access) = READ_ONLY]; |
| 274 | |
| 275 | string reason = 22 [(access) = READ_ONLY]; // Used in FAILED state |
| 276 | |
| 277 | ConnectStatus.ConnectStatus connect_status = 18 [(access) = READ_ONLY]; |
| 278 | |
| 279 | // TODO additional common attribute here |
| 280 | |
| 281 | // Device type specific attributes |
| 282 | google.protobuf.Any custom = 64; |
| 283 | |
| 284 | repeated Port ports = 128 [(child_node) = {key: "port_no"}]; |
| 285 | openflow_13.Flows flows = 129 [(child_node) = {}]; |
| 286 | openflow_13.FlowGroups flow_groups = 130 [(child_node) = {}]; |
| 287 | // PmConfigs will eventually converted to a child node of the |
| 288 | // device to falicitata callbacks and to simplify manipulation. |
| 289 | PmConfigs pm_configs = 131 [(child_node) = {}]; |
| 290 | |
| 291 | repeated ImageDownload image_downloads = 133 [(child_node) = {key: "name"}]; |
| 292 | } |
| 293 | |
| 294 | message Devices { |
| 295 | repeated Device items = 1; |
| 296 | } |