Skip to content

Cable Trace Result in Custom Export #15023

Discussion options

You must be logged in to vote

I am guessing that is the "Connection" column you've highlighted? (Not "Link Peers"?)

nbshell is a good way to explore the available methods and properties interactively.

# /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py nbshell
...
>>> d = Device.objects.get(name="gw2")
>>> i = d.interfaces.get(name="ether6")
>>> help(Interface)
...
>>> i.connected_endpoints
[<Interface: en5>]
>>> i.connected_endpoints[0].device
<Device: MacBook-Pro-4>

Note that this is a list, because in general a cable is allowed to have multiple terminations at each end.

Replies: 1 comment 1 reply

Comment options

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

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