Google cloud storage 谷歌云存储-删除文件?
我可以看到上传一个文件到谷歌云存储。一、 但是,在云存储中找不到删除文件的示例。是否存在删除文件API?以下是JSON API的删除API文档:Google cloud storage 谷歌云存储-删除文件?,google-cloud-storage,Google Cloud Storage,我可以看到上传一个文件到谷歌云存储。一、 但是,在云存储中找不到删除文件的示例。是否存在删除文件API?以下是JSON API的删除API文档: def delete_blob(bucket_name, destination_blob_name): """Deletes a blob from the bucket.""" try: storage_client = storage.Client(project = project) bucket = storage_clien
def delete_blob(bucket_name, destination_blob_name):
"""Deletes a blob from the bucket."""
try:
storage_client = storage.Client(project = project)
bucket = storage_client.get_bucket(bucket_name)
blob = bucket.blob(destination_blob_name)
blob.delete()
log.info('Blob {} deleted.'.format(destination_blob_name))
except Exception as e:
pass