0
votes

I am trying to view the files in my aws glacier vault. I am using the amazon cli. I first did

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

and got this for the result

{
    "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"
    }]
}

then I did

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

and got

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

I thought there was a problem with the CLI so I tried this again using the rest API and got the same error. The JobID is the exact same I do not understand why this is happening?

1
I tried to format the json response properly but stackoverflow kept having a problem with it ..... so its all in one line now -_-the pickle
You're definitely sending the API/CLI requests to ca-central-1? I'm guessing you're implicitly sending it to another region since you didn't show that you specified a region. The Glacier regions are independent, not interconnected at all.Michael - sqlbot
hmm in my aws config there is "region = ca-central-1" and also i tried passing the region argument with ca-central-1. still doesnt work :(the pickle
Remove --account-id - or specify the actual account-id? It isn't clear what the problem might be.Michael - sqlbot
I replaced the dash in --account-id -, with my actual account id and it is still giving me the same error?the pickle

1 Answers

0
votes

It worked fine for me. Here's what I did...

Initiated an Inventory job:

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"
}

Listed jobs (it took a few hours to complete):

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"
        }
    ]
}

Retrieved job output:

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

I received a JSON file with my vault listing.

My .aws/credentials file has a default Region defined.