Skip to content

API: Query IP Addresses by Interface #6489

Answered by candlerb
AnneWielis asked this question in Q&A
Discussion options

You must be logged in to vote

If you give an unrecognised query parameter then it's ignored (without any error), which is why you get them all.

I agree it's not well documented, but the defined set of filters for IPAddress objects is here.

The ones you want are "interface_id" or "vminterface_id". That is: if 1533 is an interface on a device, then use http://netbox/api/ipam/ip-addresses/?interface_id=1533. If it's on a VM, then use http://netbox/api/ipam/ip-addresses/?vminterface_id=1533

Replies: 3 comments 6 replies

Comment options

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

Answer selected by ryanmerolle
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@candlerb
Comment options

@AnneWielis
Comment options

@candlerb
Comment options

@candlerb
Comment options

@AnneWielis
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants