InterfaceEndpoint

Bases: BaseEndpoint

Provides interface-related configuration and status management endpoints for Alcatel-Lucent OmniSwitch using AOS CLI commands via API client.

admin_disable(port)

Disable administrative state of the interface.

Parameters:
  • port (str) –

    Port or range string.

Returns:
  • ApiResult

    ApiResult with updated interface status.

admin_enable(port)

Enable administrative state of the interface.

Parameters:
  • port (str) –

    Port or range string.

Returns:
  • ApiResult

    ApiResult with updated interface status.

autoneg_disable(port)

Disable auto-negotiation on the interface.

Parameters:
  • port (str) –

    Port or range string.

Returns:
  • ApiResult

    ApiResult with updated interface status.

autoneg_enable(port)

Enable auto-negotiation on the interface.

Parameters:
  • port (str) –

    Port or range string.

Returns:
  • ApiResult

    ApiResult with updated interface status.

clear_statistics(target, stat_type, cli_only=False)

Clear interface statistics counters (Layer 2 or TDR).

Parameters:
  • target (str) –

    Slot (e.g., “1/3”) or port/port-range (e.g., “1/3/1” or “1/3/1-4”).

  • stat_type (str) –

    “l2-statistics” or “tdr-statistics”.

  • cli_only (bool, default: False ) –

    Whether to include “cli” for l2-statistics.

Returns:
  • ApiResult

    ApiResult of the CLI command.

Raises:
  • ValueError

    If input is invalid.

clear_violation(target, is_linkagg=False)

Clears all the MAC address violation logs for a specified port or link aggregate.

Parameters:
  • target (str) –

    Port in the format ‘chassis/slot/port[-port2]’ or linkagg ID/range like ‘1-2’.

  • is_linkagg (bool, default: False ) –

    If True, clears violation for a linkagg; otherwise, clears for port(s).

Returns:
  • ApiResult

    ApiResult from the CLI API.

epp_disable(port)

Disable EPP on the interface.

Parameters:
  • port (str) –

    Port or range string.

Returns:
  • ApiResult

    ApiResult with updated interface status.

epp_enable(port)

Enable EPP on the interface.

Parameters:
  • port (str) –

    Port or range string.

Returns:
  • ApiResult

    ApiResult with updated interface status.

get_interface(port)

Retrieve detailed status of a specific port.

Parameters:
  • port (str) –

    Port identifier string, e.g., “1/1/1”.

Returns:
  • Optional[dict]

    A dictionary of parsed interface details or None if the request fails.

list()

Retrieve the status of all interfaces.

Returns:
  • ApiResult

    An ApiResult with parsed interface status list if available.

set_alias(port, alias)

Set or clear the alias (description) for a single port.

Parameters:
  • port (str) –

    A single port string (e.g., “1/1/1”).

  • alias (str) –

    Alias string (e.g., “Uplink to Core”) or empty “” to clear.

Returns:
  • ApiResult

    An ApiResult with the updated interface detail.

Raises:
  • ValueError

    If a port range is given (not supported by this command).

set_ddm_status(state)

Configures the Digital Diagnostics Monitoring (DDM) administrative status.

Parameters:
  • state (Literal['enable', 'disable']) –

    “enable” to turn on DDM monitoring; “disable” to turn it off.

Returns:
  • ApiResult

    ApiResult from the CLI API.

Raises:
  • ValueError

    If an invalid state is provided.

set_duplex(target, mode)

Set duplex mode for a port, port range, or slot.

Parameters:
  • target (str) –

    Port (e.g., “1/3/1”), port range (e.g., “1/3/1-4”), or slot (e.g., “1/3”).

  • mode (str) –

    One of “full”, “half”, or “auto”.

Returns:
  • ApiResult

    An ApiResult with updated interface status if applicable.

Raises:
  • ValueError

    If duplex mode is invalid.

set_eee(target, state)

Enables or disables Energy Efficient Ethernet (EEE) on the specified port(s) or slot.

Parameters:
  • target (str) –

    The interface scope. Accepts: - “slot x/y” - “port x/y/z” - “port x/y/z-a” (range of ports)

  • state (Literal['enable', 'disable']) –

    “enable” to turn on EEE, “disable” to turn it off.

Returns:
  • ApiResult

    ApiResult from the CLI API.

