0

我有一项将 zip 文件存档到 Glacier 的服务。我设置了一个简单通知服务,让我知道取消归档作业何时完成(“归档-检索”请求)。从我所知道的一切来看,响应将与 GetJob() 调用相同:

HTTP/1.1 200 OK 
x-amzn-RequestId: x-amzn-RequestId 
Date: Date
Content-Type: ContentType Content-Length: Length
x-amz-sha256-tree-hash: ChecksumComputedByAmazonGlacier

[Bytes of requested file.]

来源

出于处理目的,我需要能够接受响应并进行处理(标记谁取消归档文件,将其内容放在正确的位置等)。有没有办法将传入的 GetJob() 响应与 Job ID 或类似的东西相关联?

谢谢,

扎克

4

1 回答 1

1

SNS 消息的正文将包含从InitiateJob请求返回的作业 ID。以下是 Glacier 检索请求的示例 SNS JSON 正文:

{
   "Action":"ArchiveRetrieval", 
   "ArchiveId":"ewhHkrpO1sNPI4sFpDK7y0xFVNSR-eHEYrbWR2XKfRSy0Mf6f77T6P_9RhBLBqwn09k9AkcB0h03pyJiKxCfXRCVUDbvvTl7vJHbZO2ozTgunqbJ88p3uY1ytfhTDf_41PysxSmz_Q", 
   "ArchiveSHA256TreeHash":"34bbe1a578aa9a7ce3ada96e6e291821bd34b1fee403e3653a32d0a4ab0c7194", 
   "ArchiveSizeInBytes":1100754352, 
   "Completed":true, 
   "CompletionDate":"2013-03-12T22:17:29.692Z", 
   "CreationDate":"2013-03-12T18:17:13.938Z", 
   "InventorySizeInBytes":null, 
   "JobDescription":null, 
   "JobId":"uwa_RxWK39KIY0UGfgL38OWxQw234I8Gpre93LgW8VAl93Ts6VffRZyMbzZqjIh3GqqkiArv9oAXBRNXuUFfFko8bdcF", 
   "RetrievalByteRange":"0-1100754351", 
   "SHA256TreeHash":"34bbe1a578aa9a7ce3ada96e6e291821bd34b1fee403e3653a32d0a4ab0c7194", 
   "SNSTopic":null, 
   "StatusCode":"Succeeded", 
   "StatusMessage":"Succeeded", 
   "VaultARN":"..."
}

您可以将该JobId字段传递给GetJobOutput请求以下载存档的内容。该值可以InitiateJob通过标头与原始响应相关联x-amz-job-id

于 2013-03-18T16:58:54.990 回答