NetBox API - filters on extras.object_change time field #6266

Closed
opened 2025-12-29 19:38:43 +01:00 by adam · 3 comments
Owner

Originally created by @Bapths on GitHub (Mar 28, 2022).

NetBox version

v3.1.9

Python version

3.8

Steps to Reproduce

  1. Change the url to access the api.
  2. Go to /extras/object-changes/
  3. Add a filter on the 'time' field like '.../extras/object-changes/?time__gt=2022-03-29T13:07:55.692025Z'

Expected Behavior

Returns object-changes that happened after '2022-03-29T13:07:55.692025Z'.

Observed Behavior

Returns all object-changes.

Originally created by @Bapths on GitHub (Mar 28, 2022). ### NetBox version v3.1.9 ### Python version 3.8 ### Steps to Reproduce 1. Change the url to access the api. 2. Go to /extras/object-changes/ 3. Add a filter on the 'time' field like '.../extras/object-changes/?time__gt=2022-03-29T13:07:55.692025Z' ### Expected Behavior Returns object-changes that happened after '2022-03-29T13:07:55.692025Z'. ### Observed Behavior Returns all object-changes.
adam closed this issue 2025-12-29 19:38:43 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 28, 2022):

Change the url to access the api.

Why? What does this mean?

@jeremystretch commented on GitHub (Mar 28, 2022): > Change the url to access the api. Why? What does this mean?
Author
Owner

@Bapths commented on GitHub (Mar 28, 2022):

Change the url to access the api.

Why? What does this mean?

I mean going to netbox_url/api/ on a browser for example. So if my netbox root url is www.example.netbox.com the final url would be www.example.netbox.com/api/extras/object-changes/.

@Bapths commented on GitHub (Mar 28, 2022): > > Change the url to access the api. > > Why? What does this mean? I mean going to *netbox_url*/api/ on a browser for example. So if my netbox root url is *www.example.netbox.com* the final url would be *www.example.netbox.com/api/extras/object-changes/*.
Author
Owner

@jeremystretch commented on GitHub (Mar 29, 2022):

Add a filter on the 'time' field like '.../extras/object-changes/?time__gt=2022-03-29T13:07:55.692025Z'

The supported filters for change logs are time_before and time_after. (The ObjectChange model uses a DateFromToRangeFilter filter, unlike most models.)

@jeremystretch commented on GitHub (Mar 29, 2022): > Add a filter on the 'time' field like '.../extras/object-changes/?time__gt=2022-03-29T13:07:55.692025Z' The supported filters for change logs are `time_before` and `time_after`. (The ObjectChange model uses a [DateFromToRangeFilter](https://django-filter.readthedocs.io/en/stable/ref/filters.html#datetimefromtorangefilter) filter, unlike most models.)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6266