Skip to content

Template for downloading CSV of connections between devices and/or patch panels #17386

Discussion options

You must be logged in to vote

Most flexible would be to query from the REST API and write your own code to format however you like.

If you want to do this within Netbox then you could create an export template. The method trace() on an interface gives you a list of the path elements. You can exercise this in nbshell.

# /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py nbshell
...
>>> i = Interface.objects.get(name="ether8",device__name="gw2")
>>> i
<Interface: ether8>
>>> i.trace()
[([<Interface: ether8>], [<Cable: #51>], [<FrontPort: F3>]), ([<RearPort: R3>], [<Cable: #54>], [<Interface: eno1>])]

Note that you get a list of three-tuples here, each element of which of which has a list of terminations or cables…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Prestwickuk
Comment options

Answer selected by Prestwickuk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants