如何使用Google Cloud功能获取文件内容并将文件移动到其他Google Cloud Storage

斯蒂科

我正在尝试获取已上传到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] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

使用Google Cloud Dataflow合并Google Cloud Storage中的文件

如何从Google Cloud Storage解密文件?

使用Google Cloud Console在Google Cloud Storage中的文件夹之间移动文件

如何使用curl从Google Cloud Storage下载文件

如何使用Deployment Manager将文件写入Google Cloud Storage?

如何使用 google-cloud-storage 创建文件?

无法使用Firebase功能删除Google Cloud Storage文件

如何使用Google API从Google Cloud Storage获取报告

如何根据Blob键从Google Cloud Storage获取文件的类型?

如何使用Google Cloud Dataflow将压缩文件写入Google Cloud Storage?

如何使用带有 Python 的 Google Cloud Functions 将列表写入 Google Cloud Storage 中的文件

如何使用Node.js获取Google Cloud Storage文件夹中的文件列表?

如何获取Google Cloud Storage的授权令牌

如何从Google App Engine读取Google Cloud Storage文件

如何使用Google Cloud Function将文件从Cloud Storage存储桶中推送到实例中?

如何编写以从 Ruby 中的 Google Cloud Storage 获取内容?

从Google Cloud Storage流式传输文件

Google Cloud Storage加入多个csv文件

Google Cloud Storage中的Concat Avro文件

Google Cloud Storage与Google Cloud CDN

Cloud ML无法在Google Cloud Storage上找到文件

如何让 Google Cloud Storage 解压缩 gzip 文件?

如何限制Google Cloud Storage存储桶的文件类型?

如何批量删除 Google Cloud Storage 中的文件?(节点.js)

如何读取 Google Cloud Storage 上的私有文件

如何使用凭证初始化Google Cloud Storage

如何使用Elixir或Erlang创建Google Cloud Storage签名URL?

如何使用Google Cloud Storage作为Delta Lake的存储层?

如何使用keras.preprocessing从Google Cloud Storage加载图像