Skip to content

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

Description

@spuder

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://astrobox1.local/api/files \
  -H 'X-Api-Key: xxxx' \
  -H 'cache-control: no-cache'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions