2024-09-28 03:18:35 发布
网友
我在用google.cloud.storagePython库在Google云存储中存储来自myappengine灵活应用程序的文件。我想使用x-goog-if-generation-match头来防止覆盖更新的版本,但是找不到方法将其传递到库。你知道吗
是否可以使用blob生成检查google.cloud.storagePython库?你知道吗
AFAIK x-goog-if-generation-match头仅在XML API中可用。你知道吗
x-goog-if-generation-match
google.cloud.storage库不允许对请求头进行一般的、直接的访问。在某些情况下,支持访问,但通过专用属性,我发现在^{}中没有与x-goog-if-generation-match等价的属性。你知道吗
google.cloud.storage
不过,我确实看到了检索对象/blob的生成和元生成的方法(但这些方法并不等同于x-goog-if-generation-match):
generationRetrieve the generation for the object.See https://cloud.google.com/storage/docs/json_api/v1/objectsReturn type: int or NoneType Returns: The generation of the blob or None if the blob’s resource has not been loaded from the server.
generation
Retrieve the generation for the object.
See https://cloud.google.com/storage/docs/json_api/v1/objects
Return type: int or NoneType Returns: The generation of the blob or None if the blob’s resource has not been loaded from the server.
NoneType
None
以及
metagenerationRetrieve the metageneration for the object.See https://cloud.google.com/storage/docs/json_api/v1/objectsReturn type: int or NoneType Returns: The metageneration of the blob or None if the blob’s resource has not been loaded from the server.
metageneration
Retrieve the metageneration for the object.
Return type: int or NoneType Returns: The metageneration of the blob or None if the blob’s resource has not been loaded from the server.
AFAIK
x-goog-if-generation-match
头仅在XML API中可用。你知道吗google.cloud.storage
库不允许对请求头进行一般的、直接的访问。在某些情况下,支持访问,但通过专用属性,我发现在^{x-goog-if-generation-match
等价的属性。你知道吗不过,我确实看到了检索对象/blob的生成和元生成的方法(但这些方法并不等同于
x-goog-if-generation-match
):以及
相关问题 更多 >
编程相关推荐