+ 'cpInstanceId': port.portid # TODO: port.cpinstanceid is not initiated when create port resource.
+ })
+ for network_id, ext_link_ports in ext_connectivity_map.items():
+ networks = NetworkInstModel.objects.filter(networkid=network_id)
+ net_name = networks[0].name if networks else network_id
+ network_resource = {
+ 'vimConnectionId': ext_link_ports[0]['resourceHandle']['vimConnectionId'],
+ 'resourceId': network_id,
+ 'resourceProviderId': net_name, # TODO: is resourceName mapped to resourceProviderId?
+ 'vimLevelResourceType': 'network'
+ }
+ ext_connectivity.append({
+ 'id': network_id,
+ 'resourceHandle': network_resource,
+ 'extLinkPorts': ext_link_ports
+ })
+ logger.debug("ext_connectivity=%s", ext_connectivity)