autonet_cumulus.tasks.vxlan

Module Contents

Functions

parse_vxlan_data(evpn_vni_data: dict, bgp_vni_data: dict, vlan_data: dict) → dict

Cumulus does not have a single source of information for vxlan

get_vxlans(vxlan_data: dict, vnid: Optional[Union[str, int]]) → [autonet.core.objects.vxlan.VXLAN]

Returns a list of configured VXLAN tunnels on the device.

generate_vxlan_rt_commands(vxlan: autonet.core.objects.vxlan.VXLAN, bgp_asn: Union[str, int]) → [str]

Generate a list of RT configuration commands for EVPN import and

generate_create_l2_vxlan_commands(vxlan: autonet.core.objects.vxlan.VXLAN, bgp_data: dict, ip_forward: bool = False) → [str]

Generate the commands required to set up an L2 VXLAN binding.

generate_create_l3_vxlan_commands(vxlan: autonet.core.objects.vxlan.VXLAN, bgp_data: dict, dynamic_vlan: Optional[int] = None) → [str]

Generate the commands required to set up an L3 VXLAN binding.

generate_create_vxlan_commands(vxlan: autonet.core.objects.vxlan.VXLAN, auto_source: str, bgp_data: dict, dynamic_vlan: Optional[int] = None, ip_forward: bool = False) → [str]

Generate a list of commands required to create a VXLAN.

generate_delete_l2_vxlan_commands(vxlan_datum: dict) → [str]

Generate a list of commands required to tear down an L2 VXLAN

generate_delete_l3_vxlan_commands(vxlan_datum: dict) → [str]

Generate a list of commands required to tear down an L3 VXLAN

generate_delete_vxlan_commands(vxlan_id: Union[str, int], vxlan_data: dict)

Return a list of commands required to tear down a VXLAN tunnel.

autonet_cumulus.tasks.vxlan.parse_vxlan_data(evpn_vni_data: dict, bgp_vni_data: dict, vlan_data: dict) dict

Cumulus does not have a single source of information for vxlan configuration as modeled by Autonet. Instead, the information must be parsed from several command outputs. This function performs that parsing and emits a dictionary of objects indexed by VNI that contains a VXLAN dataclass as well as additional metadata that can be used for driver operations.

Parameters:
  • evpn_vni_data – Output from the show evpn vni command.

  • bgp_vni_data – Output from the show bgp evpn vni command.

  • vlan_data – Output from the show bridge vlan command.

Returns:

autonet_cumulus.tasks.vxlan.get_vxlans(vxlan_data: dict, vnid: Optional[Union[str, int]]) [autonet.core.objects.vxlan.VXLAN]

Returns a list of configured VXLAN tunnels on the device.

Parameters:
  • vxlan_data – Dictionary returned by parse_vxlan_data().

  • vnid – Filter for the given VNID.

Returns:

autonet_cumulus.tasks.vxlan.generate_vxlan_rt_commands(vxlan: autonet.core.objects.vxlan.VXLAN, bgp_asn: Union[str, int]) [str]

Generate a list of RT configuration commands for EVPN import and export.

Parameters:
  • vxlan – A VXLAN object.

  • bgp_asn – The BGP ASN to use when generating auto targets.

Returns:

autonet_cumulus.tasks.vxlan.generate_create_l2_vxlan_commands(vxlan: autonet.core.objects.vxlan.VXLAN, bgp_data: dict, ip_forward: bool = False) [str]

Generate the commands required to set up an L2 VXLAN binding.

Parameters:
  • vxlan – A VXLAN object.

  • bgp_data – BGP data dictionary containing ASN and router ID.

  • ip_forward – If False then disable ip_forwarding on an SVI for a bound vlan.

Returns:

autonet_cumulus.tasks.vxlan.generate_create_l3_vxlan_commands(vxlan: autonet.core.objects.vxlan.VXLAN, bgp_data: dict, dynamic_vlan: Optional[int] = None) [str]

Generate the commands required to set up an L3 VXLAN binding.

Parameters:
  • vxlan – A VXLAN object.

  • bgp_data – BGP data dictionary containing ASN and router ID.

  • dynamic_vlan – A dynamically assigned VLAN to be used when binding an L3 VNI.

Returns:

autonet_cumulus.tasks.vxlan.generate_create_vxlan_commands(vxlan: autonet.core.objects.vxlan.VXLAN, auto_source: str, bgp_data: dict, dynamic_vlan: Optional[int] = None, ip_forward: bool = False) [str]

Generate a list of commands required to create a VXLAN.

Parameters:
  • vxlan – A VXLAN object.

  • auto_source – The IP address to use when source is set to “auto”.

  • bgp_data – BGP data dictionary containing ASN and router ID.

  • dynamic_vlan – A dynamically assigned VLAN to be used when binding an L3 VNI.

  • ip_forward – If False then disable ip_forwarding on an SVI for a bound vlan.

Returns:

autonet_cumulus.tasks.vxlan.generate_delete_l2_vxlan_commands(vxlan_datum: dict) [str]

Generate a list of commands required to tear down an L2 VXLAN tunnel.

Parameters:

vxlan_datum – The individual vxlan_data object from parse_vxlan_data() that represents the VXLAN tunnel.

Returns:

autonet_cumulus.tasks.vxlan.generate_delete_l3_vxlan_commands(vxlan_datum: dict) [str]

Generate a list of commands required to tear down an L3 VXLAN tunnel.

Parameters:

vxlan_datum – The individual vxlan_data object from parse_vxlan_data() that represents the VXLAN tunnel.

Returns:

autonet_cumulus.tasks.vxlan.generate_delete_vxlan_commands(vxlan_id: Union[str, int], vxlan_data: dict)

Return a list of commands required to tear down a VXLAN tunnel.

Parameters:
  • vxlan_id – The VNI of the target VXLAN tunnel.

  • vxlan_data – The output parse_vxlan_data().

Returns: