Skip to content

Commit ac72491

Browse files
refactor: remove dead InterfaceConnection functions (endpoint removed in NetBox 4.0)
The /api/dcim/interface-connections/ endpoint was superseded by the Cables model in NetBox 4.0 and is no longer exposed by the API. Verified against all three supported NetBox versions — 4.3.7 (minimum), 4.4.10, and 4.5.8 all return HTTP 404 for GET /api/dcim/interface-connections/, and the path is absent from each version's OpenAPI schema. Consumers calling these four functions were receiving 404s, not useful output. This was a long-standing dead branch inherited from the NetboxPS fork that the 2026-04-17 drift audit surfaced as the last remaining ValidateSet-parity finding (#392 item 9). Removed: - Functions/DCIM/Interfaces/Get-NBDCIMInterfaceConnection.ps1 - Functions/DCIM/Interfaces/New-NBDCIMInterfaceConnection.ps1 - Functions/DCIM/Interfaces/Set-NBDCIMInterfaceConnection.ps1 - Functions/DCIM/Interfaces/Remove-NBDCIMInterfaceConnection.ps1 Related cleanup: - Functions/Helpers/_Aliases.ps1: drop Add-NBDCIMInterfaceConnection (the legacy alias for New-). - Tests/DCIM.Interfaces.Tests.ps1: remove four Context blocks plus InterfaceConnection entries from the WhatIf/All-PageSize/Omit TestCases arrays. The remaining 9 Interface tests still pass. - PowerNetbox.psd1: FunctionsToExport regenerated by deploy.ps1 without the 4 removed functions; AliasesToExport drops Add-NBDCIMInterfaceConnection. Migration: callers should use the Cables API instead. A direct cable between two interfaces in PowerNetbox: New-NBDCIMCable -A_Terminations @(@{object_type='dcim.interface'; object_id=1}) ` -B_Terminations @(@{object_type='dcim.interface'; object_id=2}) After this commit the parity tool reports "All ValidateSets match NetBox v4.5.8" — #392 drift backlog fully closed. Breaking change: any caller still using {Get,New,Set,Remove}- NBDCIMInterfaceConnection (or the Add- alias) will get a CommandNotFoundException. In practice no such caller can exist, since every call to the underlying endpoint has returned 404 across the entire supported NetBox version range.
1 parent b44934e commit ac72491

7 files changed

Lines changed: 25 additions & 426 deletions

Functions/DCIM/Interfaces/Get-NBDCIMInterfaceConnection.ps1

Lines changed: 0 additions & 92 deletions
This file was deleted.

Functions/DCIM/Interfaces/New-NBDCIMInterfaceConnection.ps1

Lines changed: 0 additions & 86 deletions
This file was deleted.

Functions/DCIM/Interfaces/Remove-NBDCIMInterfaceConnection.ps1

Lines changed: 0 additions & 50 deletions
This file was deleted.

Functions/DCIM/Interfaces/Set-NBDCIMInterfaceConnection.ps1

Lines changed: 0 additions & 75 deletions
This file was deleted.

Functions/Helpers/_Aliases.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
# These aliases maintain compatibility with scripts using the old Add-* naming convention
33

44
Set-Alias -Name Add-NBDCIMInterface -Value New-NBDCIMInterface
5-
Set-Alias -Name Add-NBDCIMInterfaceConnection -Value New-NBDCIMInterfaceConnection
65
Set-Alias -Name Add-NBDCIMFrontPort -Value New-NBDCIMFrontPort
76
Set-Alias -Name Add-NBDCIMRearPort -Value New-NBDCIMRearPort
87
Set-Alias -Name Add-NBVirtualMachineInterface -Value New-NBVirtualMachineInterface
98

109
# Export aliases
11-
Export-ModuleMember -Alias Add-NBDCIMInterface, Add-NBDCIMInterfaceConnection, Add-NBDCIMFrontPort, Add-NBDCIMRearPort, Add-NBVirtualMachineInterface
10+
Export-ModuleMember -Alias Add-NBDCIMInterface, Add-NBDCIMFrontPort, Add-NBDCIMRearPort, Add-NBVirtualMachineInterface

0 commit comments

Comments
 (0)