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

Improve list-files endpoint #424

Open
aulneau opened this issue Jul 25, 2022 · 2 comments
Open

Improve list-files endpoint #424

aulneau opened this issue Jul 25, 2022 · 2 comments

Comments

@aulneau
Copy link

aulneau commented Jul 25, 2022

I'm working on some improve Gaia related SDKs for micro-stacks, and the list files endpoint currently is very basic -- every time you call it you need to manually re-fetch if there are many pages of data.

I was thinking at a high level that it'd be great to do a few things:

  • change the response to {results: string[], offset: number; limit: number; total: number}
  • allow passing these query params:
    • prefix: return files that start with this prefix
    • limit: adjust the limit of results
    • offset: currently page is this param

I think with these changes, it's possible for this endpoint to be vastly improved.

@jcnelson
Copy link
Member

As much as I would love to see this, IIRC the API is constrained by the API that the various cloud storage backends offer. Many of them only allow pagination. Maybe there's some kind of page index the node driver could maintain, but even then you'd have to keep it coherent with the upstream servers every so often in case you put something upstream without going through Gaia.

@aulneau
Copy link
Author

aulneau commented Jul 25, 2022

digging in a bit more, it's actually possible to pass a prefix already (not well documented).

the drivers have the ability to take arbitrary page sizes, but it's not being passed from the endpoint to each driver.

I think the only thing missing would be the ability to enumerate the paths that match a given prefix -- that would help a bit with fetching data in a more efficient way without needing to crawl each page

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

2 participants