找不到 aws glacier 作业 ID

aws glacier job ID was not found

我正在尝试查看我的 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

得到了

An error occurred (ResourceNotFoundException) when calling the GetJobOutput operation: The job ID was not found: 0_Yskg7YiAD8exUca58f2NMEC_hb7fsoy4arhpYBBkuMHqS__h10ol8_lPYCLc-Qoe1E8PXQso3HZ0usCaG6wzyPtRqb

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

对我来说效果很好。这是我所做的...

已启动库存作业:

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 文件定义了默认区域。