{"id":1286,"date":"2015-12-02T14:27:57","date_gmt":"2015-12-02T19:27:57","guid":{"rendered":"http:\/\/osric.com\/chris\/accidental-developer\/?p=1286"},"modified":"2024-02-04T13:12:46","modified_gmt":"2024-02-04T18:12:46","slug":"error-retrieving-glacier-vault-inventory-via-aws-cli-unknown-options-inventory-retrieval","status":"publish","type":"post","link":"https:\/\/osric.com\/chris\/accidental-developer\/2015\/12\/error-retrieving-glacier-vault-inventory-via-aws-cli-unknown-options-inventory-retrieval\/","title":{"rendered":"Error retrieving Glacier vault inventory via AWS CLI: Unknown options: inventory-retrieval}&#8217;"},"content":{"rendered":"<p>Amazon&#8217;s Glacier service is great, but low-cost storage has other costs. For example, you might have a vault but not know what archives it contains. You can retrieve the vault inventory&#8211;essentially listing the contents of a directory&#8211;but like any Glacier retrieval, it may take several hours.<\/p>\n<p>Using <a href=\"http:\/\/docs.aws.amazon.com\/amazonglacier\/latest\/dev\/retrieving-vault-inventory-rest-api.html\">Downloading Vault Inventory using the REST API<\/a>, I put this together:<br \/>\n<code>C:\\&gt;aws glacier initiate-job --account-id - --vault-name my_poorly_named_vault --job-parameters '{\"Type\": \"inventory-retrieval\"}'<\/code><\/p>\n<p>Which returned:<\/p>\n<p><code>Unknown options: inventory-retrieval}'<\/code><\/p>\n<p>I had taken the command directly from AWS&#8217;s example:<br \/>\n<a href=\"http:\/\/docs.aws.amazon.com\/cli\/latest\/reference\/glacier\/initiate-job.html\">http:\/\/docs.aws.amazon.com\/cli\/latest\/reference\/glacier\/initiate-job.html<\/a>.<\/p>\n<p>(Keep in mind that I had already followed the steps at <a href=\"http:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/installing.html\">Installing the Amazon Web Services Command Line Interface<\/a> and <a href=\"http:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/cli-chap-getting-started.html\">Configuring the Amazon Web Services Command Line Interface<\/a>.)<\/p>\n<p>According to the documentation for the <code>job-parameters<\/code> option (http:\/\/docs.aws.amazon.com\/sdkforruby\/api\/Aws\/Glacier\/Types\/JobParameters.html#type-instance_method),<br \/>\nvalid values are &#8220;archive-retrieval&#8221; and &#8220;inventory-retrieval&#8221;.<\/p>\n<p>But the error message says inventory-retrieval<strong>}&#8217;<\/strong>. Why is it picking up the trailing curly brace and the apostrophe?<\/p>\n<p>I formatted the job-parameters JSON in a file named aws-json.txt, with the curly braces on separate lines:<\/p>\n<pre>{\r\n    \"Type\": \"inventory-retrieval\"\r\n}<\/pre>\n<p>I tried this variation on the <code>initiate-job<\/code> command:<br \/>\n<code>C:\\&gt;aws glacier initiate-job --account-id - --vault-name my_poorly_named_vault --job-parameters file:\/\/aws-json.txt<\/code><\/p>\n<p>That worked!<\/p>\n<p>The results returned:<\/p>\n<pre>{\r\n    \"jobId\": \"y8ugyoNzzusaf6Lv72G3hsjAA6O7nw5bJQ2u6J9TDnJ82_qx-lxnqrhSxIcGvOU1iiXoUhZboiojxsDu8gLQOfiJ7hR2\",\r\n    \"location\": \"\/123456789011\/vaults\/my_poorly_named_vault\/jobs\/y8ugyoNzzusaf6Lv72G3hsjAA6O7nw5bJQ2u6J9TDnJ82_qx-lxnqrhSxIcGvOU1iiXoUhZboiojxsDu8gLQOfiJ7hR2\"\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Amazon&#8217;s Glacier service is great, but low-cost storage has other costs. For example, you might have a vault but not know what archives it contains. You can retrieve the vault inventory&#8211;essentially listing the contents of a directory&#8211;but like any Glacier retrieval, it may take several hours. Using Downloading Vault Inventory using the REST API, I &hellip; <a href=\"https:\/\/osric.com\/chris\/accidental-developer\/2015\/12\/error-retrieving-glacier-vault-inventory-via-aws-cli-unknown-options-inventory-retrieval\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Error retrieving Glacier vault inventory via AWS CLI: Unknown options: inventory-retrieval}&#8217;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[575,1],"tags":[365,363,372,371],"class_list":["post-1286","post","type-post","status-publish","format-standard","hentry","category-aws","category-uncategorized","tag-amazon-web-services","tag-aws","tag-aws-cli","tag-glacier"],"_links":{"self":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/1286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/comments?post=1286"}],"version-history":[{"count":8,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/1286\/revisions"}],"predecessor-version":[{"id":1299,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/1286\/revisions\/1299"}],"wp:attachment":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/media?parent=1286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/categories?post=1286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/tags?post=1286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}