Skip to content
Snippets Groups Projects

Feature/nat 314 integrate iptrunk modification with netbox

1 file
+ 0
20
Compare changes
  • Side-by-side
  • Inline
@@ -268,26 +268,6 @@ class NetboxClient:
@@ -268,26 +268,6 @@ class NetboxClient:
interface.save()
interface.save()
return
return
def deallocate_interface(self, device_name: str, iface_name: str) -> Interfaces:
"""Allocate an interface by marking it as connected."""
device = self.get_device_by_name(device_name)
interface = self.netbox.dcim.interfaces.get(device_id=device.id, name=iface_name)
# Check if interface is available
if interface is None:
raise NotFoundError(f"Interface: {iface_name} on device: {device_name} not found.")
# Check if interface is reserved
if interface.mark_connected:
raise WorkflowStateError(f"The interface: {iface_name} on device: {device_name} is already allocated.")
# allocate interface by mark as connected
interface.mark_connected = False
interface.save()
return interface
def get_available_lags(self, router_id: UUID) -> list[str]:
def get_available_lags(self, router_id: UUID) -> list[str]:
"""Return all available :term:`LAG`s not assigned to a device."""
"""Return all available :term:`LAG`s not assigned to a device."""
Loading