Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud storage 谷歌云存储-删除文件?_Google Cloud Storage - Fatal编程技术网

Google cloud storage 谷歌云存储-删除文件?

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

我可以看到上传一个文件到谷歌云存储。一、 但是,在云存储中找不到删除文件的示例。是否存在删除文件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_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