API: Get IP-Address objects which are assigned to an vm interface did not work #4669

Closed
opened 2025-12-29 19:19:20 +01:00 by adam · 6 comments
Owner

Originally created by @Mordecaine on GitHub (Mar 17, 2021).

NetBox version

v2.10.4

Python version

3.6

Steps to Reproduce

https://10.138.1.131/api/ipam/ip-addresses/?assigned_object_id=12&assigned_object_type=virtualization.vminterface

Expected Behavior

https://10.138.1.131/api/ipam/ip-addresses/?assigned_object_type=12&assigned_object_type=virtualization.vminterface
should return only the address object, which is assigned to this virtual machine network interface

Observed Behavior

I get back all address objects in netbox

In an earlier version I was able to get all IP address objects which were assigned to a virtual machine network interface:
https://10.138.1.132/api/ipam/ip-addresses/2369/?interface=nic01

In This version I tried the following:
https://10.138.1.131/api/ipam/ip-addresses/?assigned_object_id=12&assigned_object_type=virtualization.vminterface

But netbox returned all ip address objects

Originally created by @Mordecaine on GitHub (Mar 17, 2021). ### NetBox version v2.10.4 ### Python version 3.6 ### Steps to Reproduce https://10.138.1.131/api/ipam/ip-addresses/?assigned_object_id=12&assigned_object_type=virtualization.vminterface ### Expected Behavior https://10.138.1.131/api/ipam/ip-addresses/?assigned_object_type=12&assigned_object_type=virtualization.vminterface should return only the address object, which is assigned to this virtual machine network interface ### Observed Behavior I get back all address objects in netbox In an earlier version I was able to get all IP address objects which were assigned to a virtual machine network interface: https://10.138.1.132/api/ipam/ip-addresses/2369/?interface=nic01 In This version I tried the following: https://10.138.1.131/api/ipam/ip-addresses/?assigned_object_id=12&assigned_object_type=virtualization.vminterface But netbox returned all ip address objects
adam added the type: bug label 2025-12-29 19:19:20 +01:00
adam closed this issue 2025-12-29 19:19:20 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 17, 2021):

This issue is pending closure as it does not conform to one of the provided templates as required by the contributing guide. If you'd like to request that your issue be re-opened, please first update the content so that it matches the appropriate template (this may require rewriting your issue entirely).

@jeremystretch commented on GitHub (Mar 17, 2021): This issue is pending closure as it does not conform to one of the [provided templates](https://github.com/netbox-community/netbox/issues/new/choose) as required by the [contributing guide](https://github.com/netbox-community/netbox/blob/master/CONTRIBUTING.md). If you'd like to request that your issue be re-opened, please first update the content so that it matches the appropriate template (this may require rewriting your issue entirely).
Author
Owner

@DanSheps commented on GitHub (Mar 17, 2021):

There is no filter for this. Instead, you need to use vminterface= or vminterface_id=

@DanSheps commented on GitHub (Mar 17, 2021): There is no filter for this. Instead, you need to use vminterface= or vminterface_id=
Author
Owner

@DanSheps commented on GitHub (Mar 17, 2021):

Thank you for opening a bug report. It seems that the described functionality is intended behavior. If you meant to open a feature request instead, please close this issue and open a new one using the feature request template. Otherwise, please revise your post above to elaborate on why you believe the observed behavior is flawed.

@DanSheps commented on GitHub (Mar 17, 2021): Thank you for opening a bug report. It seems that the described functionality is intended behavior. If you meant to open a feature request instead, please close this issue and open a new one using the [feature request template](https://github.com/netbox-community/netbox/issues/new?template=feature_request.md). Otherwise, please revise your post above to elaborate on why you believe the observed behavior is flawed.
Author
Owner

@Mordecaine commented on GitHub (Mar 17, 2021):

@DanSheps
Thanks Dan. I have looking for this.:
"There is no filter for this. Instead, you need to use vminterface= or vminterface_id="

It worked fine with vminterface_id

@Mordecaine commented on GitHub (Mar 17, 2021): @DanSheps Thanks Dan. I have looking for this.: "There is no filter for this. Instead, you need to use vminterface= or vminterface_id=" It worked fine with vminterface_id
Author
Owner

@xcdr commented on GitHub (Mar 26, 2021):

Hi, I have related question.

When creating instance of ipam.ip_addresses, I should use vminterface_id or assigned_object_type/assigned_object_id?

@xcdr commented on GitHub (Mar 26, 2021): Hi, I have related question. When creating instance of ipam.ip_addresses, I should use vminterface_id or assigned_object_type/assigned_object_id?
Author
Owner

@jeremystretch commented on GitHub (Mar 26, 2021):

@xcdr please start a new discussion instead of commenting on closed issues.

@jeremystretch commented on GitHub (Mar 26, 2021): @xcdr please start a new [discussion](https://github.com/netbox-community/netbox/discussions) instead of commenting on closed issues.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4669