-
Notifications
You must be signed in to change notification settings - Fork 9
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
Helper class - possible to add directory GET #57
Comments
It would be really useful if a 'GET whole directory' helper could be developed, for cases where a bucket has a sub directory structure, and the user needs to GET all files from a directory, including subfolders and their files. |
Stephen -- I might have misunderstood tyour request, but have you seen the Prefix attribute? If you get_bucket with the prefix "my/folder/" you would get a listing of all the files "under" that folder. It's just a string match, but it does what I think you're looking for. ds3_python3_sdk/samples/getBucket.py Line 22 in 623f299
|
Thanks John! I was thinking of a GET all objects rather than get list of objects, so equivalent to this getting_all_objects_in_bucket.py - https://github.com/SpectraLogic/ds3_python3_sdk/blob/623f2997121d850a8b9b989fcbc8ecae45d9a2b6/samples/getting_all_objects_in_bucket.py - but with ability to specify the folder only. So imagine the prefix function from getBucket.py, but to get the objects themselves not just a list of them. The CLI has a method to do this - get_bulk - https://developer.spectralogic.com/java-command-line-interface-cli-reference-and-examples/ - but it would be great to have it in the Python sdk. |
This is an example of how to achieve this in the CLI (with an output to txt file for a log) - it works perfectly there, but would be great to have similar in the Python...
|
@stephenmcconnachie we are looking into this and working out where in our current development cycles we can slot this feature in. |
Thanks very much @gtrossell |
@stephenmcconnachie -- just merged a PR to do this. The get_all_files_in_bucket now takes a prefix string. |
@stephenmcconnachie - we have added in a fix to master, if you want to pull it down |
That's fantastic, thank you! |
No description provided.
The text was updated successfully, but these errors were encountered: