2013-03-07 66 views
0

我有一個將zip文件存檔到Glacier的服務。我有一個簡單的通知服務設置,讓我知道何時完成取消歸檔的工作(「歸檔檢索」請求)。從一切我可以告訴響應將是一樣的GetJob()調用:亞馬遜冰川:如何將檔案檢索SNS響應與作業ID相關聯?

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.] 

source

因爲我需要能夠採取的應對並做處理處理目的(標記誰將文件解除存檔,將其內容放置在正確的位置等)。有沒有辦法將傳入的GetJob()響應與作業ID或類似的東西關聯起來?

謝謝,

扎克

回答

1

所述SNS消息的正文將包含從InitiateJob請求返回的作業ID。下面是一個示例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請求下載檔案的內容。該值可以通過x-amz-job-id標題與原始InitiateJob響應關聯。

+0

是的,我想出了後忘了更新我的文章。非常感謝你! – 2013-05-03 21:46:22