diff --git a/napalm_device_types/switch.py b/napalm_device_types/switch.py index 3d123fc..93692d3 100644 --- a/napalm_device_types/switch.py +++ b/napalm_device_types/switch.py @@ -10,7 +10,7 @@ Usage:: ... """ -from typing import Dict +from typing import Dict, List from napalm.base import NetworkDriver from napalm_device_types.models import ( Dot1XPortDict, @@ -375,6 +375,27 @@ class SwitchDriver(NetworkDriver): """ raise NotImplementedError + def set_lag_members(self, lag_name: str, members: List[str]) -> None: + """ + Sets the full member-port list of a LAG/trunk interface. + + Diffs *members* against the LAG's current members (as reported by + ``get_interfaces()``'s ``lag_members`` field) and adds/removes ports + on the device to match. The LAG itself must already exist on the + device; this method only manages its membership. + + :param lag_name: Name of the LAG/trunk interface as returned by + ``get_interfaces()`` (e.g. ``"Trk1"``, ``"ch1"``, ``"Lag1"``). + :param members: Full desired list of member port names. + :raises NotImplementedError: If the driver does not implement this method. + :raises ValueError: If *lag_name* does not refer to a valid LAG. + + Example:: + + driver.set_lag_members("Lag1", ["GigabitEthernet0/1", "GigabitEthernet0/2"]) + """ + raise NotImplementedError + def set_poe_enabled(self, interface: str, enabled: bool) -> None: """ Administratively enables or disables PoE on a single port.