Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WEB_EVENTS_PER_PAGE does not work using API #3106

Open
0rsa opened this issue Jan 5, 2021 · 7 comments
Open

WEB_EVENTS_PER_PAGE does not work using API #3106

0rsa opened this issue Jan 5, 2021 · 7 comments
Labels

Comments

@0rsa
Copy link

0rsa commented Jan 5, 2021

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:

  1. 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"
  2. API returns 100 results

Expected behavior
API returns WEB_EVENTS_PER_PAGE items (default is 25)

@welcome
Copy link

welcome bot commented Jan 5, 2021

Thanks for opening your first issue here! Just a reminder, this forum is for Bug Reports only. Be sure to follow the issue template!

@pliablepixels
Copy link
Member

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.

@0rsa
Copy link
Author

0rsa commented Jan 14, 2021

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.

@0rsa
Copy link
Author

0rsa commented Jan 15, 2021

Ok thanks you.
Maybe can you think about URL parameter to define items number per page?
Currently I manage a double pagination.

@connortechnology
Copy link
Member

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...

@stale
Copy link

stale bot commented Apr 16, 2022

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.

@stale stale bot added the stale label Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 participants