cloudstorage
cloudstorage copied to clipboard
How to look through directories recursively in Minio Driver
Is there any way to go through directories (blobs) recursively in Minio Driver?
def get_blobs(self, container: Container) -> Iterable[Blob]:
for obj in self.client.list_objects(container.name, recursive=False):
yield self._make_obj(container, obj)
You can traverse one level deep:
for container in storage:
container.name
# 'container-a', 'container-b', ...
for blob in container:
blob.name
# 'blob-1', 'blob-2', ...
The library does not currently support nested containers/folders. Are you looking for an implementation of os.walk functionality?
Yes. Just want to store several types of file in one bucket, but split them using folders. And apply retention policy to these files. Maybe you have some kind of workaround for this, do you?
Are there any updates on this question? Is this gonna be developed in the next patch/version?
It would be developed in the next version and depends on:
- [ ] Support for nested containers (folders)
- [ ] Implement Lifecycle Configuration which requires minio version RELEASE.2019-08-14T20-37-41Z