Skip to content

Help with custom link #19654

Closed Answered by joernheissler
gtomilko asked this question in Help Wanted!
Discussion options

You must be logged in to vote

Hi,
your oob_ip is a an ipam.IPAddress: https://github.com/netbox-community/netbox/blob/v4.3.2/netbox/dcim/models/devices.py#L561
.address is an IPAddressField: https://github.com/netbox-community/netbox/blob/v4.3.2/netbox/ipam/models/ip.py#L720
Next is some magic (which I don't understand) that converts your IPAddressField into a netaddr.IPNetwork.
What you're looking for is the netaddr docs: https://netaddr.readthedocs.io/en/latest/api.html#netaddr.IPNetwork.ip

tl;dr: {{ object.oob_ip.address.ip }}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by gtomilko
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants