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

Check whether a storage container or blob already exists #5062

Closed
ricklang opened this issue Sep 9, 2019 · 6 comments
Closed

Check whether a storage container or blob already exists #5062

ricklang opened this issue Sep 9, 2019 · 6 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. enhancement Storage Storage Service (Queues, Blobs, Files)

Comments

@ricklang
Copy link

ricklang commented Sep 9, 2019

Is there an easy way to check whether a storage container already exists? Same for a blob.

@bterlson
Copy link
Member

bterlson commented Sep 9, 2019

Maybe the easiest way today is calling getProperties on BlobClient and checking for a 404 status code. I think we should implement exists, however! /cc @XiaoningLiu @jeremymeng

@jeremymeng jeremymeng added the Storage Storage Service (Queues, Blobs, Files) label Sep 9, 2019
@triage-new-issues triage-new-issues bot removed the triage label Sep 9, 2019
@bterlson bterlson added the Client This issue points to a problem in the data-plane of the library. label Sep 9, 2019
@XiaoningLiu
Copy link
Member

Agree

Maybe the easiest way today is calling getProperties on BlobClient and checking for a 404 status code. I think we should implement exists, however! /cc @XiaoningLiu @jeremymeng

@bterlson
Copy link
Member

I confirmed with @JeffreyRichter that exists makes some sense, but there's a concern that exists encourages coding patterns that might seem reliable but aren't in practice. For example, upload-if-not-exists might be implemented as if (!(await client.exists())) { await client.upload() } but another node might be running the same check at the same time and the uploads will still clobber each other.

It's still worth implementing exists, though, I think. Python will likely be adding it as well.

@Gtonizuka
Copy link

hey guys has this ever been implemented?

@cpwr
Copy link

cpwr commented Sep 17, 2020

yeah, has it?

@jeremymeng
Copy link
Member

implemented in #5333

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. enhancement Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

6 participants