Raises:
  • ValueError

    If state is not “enable” or “disable”.

set_flood_limit(target, traffic_type, rate_mode, rate_value, low_threshold=None)

Configure flood limit settings for broadcast, multicast, unknown unicast, or all traffic types.

Parameters:
  • target (str) –

    Slot (e.g., “1/3”) or port/port-range (e.g., “1/3/1”, “1/3/1-4”).

  • traffic_type (str) –

    One of: “bcast”, “mcast”, “uucast”, “all”.

  • rate_mode (str) –

    One of: “pps”, “mbps”, “cap%”, “enable”, “disable”, “default”.

  • rate_value (Union[int, Literal['enable', 'disable', 'default']]) –

    The value for the selected rate_mode, or “enable”/”disable”/”default”.

  • low_threshold (Optional[int], default: None ) –

    Optional low threshold value (must be lower than rate_value, when applicable).

Returns:
  • ApiResult

    ApiResult from the CLI API.

Raises:
  • ValueError

    If input validation fails.

set_flood_limit_action(target, traffic_type, action)

Configure the action taken when flood rate limits are violated for a given traffic type.

Parameters:
  • target (str) –

    Slot (e.g., “1/3”) or port/port-range (e.g., “1/3/1”, “1/3/1-4”).

  • traffic_type (Literal['bcast', 'mcast', 'uucast', 'all']) –

    One of: “bcast”, “mcast”, “uucast”, “all”.

  • action (Literal['shutdown', 'trap', 'default']) –

    One of: “shutdown”, “trap”, “default”.

Returns:
  • ApiResult

    ApiResult from the CLI API.

Raises:
  • ValueError

    If any argument is invalid.

set_hybrid_mode(target, mode)

Configures the mode of a combo port to either fiber or copper.

Parameters:
  • target (str) –

    The interface scope. Accepts: - “slot x/y” - “port x/y/z” - “port x/y/z-a” (range of ports)

  • mode (Literal['fiber', 'copper']) –

    “fiber” or “copper”

Returns:
  • ApiResult

    ApiResult from the CLI API.

Raises:
  • ValueError

    If mode is not “fiber” or “copper”.

set_ingress_bandwidth(target, action)

Configures ingress bandwidth settings on the specified slot or port(s).

Parameters:
  • target (str) –

    Target slot (e.g., “1/3”) or port/port-range (e.g., “1/3/1”, “1/3/1-4”).

  • action (Union[Literal['enable', 'disable'], int]) –

    “enable”, “disable”, or an integer Mbps value.

Returns:
  • ApiResult

    ApiResult from the CLI API.

Raises:
  • ValueError

    If invalid action value.

set_interface(port, parameter, value)

Set an interface parameter and return updated status for all affected ports.

Parameters:
  • port (str) –

    Port or range string, e.g., “1/1/1” or “1/1/1-3”.

  • parameter (str) –

    One of “admin-state”, “autoneg”, or “epp”.

  • value (str) –

    “enable” or “disable”.

Returns:
  • ApiResult

    An ApiResult with a list of updated interface statuses.

Enables or disables link trap messages on the specified interface(s).

Parameters:
  • target (str) –

    Target slot (e.g., “1/3”) or port/port-range (e.g., “1/2/1”, “1/1/1-6”).

  • state (Literal['enable', 'disable']) –

    “enable” to generate trap messages when port changes state, “disable” otherwise.

Returns:
  • ApiResult

    ApiResult from the CLI API.

Raises:
  • ValueError

    If an invalid state is provided.

set_loopback(port, enable=True)

Enables or disables loopback mode for the specified front-panel port.

Parameters:
  • port (str) –

    The front-panel port(s) in the format: - “port x/y/z” - “port x/y/z-a” (range of ports)

  • enable (bool, default: True ) –

    True to enable loopback, False to disable using the ‘no’ form.

Returns:
  • ApiResult

    ApiResult from the CLI API.

set_max_frame_size(target, size)

Configure the maximum frame size on a port or slot.

Parameters:
  • target (str) –

    Target slot (e.g. “1/3”) or port/port-range (e.g. “1/3/1”, “1/3/1-4”).

  • size (int) –

    Frame size in bytes (valid range: 1518 to 9216).

Returns:
  • ApiResult

    ApiResult of the CLI command.

Raises:
  • ValueError

    If the target or size is invalid.

