How to upload large archive to Amazon Glacier using ruby and aws-sdk? -
the amazon documentation glacier doesn't seem include ruby examples , documentation rather sparse.
i gather need instantiate glacier client object , use upload_multipart_part method access glacier api, not sure how massage arguments pass upload_multipart_part. how calculate checksums aws looking using ruby? , upload_id?
update
figured out of reading amazon's documentation. don't appear have code samples ruby, github repo of code examples not cover glacier. looking @ raw api documentation , java , php examples, looks i'd this:
client = aws::glacier::client.new(access_key_id: access_key_id, secret_access_key: secret_access_key) resp = client.initiate_multipart_upload(account_id: account_id, vault_name: 'my vault', archive_description: "backup of stuff", part_size: part_size_in_bytes)
and if goes well, amazon api response should include unique upload_id use in subsequent calls using client.upload_multipart_part().
i'm guessing checksums can calculated this:
digest::sha256.file(file_to_upload).hexdigest
update 2
seems has been solved:
for else interested, link helpful, pretty covers of need:
http://www.spacevatican.org/2012/9/4/using-glacier-with-fog/
it doesn't provide details on how instantiate glacier object:
glacier = fog::aws::glacier.new({ :aws_access_key_id => your_access_key_id, :aws_secret_access_key => your_secret_access_key })
Comments
Post a Comment