zoneminder
zoneminder copied to clipboard
WEB_EVENTS_PER_PAGE does not work using API
Describe Your Environment Zoneminder 1.34.22 Debian Buster
Describe the bug WEB_EVENTS_PER_PAGE seems to be not used using API /events/index
Steps to reproduce the behavior:
- Call documentation example curl -XGET "http://server/zm/api/events/index/StartTime%20>=:2015-05-15%2018:43:56/EndTime%20<=:208:43:56.json"
- API returns 100 results
Expected behavior API returns WEB_EVENTS_PER_PAGE items (default is 25)
Thanks for opening your first issue here! Just a reminder, this forum is for Bug Reports only. Be sure to follow the issue template!
The API does not follow WEB_EVENTS_PER_PAGE - that is primarily for the console/UI. When it comes to API, we would like to reduce overheads of API calls to get relevant events and that is why it is set to 100.
According to the documentation, API respects WEB_EVENTS_PER_PAGE
https://zoneminder.readthedocs.io/en/stable/api.html Return a list of all events http://server/zm/api/events.json Note that events list can be quite large and this API (as with all other APIs in ZM) uses pagination. Each page returns a specific set of entries. By default this is 25 and ties into WEB_EVENTS_PER_PAGE in the ZM options menu.
The doc is dated then. https://github.com/ZoneMinder/zoneminder/blob/master/web/api/app/Controller/EventsController.php#L77
Ok thanks you. Maybe can you think about URL parameter to define items number per page? Currently I manage a double pagination.
I actually don't like that we limit our results to 100. When we do, it should be considered an ERROR. Caller should specify a limit. We should deal with the issues around ram limits DOS etc...
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.