本文整理汇总了Python中f5_openstack_agent.lbaasv2.drivers.bigip.network_helper.NetworkHelper.delete_all_fdb_entries方法的典型用法代码示例。如果您正苦于以下问题:Python NetworkHelper.delete_all_fdb_entries方法的具体用法?Python NetworkHelper.delete_all_fdb_entries怎么用?Python NetworkHelper.delete_all_fdb_entries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类f5_openstack_agent.lbaasv2.drivers.bigip.network_helper.NetworkHelper
的用法示例。
在下文中一共展示了NetworkHelper.delete_all_fdb_entries方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: purge_folder_contents
# 需要导入模块: from f5_openstack_agent.lbaasv2.drivers.bigip.network_helper import NetworkHelper [as 别名]
# 或者: from f5_openstack_agent.lbaasv2.drivers.bigip.network_helper.NetworkHelper import delete_all_fdb_entries [as 别名]
def purge_folder_contents(self, bigip, folder):
network_helper = NetworkHelper()
if folder not in self.exempt_folders:
# First remove all LTM resources.
ltm_types = [
ResourceType.virtual,
ResourceType.virtual_address,
ResourceType.pool,
ResourceType.http_monitor,
ResourceType.https_monitor,
ResourceType.tcp_monitor,
ResourceType.ping_monitor,
ResourceType.node,
ResourceType.snat,
ResourceType.snatpool,
ResourceType.snat_translation,
ResourceType.universal_persistence,
ResourceType.rule,
ResourceType.l7policy
]
for ltm_type in ltm_types:
resource = BigIPResourceHelper(ltm_type)
[r.delete() for r in resource.get_resources(bigip, folder)]
# Remove all net resources
net_types = [
ResourceType.arp,
ResourceType.selfip,
ResourceType.vlan,
ResourceType.route_domain
]
for net_type in net_types:
resource = BigIPResourceHelper(net_type)
[r.delete() for r in resource.get_resources(bigip, folder)]
# Tunnels and fdb's require some special attention.
resource = BigIPResourceHelper(ResourceType.tunnel)
tunnels = resource.get_resources(bigip, folder)
for tunnel in tunnels:
network_helper.delete_all_fdb_entries(
bigip, tunnel.name, folder)
network_helper.delete_tunnel(
bigip, tunnel.name, folder)
示例2: L2ServiceBuilder
# 需要导入模块: from f5_openstack_agent.lbaasv2.drivers.bigip.network_helper import NetworkHelper [as 别名]
# 或者: from f5_openstack_agent.lbaasv2.drivers.bigip.network_helper.NetworkHelper import delete_all_fdb_entries [as 别名]
#.........这里部分代码省略.........
elif net_key in self.interface_mapping:
interface = self.interface_mapping[net_key]
tagged = self.tagging_mapping[net_key]
if tagged:
vlanid = network['provider:segmentation_id']
else:
vlanid = 0
self.vlan_binding.prune_vlan(
device_name=bigip.device_name,
interface=interface,
vlanid=vlanid
)
self._delete_vcmp_device_network(bigip, vlan_name)
def _delete_device_flat(self, bigip, network, network_folder):
# Delete untagged vlan on specific bigip
vlan_name = self.get_vlan_name(network,
bigip.hostname)
self.network_helper.delete_vlan(
bigip,
vlan_name,
partition=network_folder
)
self._delete_vcmp_device_network(bigip, vlan_name)
def _delete_device_vxlan(self, bigip, network, network_folder):
# Delete vxlan tunnel on specific bigip
tunnel_name = _get_tunnel_name(network)
self.network_helper.delete_all_fdb_entries(
bigip,
tunnel_name,
partition=network_folder)
self.network_helper.delete_tunnel(
bigip,
tunnel_name,
partition=network_folder)
if self.fdb_connector:
self.fdb_connector.notify_vtep_removed(network, bigip.local_ip)
def _delete_device_gre(self, bigip, network, network_folder):
# Delete gre tunnel on specific bigip
tunnel_name = _get_tunnel_name(network)
self.network_helper.delete_all_fdb_entries(
bigip,
tunnel_name,
partition=network_folder)
self.network_helper.delete_tunnel(
bigip,
tunnel_name,
partition=network_folder)
if self.fdb_connector:
self.fdb_connector.notify_vtep_removed(network, bigip.local_ip)
def _delete_vcmp_device_network(self, bigip, vlan_name):
# For vCMP Guests, disassociate VLAN from vCMP Guest and
# delete VLAN from vCMP Host.
示例3: L2ServiceBuilder
# 需要导入模块: from f5_openstack_agent.lbaasv2.drivers.bigip.network_helper import NetworkHelper [as 别名]
# 或者: from f5_openstack_agent.lbaasv2.drivers.bigip.network_helper.NetworkHelper import delete_all_fdb_entries [as 别名]
#.........这里部分代码省略.........
else:
vlanid = 0
self.vlan_binding.prune_vlan(
device_name=bigip.device_name,
interface=interface,
vlanid=vlanid
)
self._delete_vcmp_device_network(bigip, vlan_name)
def _delete_device_flat(self, bigip, network, network_folder):
# Delete untagged vlan on specific bigip
vlan_name = self.get_vlan_name(network,
bigip.hostname)
try:
self.network_helper.delete_vlan(
bigip,
vlan_name,
partition=network_folder
)
except Exception as err:
LOG.exception(err)
LOG.error(
"Failed to delete vlan: %s" % vlan_name)
self._delete_vcmp_device_network(bigip, vlan_name)
def _delete_device_vxlan(self, bigip, network, network_folder):
# Delete vxlan tunnel on specific bigip
tunnel_name = _get_tunnel_name(network)
try:
self.network_helper.delete_all_fdb_entries(
bigip,
tunnel_name,
partition=network_folder)
self.network_helper.delete_tunnel(
bigip,
tunnel_name,
partition=network_folder)
except Exception as err:
# Just log the exception, we want to continue cleanup
LOG.exception(err)
LOG.error(
"Failed to delete vxlan tunnel: %s" % tunnel_name)
if self.fdb_connector:
self.fdb_connector.notify_vtep_removed(network, bigip.local_ip)
def _delete_device_gre(self, bigip, network, network_folder):
# Delete gre tunnel on specific bigip
tunnel_name = _get_tunnel_name(network)
try:
self.network_helper.delete_all_fdb_entries(
bigip,
tunnel_name,
partition=network_folder)
self.network_helper.delete_tunnel(
bigip,
tunnel_name,
partition=network_folder)