Amazon::S3Curl::PurePerl - Pure Perl s3 helper/downloader.
version 0.054
This software is designed to run in low dependency situations. You need curl, and you need perl ( If you are on linux, you probably have perl whether you know it or not ).
Maybe you're bootstrapping a system from s3, or downloading software to a host where you can't/don't want to install anything.
my $s3curl = Amazon::S3Curl::PurePerl->new({ aws_access_key => $ENV{AWS_ACCESS_KEY}, aws_secret_key => $ENV{AWS_SECRET_KEY}, local_file => "/tmp/myapp.tgz", url => "/mybootstrap-files/myapp.tgz" }); $s3curl->download;
Using Object::Remote:
use Object::Remote; my $conn = Object::Remote->connect("webserver-3"); my $s3_downloader = Amazon::S3Curl::PurePerl->new::on( $conn, { aws_access_key => $ENV{AWS_ACCESS_KEY}, aws_secret_key => $ENV{AWS_SECRET_KEY}, local_file => "/tmp/myapp.tgz", url => "/mybootstrap-files/myapp.tgz" } ); $s3_downloader->download;
This is the (url to download|upload to|delete). It should be a relative path with the bucket name, and whatever pseudopaths you want.
For upload: Left with a trailing slash, it'll DWYM, curl style.
This is the (path to download to|file to upload).
Constructor, provided by Moo.
$s3curl->download;
download url to local_file.
$s3curl->upload;
Upload local_file to url.
$s3curl->delete;
Delete url.
Just get the command to execute in the form of an arrayref, don't actually execute it:
my $cmd = $s3curl->download_cmd; system(@$cmd);
Check to see if a given url returns a 404 or 200. return 1 if 200, return 0 if 404, die otherwise.
This library is free software and may be distributed under the same terms as perl itself.
This distribution was adapted by Samuel Kaufman skaufman@cpan.org from the Amazon S3 Authentication Tool for Curl
Amazon S3 Authentication Tool for Curl Copyright 2006-2010 Amazon.com, Inc. or its affiliates. All Rights Reserved.
To install Amazon::S3Curl::PurePerl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Amazon::S3Curl::PurePerl
CPAN shell
perl -MCPAN -e shell install Amazon::S3Curl::PurePerl
For more information on module installation, please visit the detailed CPAN module installation guide.