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

Create containers with mkdir #7

Open
wachsylon opened this issue Nov 30, 2022 · 1 comment
Open

Create containers with mkdir #7

wachsylon opened this issue Nov 30, 2022 · 1 comment

Comments

@wachsylon
Copy link

wachsylon commented Nov 30, 2022

It would be nice to have the mkdir method at least for the lowest level, the container because it seems container are not created on the fly when a mapper is used. If the container testtzis does not exist in the following account, the mapper runs into an error:

a=fsspec.get_mapper("swift://swift.dkrz.de/dkrz_4236b71e-04df-456b-8a32-5d66641510f2/testtzis/testcmip6")
a[".test"]=b"ho"

404, message='Not Found', url=URL('https://swift.dkrz.de/v1/dkrz_4236b71e-04df-456b-8a32-5d66641510f2/testtzis/testcmip6/.test')

Do you think that is possible?

@d70-t
Copy link
Collaborator

d70-t commented Nov 30, 2022

Yes, implementing mkdir and rmdir on containers should be straight forward (I'd consider it the second level though, because there are accounts as well. We'd need (from the SWIFT API):

  • PUT /v1/{account}/{container} for mkdir
  • DELETE /v1/{account}/{container} for rmdir

I'd probably even go one step further (maybe in another PR) and also catch the error you describe. Then create the container and redo the request. We might want to make this optional though...

I might not be able to that change very soon, but PR's are welcome.

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