Closed Someguy123 closed 4 years ago
Currently the API doesn't support pagination, which can be a problem when viewing ASNs with large amounts of prefixes such as Hurricane Electric (AS6939).
The list_prefixes view ( https://github.com/Privex/looking-glass/blob/master/lg/peerapp/views.py#L117 ) should support the GET parameters limit / skip, and to prevent abuse, limit should have a configurable default and maximum, e.g. DEFAULT_API_LIMIT=1000 MAX_API_LIMIT=10000
limit
skip
DEFAULT_API_LIMIT=1000
MAX_API_LIMIT=10000
Example:
# page 1 GET /api/v1/prefixes?asn=6939&limit=1000 # page 2 GET /api/v1/prefixes?asn=6939&limit=1000&skip=1000
Task complete in linked PR
Currently the API doesn't support pagination, which can be a problem when viewing ASNs with large amounts of prefixes such as Hurricane Electric (AS6939).
The list_prefixes view ( https://github.com/Privex/looking-glass/blob/master/lg/peerapp/views.py#L117 ) should support the GET parameters
limit
/skip
, and to prevent abuse,limit
should have a configurable default and maximum, e.g.DEFAULT_API_LIMIT=1000
MAX_API_LIMIT=10000
Example: