VlanPortAssociation

Bases: BaseEndpoint

Endpoint for managing VLAN-port associations via the AOS CLI API.

create(port_id, vlan_id, mode='untagged')

Add a port to a VLAN with the specified tagging mode.

Parameters:
  • port_id (str) –

    Port identifier (e.g., “1/1”).

  • vlan_id (str) –

    VLAN ID to associate with the port.

  • mode (str, default: 'untagged' ) –

    Tagging mode for the port (“untagged” or “tagged”). Defaults to “untagged”.

Returns:
  • ApiResult( ApiResult ) –

    API response, including updated VLAN membership if successful.

delete(port_id, vlan_id, mode='untagged')

Remove a port from a VLAN.

Parameters:
  • port_id (str) –

    Port identifier.

  • vlan_id (str) –

    VLAN ID to disassociate from the port.

  • mode (str, default: 'untagged' ) –

    (Unused) tagging mode hint for clarity. Defaults to “untagged”.

Returns:
  • ApiResult( ApiResult ) –

    API response, including updated VLAN membership if successful.

edit(port_id, vlan_id, mode='untagged')

Modify a port’s tagging mode in a VLAN.

Parameters:
  • port_id (str) –

    Port identifier.

  • vlan_id (str) –

    VLAN ID.

  • mode (str, default: 'untagged' ) –

    New tagging mode (“untagged” or “tagged”). Defaults to “untagged”.

Returns:
  • ApiResult( ApiResult ) –

    API response, including updated VLAN membership if successful.

list(vlan_id)

List all ports associated with a given VLAN.

Parameters:
  • vlan_id (str) –

    The VLAN ID whose member ports are to be listed.

Returns:
  • ApiResult( ApiResult ) –

    API response with parsed list of port members in the VLAN.