netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
15.93k stars 2.56k forks source link

Unable to filter ip-addresses by assigned_object_type via REST API #17559

Open Konunacmep opened 2 weeks ago

Konunacmep commented 2 weeks ago

Deployment Type

Self-hosted

NetBox Version

v4.1.1

Python Version

3.11

Steps to Reproduce

Сan be reproduced on the demo.

  1. Log in to https://demo.netbox.dev
  2. Request any of:

Expected Behavior

Expecting response with filtered list of ip-addresses with specified assigned_object_type (as it was on version 3)

Observed Behavior

Regardless of the parameter value (dcim.interface/virtualization.vminterface/ipam.fhrpgroup) get a response: "assigned_object_type": [ "Select a valid choice. That choice is not one of the available choices." ] From the docs: "assigned_object_type - The content type of the assigned object, defined as <app>.<model>".

It is noticed that the parameter accepts numeric values ​​of identifiers from api/extras/object-types for GET requests and filtering works. However, for POST it responds with "'assigned_object_type': ["Invalid value. Specify a content type as '.'."]" and working with values defined as <app>.<model>.

Initially the problem was noticed after the update from 3.7.1 to 4.0.8, however, the behavior is the same on a clean installation of 4.1.1.

arthanson commented 1 day ago

@Konunacmep which previous version of NetBox were you seeing this working in? I tried with v3.7 and it is not returning the interfaces using this query (see screenshot). IP Address | NetBox REST API 2024-10-04 08-20-22