Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adds the possibilty to initiate an invetory retrieval job.

  • Loading branch information...
commit 6c4de47e2facf7a88cd31b9b372eac4836ca0c4b 1 parent 89355e4
Miguel Olivares authored
Showing with 14 additions and 2 deletions.
  1. +14 −2 bin/glacier
16 bin/glacier
View
@@ -64,7 +64,10 @@ glacier <command> [args]
Vaults operations:
List vaults:
- glacier vaults
+ glacier vaults
+
+ List files of a particular vault (This create a job is not instant):
+ glacier vaults inventory <vault name>
Jobs operations:
@@ -96,6 +99,12 @@ def list_vaults(region, access_key=None, secret_key=None):
print vault.arn
+def vault_inventory(vault_name, region, access_key=None, secret_key=None):
+ layer2 = connect(region, access_key, secret_key)
+ vault = layer2.get_vault(vault_name)
+ print 'Job Id: %s' % vault.retrieve_inventory()
+
+
def list_jobs(vault_name, region, access_key=None, secret_key=None):
layer2 = connect(region, access_key, secret_key)
print layer2.layer1.list_jobs(vault_name)
@@ -139,7 +148,10 @@ def main():
region = value
# handle each command
if command == 'vaults':
- list_vaults(region, access_key, secret_key)
+ if len(args) == 0:
+ list_vaults(region, access_key, secret_key)
+ elif args[0] == 'inventory' and len(args) == 2:
+ vault_inventory(args[1], region, access_key, secret_key)
elif command == 'jobs':
if len(args) != 1:
usage()
Please sign in to comment.
Something went wrong with that request. Please try again.