找不到aws冰川的工作ID

时间:2017-07-14 21:53:26

标签: amazon-web-services aws-cli amazon-glacier

我正在尝试查看我的aws冰川保险库中的文件。我正在使用亚马逊cli。我第一次做了

aws glacier list-jobs --account-id - --region ca-central-1 --vault-name gamesDB

并得到了结果

{
    "JobList": [{
        "CompletionDate": "2017-07-13T19:33:01.357Z",
        "JobId": "0_Yskg7YiAD8exUca58f2NMEC_hb7fsoy4arhpYBBkuMHqS__h10ol8_lPYCLc-Qoe1E8PXQso3HZ0usCaG6wzyPtRqb",
        "InventorySizeInBytes": 1123,
        "StatusCode": "Succeeded",
        "StatusMessage": "Succeeded",
        "VaultARN": "arn:aws:glacier:ca-central-1:710541751822:vaults/gamesDB",
        "InventoryRetrievalParameters": {
            "Format": "JSON"
        },
        "Action": "InventoryRetrieval",
        "Completed": true,
        "CreationDate": "2017-07-13T15:38:58.835Z"
    }]
}
然后我做了

aws glacier get-job-output --account-id - --vault-name gamesDB --job-id 0_Yskg7YiAD8exUca58f2NMEC_hb7fsoy4arhpYBBkuMHqS__h10ol8_lPYCLc-Qoe1E8PXQso3HZ0usCaG6wzyPtRqb output.json

得到了

  

调用GetJobOutput操作时发生错误(ResourceNotFoundException):找不到作业ID:0_Yskg7YiAD8exUca58f2NMEC_hb7fsoy4arhpYBBkuMHqS__h10ol8_lPYCLc-Qoe1E8PXQso3HZ0usCaG6wzyPtRqb

我认为CLI存在问题所以我使用其余的API再次尝试了这个问题并得到了同样的错误。 JobID完全相同,我不明白为什么会这样?

1 个答案:

答案 0 :(得分:0)

它对我来说很好。这就是我做的......

启动了一个库存工作:

aws glacier initiate-job --account-id - --vault-name videos --job-parameters '{"Type": "inventory-retrieval"}'

{
    "location": "/123456789012/vaults/videos/jobs/y-a0tzB94kwCuFFeEQhJaxj...HGDu", 
    "jobId": "y-a0tzB94kwCuFFeEQhJaxj...HGDu"
}

列出的工作(需要几个小时才能完成):

aws glacier list-jobs --vault-name videos --account-id -

{
    "JobList": [
        {
            "CompletionDate": "2017-07-17T02:26:51.215Z", 
            "VaultARN": "arn:aws:glacier:ap-southeast-2:123456789012:vaults/videos", 
            "InventoryRetrievalParameters": {
                "Format": "JSON"
            }, 
            "Completed": true, 
            "InventorySizeInBytes": 10096, 
            "JobId": "y-a0tzB94kwCuFFeEQhJaxj...HGDu", 
            "Action": "InventoryRetrieval", 
            "CreationDate": "2017-07-16T22:36:48.751Z", 
            "StatusMessage": "Succeeded", 
            "StatusCode": "Succeeded"
        }
    ]
}

检索作业输出:

aws glacier get-job-output --account-id - --vault-name videos --job-id y-a0tzB94kwCuFFeEQhJaxj...HGDu output.json
{
    "status": 200, 
    "acceptRanges": "bytes", 
    "contentType": "application/json"
}

我收到了包含我的保险库列表的JSON文件。

我的.aws/credentials文件已定义默认区域。