Created
October 15, 2012 22:57
-
-
Save srs81/3896192 to your computer and use it in GitHub Desktop.
Revisions
-
srs81 created this gist
Oct 15, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ # Author: Suman # Import boto's layer2 import boto.glacier.layer2 # Various variables for AWS creds, vault name, local file name awsAccess = "AKIAxxxx" awsSecret = "YouRSecRetKeY" vaultName = "YourVaultName" fileName = "LocalFileName" # Create a Layer2 object to connect to Glacier l = boto.glacier.layer2.Layer2(aws_access_key_id=awsAccess, aws_secret_access_key=awsSecret) # Get a vault based on vault name (assuming you created it already) v = l.get_vault(vaultName) # Create an archive from a local file on the vault archiveID = v.create_archive_from_file(fileName) # Delete the archive on the vault v.delete_archive(archiveID)