我正在尝试获取已上传到Google Cloud Storage的文件,对其内容进行一些处理,然后使用带有python3.7的Google Cloud Functions将其移动到其他存储桶。根据他们的文档,我只能获取文件名。我尝试使用,import cloudstorage
但是它出错module 'cloudstorage' has no attribute 'NotFoundError'
,并且使用Google谷歌搜索并没有带我到任何地方。
有没有一个示例代码可以满足我的需要?
该cloudstorage
库特定于App Engine的标准环境。
与Cloud Storage兼容的库为google-cloud-storage
。您必须在requirements.txt
文件中为函数声明它。
这个有关如何从一个存储桶复制到另一个存储桶的示例就足够了。复制后,您可以source_blob.delete()
删除它。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句