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

API limit number of files returned at /api/files #496

Open
spuder opened this issue Mar 19, 2019 · 0 comments
Open

API limit number of files returned at /api/files #496

spuder opened this issue Mar 19, 2019 · 0 comments

Comments

@spuder
Copy link

spuder commented Mar 19, 2019

Querying the files api endpoint will return all files. If your astrobox has been running a while, there could be hundreds of thousands of files returned by the call.

While it is trivial to filter the results once received. It makes the api calls take much longer

HEADER="X-Api-Key:$ASTROBOX_APIKEY"
files=$(curl -s -X GET -H "${HEADER}" "${ASTROBOX_ENDPOINT}/api/files")
filenames=$(echo "$files" | jq -r '.files | sort_by(.date)| reverse | .[].name')

Is there a way to limit the number of results returned from the api?

curl -X GET \
  http:https://astrobox1.local/api/files \
  -H 'X-Api-Key: xxxx' \
  -H 'cache-control: no-cache'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant