azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

Option to allow delete_blob for blob versions

Open kgopi05 opened this issue 6 years ago • 6 comments

Hi,

Recently Blob versions is enabled for GA , Hence we need option to enable lifecycle policies for Blob versions and python client delete_blob to allow versions only .

https://docs.microsoft.com/en-us/python/api/azure-storage-blob/azure.storage.blob.containerclient?view=azure-python#delete-blobs--blobs----kwargs-

kgopi05 avatar Sep 02 '20 21:09 kgopi05

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

ghost avatar Sep 03 '20 16:09 ghost

Hi @kgopi05

Thanks for reaching out. For blob_client.delete_blob, you can specify version_id parameter https://azuresdkdocs.blob.core.windows.net/$web/python/azure-storage-blob/12.4.0/azure.storage.blob.html#azure.storage.blob.ContainerClient.delete_blob

for delete_blobs it seems currently you cannot batch delete blob versions, we will double check and see if we are missing adding that to delete_blobs.

Hi @scbedd can you help take a look at the doc https://docs.microsoft.com/en-us/python/api/azure-storage-blob/azure.storage.blob.blobclient?view=azure-python#delete-blob-delete-snapshots-false----kwargs- it's missing some kwargs, here's how the api should look like https://azuresdkdocs.blob.core.windows.net/$web/python/azure-storage-blob/12.4.0/azure.storage.blob.html#azure.storage.blob.ContainerClient.delete_blob

xiafu-msft avatar Sep 08 '20 23:09 xiafu-msft

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

ghost avatar Sep 21 '20 20:09 ghost

Hi @kgopi05

Thanks for reaching out. For blob_client.delete_blob, you can specify version_id parameter https://azuresdkdocs.blob.core.windows.net/$web/python/azure-storage-blob/12.4.0/azure.storage.blob.html#azure.storage.blob.ContainerClient.delete_blob

i'm unable to see the version_id in the blob parameters list , can you refer the right documentation link please ?

for delete_blobs it seems currently you cannot batch delete blob versions, we will double check and see if we are missing adding that to delete_blobs.

Hi @scbedd can you help take a look at the doc https://docs.microsoft.com/en-us/python/api/azure-storage-blob/azure.storage.blob.blobclient?view=azure-python#delete-blob-delete-snapshots-false----kwargs- it's missing some kwargs, here's how the api should look like https://azuresdkdocs.blob.core.windows.net/$web/python/azure-storage-blob/12.4.0/azure.storage.blob.html#azure.storage.blob.ContainerClient.delete_blob

kgopi05 avatar Sep 21 '20 20:09 kgopi05

Hi @kgopi05

Sorry I was looking at BlobClient.delete_blob() which is this https://azuresdkdocs.blob.core.windows.net/$web/python/azure-storage-blob/12.4.0/azure.storage.blob.html#azure.storage.blob.BlobClient.delete_blob

Please use this as reference, the doc for ContainerClient.delete_blob() is not accurate enough! Thanks for helping catch this, we will post a pr in a bit

xiafu-msft avatar Sep 24 '20 01:09 xiafu-msft

Hey @kgopi05 I have just put up a PR to fix the docstrings for ContainerClient :)

tasherif-msft avatar Sep 25 '20 21:09 tasherif-msft