set_portgroup_speed(port_group_number, slot, group_range, speed)

Configures the speed of the ports within a port group.

Parameters:
  • port_group_number (int) –

    The port group number (e.g., 1, 2, 3…).

  • slot (str) –

    The chassis/slot identifier (e.g., “1/1”).

  • group_range (str) –

    The group or group range (e.g., “1”, “2-4”).

  • speed (Literal['auto', '25G', '10G']) –

    The desired speed for the port group (“auto”, “25G”, or “10G”).

Returns:
  • ApiResult

    ApiResult from the CLI API.

set_speed(target, speed)

Set the speed for one or more interfaces.

Parameters:
  • target (str) –

    Port or range string, e.g., “1/1/1” or “1/1/1-3”.

  • speed (str) –

    Allowed values include “10”, “100”, …, “100000”, “auto”, or “max 100”/”max 1000”/etc.

Returns:
  • ApiResult

    An ApiResult with updated interface status per affected port.

Raises:
  • ValueError

    If the speed value is invalid.

set_violation_recovery_maximum(scope, value, target=None)

Configures the maximum number of recovery attempts for MAC address violation recovery.

Parameters:
  • scope (Literal['global', 'slot', 'port']) –

    “global” applies to all ports, “slot” applies to a chassis/slot, “port” applies to a port or range.

  • value (Union[int, Literal['infinite', 'default']]) –

    Integer (0–50), “infinite”, or “default”.

  • target (Optional[str], default: None ) –

    Optional. Required for “slot” or “port”. E.g., ‘1/1’ (slot), ‘1/1/1’, or ‘1/1/1-3’ (ports).

Returns:
  • ApiResult

    ApiResult from the CLI API.

set_wait_to_restore(target, value)

Configures the wait-to-restore timer for the specified slot or port(s). This timer delays the notification of a link-up event.

Parameters:
  • target (str) –

    The target interface scope. Accepts: - “slot x/y” - “port x/y/z” - “port x/y/z-a” (range)

  • value (int) –

    Wait-to-restore timer in seconds (0 disables the timer).

Returns:
  • ApiResult

    ApiResult from the CLI API.

Raises:
  • ValueError

    If value is negative or target is improperly formatted.

set_wait_to_shutdown(target, value)

Configures the wait-to-shutdown timer for the specified slot or port(s). This timer delays the notification of a link-down event.

Parameters:
  • target (str) –

    The target interface scope. Accepts: - “slot x/y” - “port x/y/z” - “port x/y/z-a” (range)

  • value (int) –

    Wait-to-shutdown timer in seconds (0 disables the timer).

Returns:
  • ApiResult

    ApiResult from the CLI API.

Raises:
  • ValueError

    If value is negative or target is improperly formatted.

show_interface_accounting(port)

Retrieve detailed status or accounting of a specific port or port range.

Parameters:
  • port (str) –

    Port identifier string, e.g., “1/1/1”, “1/1/1-1/1/4”, or “1/1”.

  • accounting

    If True, retrieve accounting info instead of detailed status.

Returns:
  • ApiResult

    A dictionary (or list of dicts) of parsed interface data, or None if request fails.

show_interface_capability(port)

Retrieve detailed status or capability of a specific port or port range.

Parameters:
  • port (str) –

    Port identifier string, e.g., “1/1/1”, “1/1/1-1/1/4”, or “1/1”.

  • capability

    If True, retrieve capability info instead of detailed status.

Returns:
  • ApiResult

    A dictionary (or list of dicts) of parsed interface data, or None if request fails.

show_interface_counters(port)

Retrieve detailed status or counter of a specific port or port range.

Parameters:
  • port (str) –

    Port identifier string, e.g., “1/1/1”, “1/1/1-1/1/4”, or “1/1”.

  • accounting

    If True, retrieve counter info instead of detailed status.

Returns:
  • ApiResult

    A dictionary (or list of dicts) of parsed interface data, or None if request fails.

show_interface_counters_errors(port)

Retrieve detailed error counters of a specific port or port range.

Parameters:
  • port (str) –

    Port identifier string, e.g., “1/1/1”, “1/1/1-1/1/4”, or “1/1”.

  • counter (errors) –

    If True, retrieve error counter info instead of detailed status.

Returns:
  • ApiResult

    A dictionary (or list of dicts) of parsed interface data, or None if request fails.