pyaoscx.lag module

pyaoscx.lag.create_l2_lag_interface(name, phys_ports, lacp_mode='passive', mc_lag=False, fallback_enabled=False, vlan_ids_list=[], desc=None, admin_state='up', **kwargs)

Perform a POST call to create a Port table entry for L2 LAG interface.

Parameters:
  • name – Alphanumeric name of LAG Port
  • phys_ports – List of physical ports to aggregate (e.g. [“1/1/1”, “1/1/2”, “1/1/3”])
  • lacp_mode – Should be either “passive” or “active.” Defaults to “passive” if not specified.
  • mc_lag – Boolean to determine if the LAG is multi-chassis. Defaults to False if not specified.
  • fallback_enabled – Boolean to determine if the LAG uses LACP fallback. Defaults to False if not specified.
  • vlan_ids_list – Optional list of integer VLAN IDs to add as trunk VLANS. Defaults to empty list if not specified.
  • desc – Optional description for the interface. Defaults to nothing if not specified.
  • admin_state – Optional administratively-configured state of the port. Defaults to “up” if not specified
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.lag.create_l3_lag_interface(name, phys_ports, ipv4, lacp_mode='passive', mc_lag=False, fallback_enabled=False, desc=None, admin_state='up', vrf='default', **kwargs)

Perform a POST call to create a Port table entry for L3 LAG interface.

Parameters:
  • name – Alphanumeric Port name
  • phys_ports – List of physical ports to aggregate (e.g. [“1/1/1”, “1/1/2”, “1/1/3”])
  • ipv4 – IPv4 address to assign to the interface. Defaults to nothing if not specified.
  • lacp_mode – Should be either “passive” or “active.” Defaults to “passive” if not specified.
  • mc_lag – Boolean to determine if the LAG is multi-chassis. Defaults to False if not specified.
  • fallback_enabled – Boolean to determine if the LAG uses LACP fallback. Defaults to False if not specified.
  • desc – Optional description for the interface. Defaults to nothing if not specified.
  • admin_state – Optional administratively-configured state of the port. Defaults to “up” if not specified
  • vrf – Name of the VRF to which the Port belongs. Defaults to “default” if not specified.
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.lag.delete_lag_interface(name, phys_ports, **kwargs)

Perform a DELETE call to delete a LAG interface. For v1, also remove the LAG ID from the port’s Interface, and create the associated Port table entry.

Parameters:
  • name – Alphanumeric name of LAG interface
  • phys_ports – List of physical ports to aggregate (e.g. [“1/1/1”, “1/1/2”, “1/1/3”])
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise