【发布时间】:2016-08-15 11:12:01
【问题描述】:
-
首先我将图像存储:
import cloudstorage as gcs ... path = '/bucket/folder/image.jpg' with gcs.open(path, 'w') as f: f.write(data) -
然后我得到服务网址:
url = images.get_serving_url(None, filename='/gs{}'.format(self.path), secure_url=True)服务 url 通常按预期工作,问题是我没有使用 blob_key,只有文件名(存储中的路径)。
-
我现在想知道如何删除serving_url,因为sdk方法只接受blob_key
def delete_serving_url(blob_key, rpc=None): """Delete a serving url that was created for a blob_key using get_serving_url. Args: blob_key: BlobKey, BlobInfo, str, or unicode representation of BlobKey of blob that has an existing URL to delete. rpc: Optional UserRPC object. Raises: BlobKeyRequiredError: when no blobkey was specified. InvalidBlobKeyError: the blob_key supplied was invalid. Error: There was a generic error deleting the serving url. """
【问题讨论】:
-
所以
delete_serving_url删除 gcs 上的整个文件对吗? -
不,我删除了图片的 serving_url,所以它不能通过这个 url 访问
标签: google-app-engine gae-python27