dotmesh-io / dotmesh

dotmesh (dm) is like git for your data volumes (databases, files etc) in Docker and Kubernetes
https://dotmesh.com
Apache License 2.0
539 stars 29 forks source link

Frontend ng 635 folder based navigation #750

Closed binocarlos closed 4 years ago

binocarlos commented 5 years ago

Allows the S3 api to list bucket files from a certain path.

This is driven by the path query parameter - if we pass a file key as part of the url (e.g. /s3/{namespace}:{name}/{key:.*}) it means we are download the file at that key.

The following query parameters are supported:

This is how to get a list of all files in the dot (i.e. the currently implementation):

The result will also include a TotalResults property - this allows the frontend to know how many pages of results there are in total so it can show a pager UI.

There are additional unit tests to cover what the frontend is expecting.

rusenask commented 5 years ago

path prefix search seems to be incorrect? https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html

Also, is there a link to s3 pagination? In their docs they say default is 1000 keys. I guess it would be easiest just to query aws S3 and see responses (https://medium.com/@mageswaran1989/list-s3-folders-with-boto3-b2d7fbd631e9) MaxKeys, Prefix

binocarlos commented 4 years ago

@rusenask good shout - so I will change the path param to be Prefix and limit to be MaxKeys (or rather take a look at the api requests/responses and see that the HTTP params are) - I think we agreed (at the last team days) that we are not trying that hard to be S3 compatible but we might as well change these parameters :+1:

binocarlos commented 4 years ago

ok - so here is the reference for HTTP parameters for the S3 api: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html

So I will use Prefix and MaxKeys

binocarlos commented 4 years ago

However with pagination - they use continuation tokens, I'm going to stick with our Page param (effort reward ratio doesn't work to implement some kind of token to do this)