當前位置: 首頁>>代碼示例>>Python>>正文


Python NetworkHelper.delete_fdb_entry方法代碼示例

本文整理匯總了Python中f5_openstack_agent.lbaasv2.drivers.bigip.network_helper.NetworkHelper.delete_fdb_entry方法的典型用法代碼示例。如果您正苦於以下問題:Python NetworkHelper.delete_fdb_entry方法的具體用法?Python NetworkHelper.delete_fdb_entry怎麽用?Python NetworkHelper.delete_fdb_entry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在f5_openstack_agent.lbaasv2.drivers.bigip.network_helper.NetworkHelper的用法示例。


在下文中一共展示了NetworkHelper.delete_fdb_entry方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: 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_fdb_entry [as 別名]

#.........這裏部分代碼省略.........
            # REVISIT caller must provide folder and not tenant_id
            self.network_helper.add_fdb_entry(
                bigip,
                tunnel_name=tunnel_name,
                partition=net_folder,
                mac_address=mac_addr,
                vtep_ip_address=vtep,
                arp_ip_address=ip_address)

    def delete_bigip_fdbs(self, bigip, net_folder, fdb_info, vteps_by_type):
        # Delete fdb records for a mac/ip with specified vteps
        network = fdb_info['network']
        net_type = network['provider:network_type']
        vteps_key = net_type + '_vteps'
        if vteps_key in vteps_by_type:
            vteps = vteps_by_type[vteps_key]
            if net_type == 'gre':
                self.delete_gre_fdbs(bigip, net_folder, fdb_info, vteps)
            elif net_type == 'vxlan':
                self.delete_vxlan_fdbs(bigip, net_folder, fdb_info, vteps)

    def delete_gre_fdbs(self, bigip, net_folder, fdb_info, vteps):
        # delete gre fdb records
        network = fdb_info['network']
        ip_address = fdb_info['ip_address']
        mac_address = fdb_info['mac_address']
        tunnel_name = _get_tunnel_name(network)
        for vtep in vteps:
            if mac_address:
                mac_addr = mac_address
            else:
                mac_addr = _get_tunnel_fake_mac(network, vtep)

            self.network_helper.delete_fdb_entry(
                bigip,
                tunnel_name=tunnel_name,
                mac_address=mac_addr,
                arp_ip_address=ip_address,
                partition=net_folder)

    def delete_vxlan_fdbs(self, bigip, net_folder, fdb_info, vteps):
        # delete vxlan fdb records
        network = fdb_info['network']
        ip_address = fdb_info['ip_address']
        mac_address = fdb_info['mac_address']
        tunnel_name = _get_tunnel_name(network)
        for vtep in vteps:
            if mac_address:
                mac_addr = mac_address
            else:
                mac_addr = _get_tunnel_fake_mac(network, vtep)
            self.network_helper.delete_fdb_entry(
                bigip,
                tunnel_name=tunnel_name,
                mac_address=mac_addr,
                arp_ip_address=ip_address,
                partition=net_folder)

    def add_bigip_fdb(self, bigip, fdb):
        # Add entries from the fdb relevant to the bigip
        for fdb_operation in \
            [{'network_type': 'vxlan',
              'get_tunnel_folder': self.network_helper.get_tunnel_folder,
              'fdb_method': self.network_helper.add_fdb_entries},

             {'network_type': 'gre',
開發者ID:jlongstaf,項目名稱:f5-openstack-agent,代碼行數:70,代碼來源:l2_service.py

示例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_fdb_entry [as 別名]

#.........這裏部分代碼省略.........

            self.network_helper.add_fdb_entry(
                bigip,
                tunnel_name=tunnel_name,
                partition=net_folder,
                mac_address=mac_addr,
                vtep_ip_address=vtep,
                arp_ip_address=ip_address)

    def delete_bigip_fdbs(self, bigip, net_folder, fdb_info, vteps_by_type):
        # Delete fdb records for a mac/ip with specified vteps
        network = fdb_info['network']
        net_type = network['provider:network_type']
        vteps_key = net_type + '_vteps'
        if vteps_key in vteps_by_type:
            vteps = vteps_by_type[vteps_key]
            if net_type == 'gre':
                self.delete_gre_fdbs(bigip, net_folder, fdb_info, vteps)
            elif net_type == 'vxlan':
                self.delete_vxlan_fdbs(bigip, net_folder, fdb_info, vteps)

    def delete_gre_fdbs(self, bigip, net_folder, fdb_info, vteps):
        # delete gre fdb records
        network = fdb_info['network']
        ip_address = fdb_info['ip_address']
        mac_address = fdb_info['mac_address']
        tunnel_name = _get_tunnel_name(network)
        for vtep in vteps:
            if mac_address:
                mac_addr = mac_address
            else:
                mac_addr = _get_tunnel_fake_mac(network, vtep)

            self.network_helper.delete_fdb_entry(
                bigip,
                tunnel_name=tunnel_name,
                mac_address=mac_addr,
                arp_ip_address=ip_address,
                partition=net_folder)

    def delete_vxlan_fdbs(self, bigip, net_folder, fdb_info, vteps):
        # delete vxlan fdb records
        network = fdb_info['network']
        ip_address = fdb_info['ip_address']
        mac_address = fdb_info['mac_address']
        tunnel_name = _get_tunnel_name(network)
        for vtep in vteps:
            if mac_address:
                mac_addr = mac_address
            else:
                mac_addr = _get_tunnel_fake_mac(network, vtep)
            self.network_helper.delete_fdb_entry(
                bigip,
                tunnel_name=tunnel_name,
                mac_address=mac_addr,
                arp_ip_address=ip_address,
                partition=net_folder)

    def add_bigip_fdb(self, bigip, fdb):
        # Add entries from the fdb relevant to the bigip
        for fdb_operation in \
            [{'network_type': 'vxlan',
              'get_tunnel_folder': self.network_helper.get_tunnel_folder,
              'fdb_method': self.network_helper.add_fdb_entries},

             {'network_type': 'gre',
開發者ID:F5Networks,項目名稱:f5-openstack-agent,代碼行數:70,代碼來源:l2_service.py


注:本文中的f5_openstack_agent.lbaasv2.drivers.bigip.network_helper.NetworkHelper.delete_fdb_entry方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。