本文件 here 说:“注意,如果不使用默认bucket,就需要其他方法来提供bucket名称。”如何提供非默认bucket?
我知道如何使用gfile读取任何使用 gs://<bucket_name>//file 但这是一个不同的API。
gs://<bucket_name>//file
从文档中 open 方法: https://cloud.google.com/appengine/docs/standard/python/googlecloudstorageclient/functions#open
open
论据 文件名(必需)要打开的文件,格式为 /桶/物体 .
论据
文件名(必需)要打开的文件,格式为 /桶/物体 .
您需要提供给API的格式是 "/<bucket_name>/<file>"
"/<bucket_name>/<file>"
例如: "/my_bucket/lyrics/southamerica/list5.txt"
"/my_bucket/lyrics/southamerica/list5.txt"
这是对 打开 方法 https://github.com/GoogleCloudPlatform/appengine-gcs-client/blob/master/python/src/cloudstorage/cloudstorage_api.py#L47-L54
打开