Closed binocarlos closed 4 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
@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:
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
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)
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:
path
- at what sub path are we wanting to list files (blank string means the root of the dot)limit
- what is the maximum number of results we want backpage
- allows for paging through results - page is combined with limit to know what range of the results to returnnonRecursive
- means don't descend into folders - only return items directly in the given pathincludeDirectories
- means include directories in the resultsThis is how to get a list of all files in the dot (i.e. the currently implementation):
path=
limit=0
page=0
nonRecursive=
includeDirectories=
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.