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 via MIB POST API.

Parameters:
  • port_id (str) –

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

  • vlan_id (str) –

    VLAN ID to associate with the port.

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

    “untagged” or “tagged”. Defaults to “untagged”.

Returns:
  • ApiResult( ApiResult ) –

    Retrieve all port associations for a given VLAN using a GET request.

delete(port_id, vlan_id)

Remove a port from a VLAN.

Parameters:
  • port_id (str) –

    Port identifier.

  • vlan_id (str) –

    VLAN ID to disassociate from the port.

Returns:
  • ApiResult( ApiResult ) –

    Retrieve all port associations for a given VLAN using a GET request.

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 ) –

    Retrieve all port associations for a given VLAN using a GET request.

list_by_vlan(vlan_id)

Retrieve all port associations for a given VLAN using a GET request.

Parameters:
  • vlan_id (int) –

    VLAN ID to filter the VPA table.

Returns:
  • ApiResult

    Parsed data from the VPA table for the specified VLAN.