2
我找不到任何關於如何使用python谷歌雲存儲的批處理功能的例子。我看到它存在here。谷歌雲存儲python客戶端的批量請求
我很喜歡一個具體的例子。比方說,我想要刪除一組具有給定前綴的blob。我開始越來越斑點的名單如下
from google.cloud import storage
storage_client = storage.Client()
bucket = storage_client.get_bucket('my_bucket_name')
blobs_to_delete = bucket.list_blobs(prefix="my/prefix/here")
# how do I delete the blobs in blobs_to_delete in a single batch?
# bonus: if I have more than 100 blobs to delete, handle the limitation
# that a batch can only handle 100 operations