Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 1 | # |
| 2 | # Copyright 2018 the original author or authors. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
| 17 | """ |
| 18 | Openolt adapter. |
| 19 | """ |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 20 | from zope.interface import implementer |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 21 | import structlog |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 22 | |
| 23 | from openolt_device import OpenoltDevice |
| 24 | from voltha.adapters.interface import IAdapterInterface |
| 25 | from voltha.protos import third_party |
| 26 | from voltha.protos.adapter_pb2 import Adapter |
| 27 | from voltha.protos.adapter_pb2 import AdapterConfig |
| 28 | from voltha.protos.common_pb2 import LogLevel |
| 29 | from voltha.protos.device_pb2 import DeviceType, DeviceTypes |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 30 | from voltha.registry import registry |
| 31 | |
| 32 | _ = third_party |
| 33 | log = structlog.get_logger() |
| 34 | |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 35 | |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 36 | @implementer(IAdapterInterface) |
| 37 | class OpenoltAdapter(object): |
| 38 | name = 'openolt' |
| 39 | |
| 40 | supported_device_types = [ |
| 41 | DeviceType( |
| 42 | id=name, |
| 43 | adapter=name, |
Nicolas Palpacuer | 0c7c316 | 2018-08-08 11:27:57 -0400 | [diff] [blame] | 44 | accepts_bulk_flow_update=True, |
| 45 | accepts_direct_logical_flows_update=True |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 46 | ) |
| 47 | ] |
| 48 | |
| 49 | def __init__(self, adapter_agent, config): |
| 50 | self.adapter_agent = adapter_agent |
| 51 | self.config = config |
| 52 | self.descriptor = Adapter( |
| 53 | id=self.name, |
| 54 | vendor='OLT white box vendor', |
| 55 | version='0.1', |
| 56 | config=AdapterConfig(log_level=LogLevel.INFO) |
| 57 | ) |
| 58 | log.debug('openolt.__init__', adapter_agent=adapter_agent) |
| 59 | self.devices = dict() # device_id -> OpenoltDevice() |
| 60 | self.interface = registry('main').get_args().interface |
| 61 | self.logical_device_id_to_root_device_id = dict() |
Shad Ansari | 5dbc9c8 | 2018-05-10 03:29:31 +0000 | [diff] [blame] | 62 | self.num_devices = 0 |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 63 | |
| 64 | def start(self): |
| 65 | log.info('started', interface=self.interface) |
| 66 | |
| 67 | def stop(self): |
| 68 | log.info('stopped', interface=self.interface) |
| 69 | |
| 70 | def adapter_descriptor(self): |
| 71 | log.debug('get descriptor', interface=self.interface) |
| 72 | return self.descriptor |
| 73 | |
| 74 | def device_types(self): |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 75 | log.debug('get device_types', interface=self.interface, |
| 76 | items=self.supported_device_types) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 77 | return DeviceTypes(items=self.supported_device_types) |
| 78 | |
| 79 | def health(self): |
| 80 | log.debug('get health', interface=self.interface) |
| 81 | raise NotImplementedError() |
| 82 | |
| 83 | def change_master_state(self, master): |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 84 | log.debug('change_master_state', interface=self.interface, |
| 85 | master=master) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 86 | raise NotImplementedError() |
| 87 | |
| 88 | def adopt_device(self, device): |
| 89 | log.info('adopt-device', device=device) |
| 90 | kwargs = { |
| 91 | 'adapter_agent': self.adapter_agent, |
Shad Ansari | 5dbc9c8 | 2018-05-10 03:29:31 +0000 | [diff] [blame] | 92 | 'device': device, |
| 93 | 'device_num': self.num_devices + 1 |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 94 | } |
| 95 | try: |
| 96 | self.devices[device.id] = OpenoltDevice(**kwargs) |
| 97 | except Exception as e: |
| 98 | log.error('Failed to adopt OpenOLT device', error=e) |
| 99 | del self.devices[device.id] |
| 100 | raise |
Shad Ansari | 5dbc9c8 | 2018-05-10 03:29:31 +0000 | [diff] [blame] | 101 | else: |
| 102 | self.num_devices += 1 |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 103 | |
| 104 | def reconcile_device(self, device): |
| 105 | log.info('reconcile-device', device=device) |
Nicolas Palpacuer | 253461f | 2018-06-01 12:01:45 -0400 | [diff] [blame] | 106 | kwargs = { |
| 107 | 'adapter_agent': self.adapter_agent, |
| 108 | 'device': device, |
| 109 | 'device_num': self.num_devices + 1, |
| 110 | 'reconciliation': True |
| 111 | } |
| 112 | try: |
| 113 | reconciled_device = OpenoltDevice(**kwargs) |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 114 | log.debug('reconciled-device-recreated', |
| 115 | device_id=reconciled_device.device_id) |
Nicolas Palpacuer | 253461f | 2018-06-01 12:01:45 -0400 | [diff] [blame] | 116 | self.devices[device.id] = reconciled_device |
| 117 | except Exception as e: |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 118 | log.error('Failed to reconcile OpenOLT device', error=e, |
| 119 | exception_type=type(e).__name__) |
Nicolas Palpacuer | 253461f | 2018-06-01 12:01:45 -0400 | [diff] [blame] | 120 | del self.devices[device.id] |
| 121 | raise |
| 122 | else: |
| 123 | self.num_devices += 1 |
| 124 | # Invoke the children reconciliation which would setup the |
| 125 | # basic children data structures |
| 126 | self.adapter_agent.reconcile_child_devices(device.id) |
| 127 | return device |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 128 | |
| 129 | def abandon_device(self, device): |
| 130 | log.info('abandon-device', device=device) |
| 131 | raise NotImplementedError() |
| 132 | |
| 133 | def disable_device(self, device): |
| 134 | log.info('disable-device', device=device) |
Jonathan Davis | 0f917a2 | 2018-05-30 14:39:45 -0400 | [diff] [blame] | 135 | handler = self.devices[device.id] |
| 136 | handler.disable() |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 137 | |
| 138 | def reenable_device(self, device): |
| 139 | log.info('reenable-device', device=device) |
Jonathan Davis | 0f917a2 | 2018-05-30 14:39:45 -0400 | [diff] [blame] | 140 | handler = self.devices[device.id] |
| 141 | handler.reenable() |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 142 | |
| 143 | def reboot_device(self, device): |
| 144 | log.info('reboot_device', device=device) |
Nicolas Palpacuer | fd365ac | 2018-08-02 11:37:37 -0400 | [diff] [blame] | 145 | handler = self.devices[device.id] |
| 146 | handler.reboot() |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 147 | |
| 148 | def download_image(self, device, request): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 149 | log.info('image_download - Not implemented yet', device=device, |
| 150 | request=request) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 151 | raise NotImplementedError() |
| 152 | |
| 153 | def get_image_download_status(self, device, request): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 154 | log.info('get_image_download - Not implemented yet', device=device, |
| 155 | request=request) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 156 | raise NotImplementedError() |
| 157 | |
| 158 | def cancel_image_download(self, device, request): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 159 | log.info('cancel_image_download - Not implemented yet', device=device) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 160 | raise NotImplementedError() |
| 161 | |
| 162 | def activate_image_update(self, device, request): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 163 | log.info('activate_image_update - Not implemented yet', |
| 164 | device=device, request=request) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 165 | raise NotImplementedError() |
| 166 | |
| 167 | def revert_image_update(self, device, request): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 168 | log.info('revert_image_update - Not implemented yet', |
| 169 | device=device, request=request) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 170 | raise NotImplementedError() |
| 171 | |
| 172 | def self_test_device(self, device): |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 173 | # from voltha.protos.voltha_pb2 import SelfTestResponse |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 174 | log.info('Not implemented yet') |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 175 | raise NotImplementedError() |
| 176 | |
| 177 | def delete_device(self, device): |
| 178 | log.info('delete-device', device=device) |
Jonathan Davis | 0f917a2 | 2018-05-30 14:39:45 -0400 | [diff] [blame] | 179 | handler = self.devices[device.id] |
| 180 | handler.delete() |
| 181 | del self.devices[device.id] |
Nicolas Palpacuer | 0d44e68 | 2018-08-06 10:30:26 -0400 | [diff] [blame] | 182 | return device |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 183 | |
| 184 | def get_device_details(self, device): |
| 185 | log.debug('get_device_details', device=device) |
| 186 | raise NotImplementedError() |
| 187 | |
| 188 | def update_flows_bulk(self, device, flows, groups): |
| 189 | log.info('bulk-flow-update', device_id=device.id, |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 190 | number_of_flows=len(flows.items), number_of_groups=len( |
| 191 | groups.items)) |
| 192 | log.debug('flows and grousp details', flows=flows, groups=groups) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 193 | assert len(groups.items) == 0, "Cannot yet deal with groups" |
| 194 | handler = self.devices[device.id] |
| 195 | return handler.update_flow_table(flows.items) |
| 196 | |
| 197 | def update_flows_incrementally(self, device, flow_changes, group_changes): |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 198 | log.debug('update_flows_incrementally', device=device, |
| 199 | flow_changes=flow_changes, group_changes=group_changes) |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 200 | log.info('This device does not allow this, therefore it is Not ' |
| 201 | 'implemented') |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 202 | raise NotImplementedError() |
| 203 | |
Nicolas Palpacuer | 0c7c316 | 2018-08-08 11:27:57 -0400 | [diff] [blame] | 204 | def update_logical_flows(self, device_id, flows_to_add, flows_to_remove, |
| 205 | groups, device_rules_map): |
| 206 | |
| 207 | log.info('logical-flows-update', flows_to_add=len(flows_to_add), |
| 208 | flows_to_remove = len(flows_to_remove)) |
| 209 | log.debug('logical-flows-details', flows_to_add=flows_to_add, |
| 210 | flows_to_remove=flows_to_remove) |
| 211 | assert len(groups) == 0, "Cannot yet deal with groups" |
| 212 | handler = self.devices[device_id] |
| 213 | handler.update_logical_flows(flows_to_add, flows_to_remove, |
| 214 | device_rules_map) |
| 215 | |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 216 | def update_pm_config(self, device, pm_configs): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 217 | log.info('update_pm_config - Not implemented yet', device=device, |
| 218 | pm_configs=pm_configs) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 219 | raise NotImplementedError() |
| 220 | |
| 221 | def send_proxied_message(self, proxy_address, msg): |
| 222 | log.debug('send-proxied-message', proxy_address=proxy_address, msg=msg) |
| 223 | handler = self.devices[proxy_address.device_id] |
| 224 | handler.send_proxied_message(proxy_address, msg) |
| 225 | |
| 226 | def receive_proxied_message(self, proxy_address, msg): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 227 | log.debug('receive_proxied_message - Not implemented', |
| 228 | proxy_address=proxy_address, |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 229 | msg=msg) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 230 | raise NotImplementedError() |
| 231 | |
| 232 | def receive_packet_out(self, logical_device_id, egress_port_no, msg): |
| 233 | log.debug('packet-out', logical_device_id=logical_device_id, |
| 234 | egress_port_no=egress_port_no, msg_len=len(msg)) |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 235 | |
Shad Ansari | 42db734 | 2018-04-25 21:39:46 +0000 | [diff] [blame] | 236 | def ldi_to_di(ldi): |
| 237 | di = self.logical_device_id_to_root_device_id.get(ldi) |
| 238 | if di is None: |
| 239 | logical_device = self.adapter_agent.get_logical_device(ldi) |
| 240 | di = logical_device.root_device_id |
| 241 | self.logical_device_id_to_root_device_id[ldi] = di |
| 242 | return di |
| 243 | |
| 244 | device_id = ldi_to_di(logical_device_id) |
| 245 | handler = self.devices[device_id] |
| 246 | handler.packet_out(egress_port_no, msg) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 247 | |
| 248 | def receive_inter_adapter_message(self, msg): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 249 | log.info('rx_inter_adapter_msg - Not implemented') |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 250 | raise NotImplementedError() |
| 251 | |
| 252 | def suppress_alarm(self, filter): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 253 | log.info('suppress_alarm - Not implemented yet', filter=filter) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 254 | raise NotImplementedError() |
| 255 | |
| 256 | def unsuppress_alarm(self, filter): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 257 | log.info('unsuppress_alarm - Not implemented yet', filter=filter) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 258 | raise NotImplementedError() |
| 259 | |
| 260 | # PON Mgnt APIs # |
| 261 | def create_interface(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 262 | log.debug('create-interface - Not implemented - We do not use this', |
| 263 | data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 264 | raise NotImplementedError() |
| 265 | |
| 266 | def update_interface(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 267 | log.debug('update-interface - Not implemented - We do not use this', |
| 268 | data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 269 | raise NotImplementedError() |
| 270 | |
| 271 | def remove_interface(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 272 | log.debug('remove-interface - Not implemented - We do not use this', |
| 273 | data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 274 | raise NotImplementedError() |
| 275 | |
| 276 | def receive_onu_detect_state(self, proxy_address, state): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 277 | log.debug('receive-onu-detect-state - Not implemented - We do not ' |
| 278 | 'use this', proxy_address=proxy_address, |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 279 | state=state) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 280 | raise NotImplementedError() |
| 281 | |
| 282 | def create_tcont(self, device, tcont_data, traffic_descriptor_data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 283 | log.info('create-tcont - Not implemented - We do not use this', |
| 284 | tcont_data=tcont_data, |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 285 | traffic_descriptor_data=traffic_descriptor_data) |
| 286 | raise NotImplementedError() |
| 287 | |
| 288 | def update_tcont(self, device, tcont_data, traffic_descriptor_data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 289 | log.info('update-tcont - Not implemented - We do not use this', |
| 290 | tcont_data=tcont_data, |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 291 | traffic_descriptor_data=traffic_descriptor_data) |
| 292 | raise NotImplementedError() |
| 293 | |
| 294 | def remove_tcont(self, device, tcont_data, traffic_descriptor_data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 295 | log.info('remove-tcont - Not implemented - We do not use this', |
| 296 | tcont_data=tcont_data, |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 297 | traffic_descriptor_data=traffic_descriptor_data) |
| 298 | raise NotImplementedError() |
| 299 | |
| 300 | def create_gemport(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 301 | log.info('create-gemport - Not implemented - We do not use this', |
| 302 | data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 303 | raise NotImplementedError() |
| 304 | |
| 305 | def update_gemport(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 306 | log.info('update-gemport - Not implemented - We do not use this', |
| 307 | data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 308 | raise NotImplementedError() |
| 309 | |
| 310 | def remove_gemport(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 311 | log.info('remove-gemport - Not implemented - We do not use this', |
| 312 | data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 313 | raise NotImplementedError() |
| 314 | |
| 315 | def create_multicast_gemport(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 316 | log.info('create-mcast-gemport - Not implemented - We do not use ' |
| 317 | 'this', data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 318 | raise NotImplementedError() |
| 319 | |
| 320 | def update_multicast_gemport(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 321 | log.info('update-mcast-gemport - Not implemented - We do not use ' |
| 322 | 'this', data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 323 | raise NotImplementedError() |
| 324 | |
| 325 | def remove_multicast_gemport(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 326 | log.info('remove-mcast-gemport - Not implemented - We do not use ' |
| 327 | 'this', data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 328 | raise NotImplementedError() |
| 329 | |
| 330 | def create_multicast_distribution_set(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 331 | log.info('create-mcast-distribution-set - Not implemented - We do ' |
| 332 | 'not use this', data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 333 | raise NotImplementedError() |
| 334 | |
| 335 | def update_multicast_distribution_set(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 336 | log.info('update-mcast-distribution-set - Not implemented - We do ' |
| 337 | 'not use this', data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 338 | raise NotImplementedError() |
| 339 | |
| 340 | def remove_multicast_distribution_set(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 341 | log.info('remove-mcast-distribution-set - Not implemented - We do ' |
| 342 | 'not use this', data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 343 | raise NotImplementedError() |
Jonathan Davis | b45bb37 | 2018-07-19 15:05:15 -0400 | [diff] [blame] | 344 | |
Jonathan Davis | b45bb37 | 2018-07-19 15:05:15 -0400 | [diff] [blame] | 345 | def delete_child_device(self, parent_device_id, child_device): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 346 | log.info('delete-child_device', parent_device_id=parent_device_id, |
| 347 | child_device=child_device) |
Jonathan Davis | b45bb37 | 2018-07-19 15:05:15 -0400 | [diff] [blame] | 348 | handler = self.devices[parent_device_id] |
Nicolas Palpacuer | 131790b | 2018-08-20 09:59:34 -0400 | [diff] [blame] | 349 | if handler is not None: |
| 350 | handler.delete_child_device(child_device) |
| 351 | else: |
| 352 | log.error('Could not find matching handler', |
| 353 | looking_for_device_id =parent_device_id, |
| 354 | available_handlers=self.devices.keys()) |
Nicolas Palpacuer | 30027f4 | 2018-09-06 15:55:54 -0400 | [diff] [blame^] | 355 | |
| 356 | # This is currently not part of the Iadapter interface |
| 357 | def collect_stats(self, device_id): |
| 358 | log.info('collect_stats', device_id=device_id) |
| 359 | handler= self.devices[device_id] |
| 360 | if handler is not None: |
| 361 | handler.trigger_statistics_collection() |
| 362 | else: |
| 363 | log.error('Could not find matching handler', |
| 364 | looking_for_device_id=device_id, |
| 365 | available_handlers=self.devices.keys()) |