Skip to content

filtering via API not working #115

@MikeAT

Description

@MikeAT

Plugin Version

0.1.0

NetBox Version

NetBox Community v4.3.4-Docker-3.3.0

Python Version

Python 3.12.3

Steps to Reproduce

I added a custom object type called "database" and added 2 objects, when I try to filter it based on the name via API (like it works for virtual machines) I always get a complete list of objects rather than a filtered one:

 curl -L -X GET \
-H "Authorization: Token $TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json; indent=4" \
"http://127.0.0.1:8000/api/plugins/custom-objects/database?name=db1"
{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 5,
            "url": "http://127.0.0.1:8000/api/plugins/custom-objects/database/5/",
            "host": [],
            "name": "db1",
            "type": "postgres"
        },
        {
            "id": 7,
            "url": "http://127.0.0.1:8000/api/plugins/custom-objects/database/7/",
            "host": [],
            "name": "db2",
            "type": "mysql"
        }
    ]
}

Is this a know limitation or am I doing something wrong?

Expected Behavior

only get

"results": [
        {
            "id": 5,
            "url": "http://127.0.0.1:8000/api/plugins/custom-objects/database/5/",
            "host": [],
            "name": "db1",
            "type": "postgres"
        }
]

as result

Observed Behavior

all objects for this custom type are returned

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions