autonet_cumulus.tasks.vlan

Module Contents

Functions

get_vlans(vlan_data: dict, bridge: str, dynamic_vlans: [int], vlan_id: Union[str, int] = None, show_dynamic: bool = False) → [autonet.core.objects.vlan.VLAN]

Returns a list of VLAN objects. VLAN IDs

generate_create_vlan_commands(vlan: autonet.core.objects.vlan.VLAN, bridge: str) → [str]

Generate a list of commands to create a vlan on the bridge. If the

generate_delete_vlan_commands(vlan_id: Union[str, int], bridge: str) → [str]

Generate a list of commands to delete a vlan from the bridge. If

autonet_cumulus.tasks.vlan.get_vlans(vlan_data: dict, bridge: str, dynamic_vlans: [int], vlan_id: Union[str, int] = None, show_dynamic: bool = False) [autonet.core.objects.vlan.VLAN]

Returns a list of VLAN objects. VLAN IDs that fall in the range of reserved VLANs will be omitted by default.

Parameters:
  • vlan_data – Output from the show bridge vlan command.

  • bridge – The primary bridge name.

  • dynamic_vlans – A list of VLAN IDs reserved for dynamic allocation.

  • vlan_id – Filter results for the given VLAN ID.

  • show_dynamic – Include dynamic VLANs in the response.

Returns:

autonet_cumulus.tasks.vlan.generate_create_vlan_commands(vlan: autonet.core.objects.vlan.VLAN, bridge: str) [str]

Generate a list of commands to create a vlan on the bridge. If the VLAN exists in the defined dynamic range, nothing will be returned.

Parameters:
  • vlan – A VLAN object.

  • bridge – The primary bridge name.

Returns:

autonet_cumulus.tasks.vlan.generate_delete_vlan_commands(vlan_id: Union[str, int], bridge: str) [str]

Generate a list of commands to delete a vlan from the bridge. If the VLAN exists in the defined dynamic range, nothing will be returned.

Parameters:
  • vlan_id – The VLAN ID to delete.

  • bridge – The primary bridge name.

Returns: