.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Net::Amazon::S3 3pm" .TH Net::Amazon::S3 3pm "2022-07-18" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Net::Amazon::S3 \- Use the Amazon S3 \- Simple Storage Service .SH "VERSION" .IX Header "VERSION" version 0.991 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 5 \& use Net::Amazon::S3; \& use Net::Amazon::S3::Authorization::Basic; \& use Net::Amazon::S3::Authorization::IAM; \& my $aws_access_key_id = \*(Aqfill me in\*(Aq; \& my $aws_secret_access_key = \*(Aqfill me in too\*(Aq; \& \& my $s3 = Net::Amazon::S3\->new ( \& authorization_context => Net::Amazon::S3::Authorization::Basic\->new ( \& aws_access_key_id => $aws_access_key_id, \& aws_secret_access_key => $aws_secret_access_key, \& ), \& retry => 1, \& ); \& \& # or use an IAM role. \& my $s3 = Net::Amazon::S3\->new ( \& authorization_context => Net::Amazon::S3::Authorization::IAM\->new ( \& aws_access_key_id => $aws_access_key_id, \& aws_secret_access_key => $aws_secret_access_key, \& ), \& retry => 1, \& ); \& \& # a bucket is a globally\-unique directory \& # list all buckets that i own \& my $response = $s3\->buckets; \& foreach my $bucket ( @{ $response\->{buckets} } ) { \& print "You have a bucket: " . $bucket\->bucket . "\en"; \& } \& \& # create a new bucket \& my $bucketname = \*(Aqacmes_photo_backups\*(Aq; \& my $bucket = $s3\->add_bucket( { bucket => $bucketname } ) \& or die $s3\->err . ": " . $s3\->errstr; \& \& # or use an existing bucket \& $bucket = $s3\->bucket($bucketname); \& \& # store a file in the bucket \& $bucket\->add_key_filename( \*(Aq1.JPG\*(Aq, \*(AqDSC06256.JPG\*(Aq, \& { content_type => \*(Aqimage/jpeg\*(Aq, }, \& ) or die $s3\->err . ": " . $s3\->errstr; \& \& # store a value in the bucket \& $bucket\->add_key( \*(Aqreminder.txt\*(Aq, \*(Aqthis is where my photos are backed up\*(Aq ) \& or die $s3\->err . ": " . $s3\->errstr; \& \& # list files in the bucket \& $response = $bucket\->list_all \& or die $s3\->err . ": " . $s3\->errstr; \& foreach my $key ( @{ $response\->{keys} } ) { \& my $key_name = $key\->{key}; \& my $key_size = $key\->{size}; \& print "Bucket contains key \*(Aq$key_name\*(Aq of size $key_size\en"; \& } \& \& # fetch file from the bucket \& $response = $bucket\->get_key_filename( \*(Aq1.JPG\*(Aq, \*(AqGET\*(Aq, \*(Aqbackup.jpg\*(Aq ) \& or die $s3\->err . ": " . $s3\->errstr; \& \& # fetch value from the bucket \& $response = $bucket\->get_key(\*(Aqreminder.txt\*(Aq) \& or die $s3\->err . ": " . $s3\->errstr; \& print "reminder.txt:\en"; \& print " content length: " . $response\->{content_length} . "\en"; \& print " content type: " . $response\->{content_type} . "\en"; \& print " etag: " . $response\->{content_type} . "\en"; \& print " content: " . $response\->{value} . "\en"; \& \& # delete keys \& $bucket\->delete_key(\*(Aqreminder.txt\*(Aq) or die $s3\->err . ": " . $s3\->errstr; \& $bucket\->delete_key(\*(Aq1.JPG\*(Aq) or die $s3\->err . ": " . $s3\->errstr; \& \& # and finally delete the bucket \& $bucket\->delete_bucket or die $s3\->err . ": " . $s3\->errstr; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides a Perlish interface to Amazon S3. From the developer blurb: \*(L"Amazon S3 is storage for the Internet. It is designed to make web-scale computing easier for developers. Amazon S3 provides a simple web services interface that can be used to store and retrieve any amount of data, at any time, from anywhere on the web. It gives any developer access to the same highly scalable, reliable, fast, inexpensive data storage infrastructure that Amazon uses to run its own global network of web sites. The service aims to maximize benefits of scale and to pass those benefits on to developers\*(R". .PP To find out more about S3, please visit: http://s3.amazonaws.com/ .PP To use this module you will need to sign up to Amazon Web Services and provide an \*(L"Access Key \s-1ID\*(R"\s0 and \*(L" Secret Access Key\*(R". If you use this module, you will incurr costs as specified by Amazon. Please check the costs. If you use this module with your Access Key \s-1ID\s0 and Secret Access Key you must be responsible for these costs. .PP I highly recommend reading all about S3, but in a nutshell data is stored in values. Values are referenced by keys, and keys are stored in buckets. Bucket names are global. .PP Note: This is the legacy interface, please check out Net::Amazon::S3::Client instead. .PP Development of this code happens here: https://github.com/rustyconover/net\-amazon\-s3 .SS "Bucket names with dots, \s-1HTTPS,\s0 and Signature V4" .IX Subsection "Bucket names with dots, HTTPS, and Signature V4" At the moment Amazon S3 doesn't play well with \s-1HTTPS\s0 and virtual bucket hosts if bucket name contains dots. .PP Due the current implementation of Signature V4 handling you should use workaround consisting of usage of region hostnames .PP .Vb 1 \& my $bucket_region = $global_s3\->bucket ($bucket)\->_head_region; \& \& my $region_s3 = Net::Amazon:S3\->new ( \& ..., \& vendor => Net::Amazon::S3::Vendor::Amazon\->new ( \& host => "s3\-$bucket_region.amazonaws.com", \& use_virtual_host => 0, \& ), \& ); \& \& my $bucket = $region_s3\->bucket ($bucket); .Ve .PP And use bucket instance / region s3 connection. .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" Create a new S3 client object. Takes some arguments: .IP "authorization_context" 4 .IX Item "authorization_context" Class that provides authorization information. .Sp See one of available implementations for more .RS 4 .IP "Net::Amazon::S3::Authorization::Basic" 4 .IX Item "Net::Amazon::S3::Authorization::Basic" .PD 0 .IP "Net::Amazon::S3::Authorization::IAM" 4 .IX Item "Net::Amazon::S3::Authorization::IAM" .RE .RS 4 .RE .IP "vendor" 4 .IX Item "vendor" .PD Instance of Net::Amazon::S3::Vendor holding vendor specific deviations. .Sp S3 became widely used object storage protocol with many vendors providing different feature sets and different compatibility level. .Sp One common difference is bucket's \s-1HEAD\s0 request to determine its region. .Sp To maintain currently known differences along with any differencies that may rise in feature it's better to hold vendor specification in dedicated classes. This also allows users to build their own fine-tuned vendor classes. .RS 4 .IP "Net::Amazon::S3::Vendor::Amazon" 4 .IX Item "Net::Amazon::S3::Vendor::Amazon" .PD 0 .IP "Net::Amazon::S3::Vendor::Generic" 4 .IX Item "Net::Amazon::S3::Vendor::Generic" .RE .RS 4 .RE .IP "aws_access_key_id" 4 .IX Item "aws_access_key_id" .PD Deprecated. .Sp When used it's used to create authorization context. .Sp Use your Access Key \s-1ID\s0 as the value of the AWSAccessKeyId parameter in requests you send to Amazon Web Services (when required). Your Access Key \s-1ID\s0 identifies you as the party responsible for the request. .IP "aws_secret_access_key" 4 .IX Item "aws_secret_access_key" Deprecated. .Sp When used it's used to create authorization context. .Sp Since your Access Key \s-1ID\s0 is not encrypted in requests to \s-1AWS,\s0 it could be discovered and used by anyone. Services that are not free require you to provide additional information, a request signature, to verify that a request containing your unique Access Key \s-1ID\s0 could only have come from you. .Sp \&\s-1DO NOT INCLUDE THIS IN SCRIPTS OR APPLICATIONS YOU DISTRIBUTE. YOU\s0'\s-1LL BE SORRY\s0 .IP "aws_session_token" 4 .IX Item "aws_session_token" Deprecated. .Sp When used it's used to create authorization context. .Sp If you are using temporary credentials provided by the \s-1AWS\s0 Security Token Service, set the token here, and it will be added to the request in order to authenticate it. .IP "use_iam_role" 4 .IX Item "use_iam_role" Deprecated. .Sp When used it's used to create authorization context. .Sp If you'd like to use \s-1IAM\s0 provided temporary credentials, pass this option with a true value. .IP "secure" 4 .IX Item "secure" Deprecated. .Sp Set this to \f(CW0\fR if you don't want to use SSL-encrypted connections when talking to S3. Defaults to \f(CW1\fR. .Sp To use SSL-encrypted connections, LWP::Protocol::https is required. .Sp See #vendor and Net::Amazon::S3::Vendor. .IP "keep_alive_cache_size" 4 .IX Item "keep_alive_cache_size" Set this to \f(CW0\fR to disable Keep-Alives. Default is \f(CW10\fR. .IP "timeout" 4 .IX Item "timeout" How many seconds should your script wait before bailing on a request to S3? Defaults to 30. .IP "retry" 4 .IX Item "retry" If this library should retry upon errors. This option is recommended. This uses exponential backoff with retries after 1, 2, 4, 8, 16, 32 seconds, as recommended by Amazon. Defaults to off. .Sp When retry is on, request will be automatically retried when one of following \&\s-1HTTP\s0 statuses happens .RS 4 .IP "408 \- Request Timeout" 4 .IX Item "408 - Request Timeout" .PD 0 .IP "500 \- Internal Server Error" 4 .IX Item "500 - Internal Server Error" .IP "502 \- Bad Gateway" 4 .IX Item "502 - Bad Gateway" .IP "503 \- Service Unavailable" 4 .IX Item "503 - Service Unavailable" .IP "504 \- Gateway Timeout" 4 .IX Item "504 - Gateway Timeout" .RE .RS 4 .PD .Sp For more details see LWP::UserAgent::Determined. .RE .IP "host" 4 .IX Item "host" Deprecated. .Sp The S3 host endpoint to use. Defaults to 's3.amazonaws.com'. This allows you to connect to any S3\-compatible host. .Sp See #vendor and Net::Amazon::S3::Vendor. .IP "use_virtual_host" 4 .IX Item "use_virtual_host" Deprecated. .Sp Use the virtual host method ('bucketname.s3.amazonaws.com') instead of specifying the bucket at the first part of the path. This is particularly useful if you want to access buckets not located in the US-Standard region (such as \s-1EU,\s0 Asia Pacific or South America). See for the pros and cons. .Sp See #vendor and Net::Amazon::S3::Vendor. .IP "authorization_method" 4 .IX Item "authorization_method" Deprecated. .Sp Authorization implementation package name. .Sp This library provides Net::Amazon::S3::Signature::V2 and Net::Amazon::S3::Signature::V4 .Sp Default is Signature 4 if host is \f(CW\*(C`s3.amazonaws.com\*(C'\fR, Signature 2 otherwise .Sp See #vendor and Net::Amazon::S3::Vendor. .IP "error_handler_class" 4 .IX Item "error_handler_class" Error handler class name (package name), see Net::Amazon::S3::Error::Handler for more. .Sp Default: Net::Amazon::S3::Error::Handler::Legacy .IP "error_handler" 4 .IX Item "error_handler" Instance of error handler class. .PP \fINotes\fR .IX Subsection "Notes" .PP When using Net::Amazon::S3 in child processes using fork (such as in combination with the excellent Parallel::ForkManager) you should create the S3 object in each child, use a fresh LWP::UserAgent in each child, or disable the LWP::ConnCache in the parent: .PP .Vb 2 \& $s3\->ua( LWP::UserAgent\->new( \& keep_alive => 0, requests_redirectable => [qw\*(AqGET HEAD DELETE PUT POST\*(Aq] ); .Ve .SS "buckets" .IX Subsection "buckets" Returns undef on error, else hashref of results .SS "add_bucket" .IX Subsection "add_bucket" .Vb 2 \& # Create new bucket with default location \& my $bucket = $s3\->add_bucket (\*(Aqnew\-bucket\*(Aq); \& \& # Create new bucket in another location \& my $bucket = $s3\->add_bucket (\*(Aqnew\-bucket\*(Aq, location_constraint => \*(Aqeu\-west\-1\*(Aq); \& my $bucket = $s3\->add_bucket (\*(Aqnew\-bucket\*(Aq, { location_constraint => \*(Aqeu\-west\-1\*(Aq }); \& my $bucket = $s3\->add_bucket (bucket => \*(Aqnew\-bucket\*(Aq, location_constraint => \*(Aqeu\-west\-1\*(Aq); \& my $bucket = $s3\->add_bucket ({ bucket => \*(Aqnew\-bucket\*(Aq, location_constraint => \*(Aqeu\-west\-1\*(Aq }); .Ve .PP Method creates and returns new bucket. .PP In case of error it reports it and returns \f(CW\*(C`undef\*(C'\fR (refer \*(L"\s-1ERROR HANDLING\*(R"\s0). .PP Recognized positional arguments (refer \*(L"\s-1CALLING CONVENTION\*(R"\s0) .IP "bucket" 4 .IX Item "bucket" Required, recognized as positional. .Sp The name of the bucket you want to add. .PP Recognized optional arguments .IP "acl" 4 .IX Item "acl" .Vb 3 \& acl => \*(Aqprivate\*(Aq \& acl => Net::Amazon::S3::ACL::Canned\->PRIVATE \& acl => Net::Amazon::S3::ACL::Set\->grant_read (email => \*(Aqfoo@bar.baz\*(Aq) .Ve .Sp \&\fIAvailable since v0.94\fR .Sp Set \s-1ACL\s0 to the newly created bucket. Refer Net::Amazon::S3::ACL for possibilities. .IP "acl_short (deprecated)" 4 .IX Item "acl_short (deprecated)" \&\fIDeprecated since v0.94\fR .Sp When specified its value is used to populate \f(CW\*(C`acl\*(C'\fR argument (unless it exists). .IP "location_constraint" 4 .IX Item "location_constraint" Optional. .Sp Sets the location constraint of the new bucket. If left unspecified, the default S3 datacenter location will be used. .Sp This library recognizes regions according Amazon S3 documentation .RS 4 .IP "→" 4 .IP "→" 4 .RE .RS 4 .RE .PP Provides operation CreateBucket . .SS "bucket \s-1BUCKET\s0" .IX Subsection "bucket BUCKET" .Vb 4 \& # build bucket with guessed region \& $s3\->bucket (\*(Aqfoo\*(Aq); \& $s3\->bucket (bucket => \*(Aqfoo\*(Aq); \& $s3\->bucket (name => \*(Aqfoo\*(Aq); \& \& # build with explicit region \& $s3\->bucket (\*(Aqfoo\*(Aq, region => \*(Aqbar\*(Aq); .Ve .PP Returns an (unverified) bucket object from an account. Does no network access. .PP However, when guessing region, \f(CW\*(C`HeadRegion\*(C'\fR operation may be called before first network access. .PP Region is mandatory when using Signature V4 authorization, which is default for \s-1AWS. AWS\s0 limits number of \s-1HTTP\s0 requests, see .SS "delete_bucket" .IX Subsection "delete_bucket" .Vb 2 \& $s3\->delete_bucket ($bucket); \& $s3\->delete_bucket (bucket => $bucket); .Ve .PP Deletes bucket from account. .PP Returns \f(CW\*(C`true\*(C'\fR if the bucket is successfully deleted. .PP Returns \f(CW\*(C`false\*(C'\fR and reports an error otherwise (refer \*(L"\s-1ERROR HANDLING\*(R"\s0) .PP Positional arguments (refer \*(L"\s-1CALLING CONVENTION\*(R"\s0) .IP "bucket" 4 .IX Item "bucket" Required. .Sp The name of the bucket or Net::Amazon::S3::Bucket instance you want to delete. .PP Provides operation \*(L"DeleteBucket\*(R" .SS "list_bucket" .IX Subsection "list_bucket" List all keys in this bucket. .PP Takes a hashref of arguments: .PP \&\s-1MANDATORY\s0 .IP "bucket" 4 .IX Item "bucket" The name of the bucket you want to list keys on .PP \&\s-1OPTIONAL\s0 .IP "prefix" 4 .IX Item "prefix" Restricts the response to only contain results that begin with the specified prefix. If you omit this optional argument, the value of prefix for your query will be the empty string. In other words, the results will be not be restricted by prefix. .IP "delimiter" 4 .IX Item "delimiter" If this optional, Unicode string parameter is included with your request, then keys that contain the same string between the prefix and the first occurrence of the delimiter will be rolled up into a single result element in the CommonPrefixes collection. These rolled-up keys are not returned elsewhere in the response. For example, with prefix=\*(L"\s-1USA/\*(R"\s0 and delimiter=\*(L"/\*(R", the matching keys \&\*(L"USA/Oregon/Salem\*(R" and \*(L"USA/Oregon/Portland\*(R" would be summarized in the response as a single \*(L"USA/Oregon\*(R" element in the CommonPrefixes collection. If an otherwise matching key does not contain the delimiter after the prefix, it appears in the Contents collection. .Sp Each element in the CommonPrefixes collection counts as one against the MaxKeys limit. The rolled-up keys represented by each CommonPrefixes element do not. If the Delimiter parameter is not present in your request, keys in the result set will not be rolled-up and neither the CommonPrefixes collection nor the NextMarker element will be present in the response. .IP "max-keys" 4 .IX Item "max-keys" This optional argument limits the number of results returned in response to your query. Amazon S3 will return no more than this number of results, but possibly less. Even if max-keys is not specified, Amazon S3 will limit the number of results in the response. Check the IsTruncated flag to see if your results are incomplete. If so, use the Marker parameter to request the next page of results. For the purpose of counting max-keys, a 'result' is either a key in the 'Contents' collection, or a delimited prefix in the \&'CommonPrefixes' collection. So for delimiter requests, max-keys limits the total number of list results, not just the number of keys. .IP "marker" 4 .IX Item "marker" This optional parameter enables pagination of large result sets. \&\f(CW\*(C`marker\*(C'\fR specifies where in the result set to resume listing. It restricts the response to only contain results that occur alphabetically after the value of marker. To retrieve the next page of results, use the last key from the current page of results as the marker in your next request. .Sp See also \f(CW\*(C`next_marker\*(C'\fR, below. .Sp If \f(CW\*(C`marker\*(C'\fR is omitted,the first page of results is returned. .PP Returns undef on error and a hashref of data on success: .PP The hashref looks like this: .PP .Vb 10 \& { \& bucket => $bucket_name, \& prefix => $bucket_prefix, \& common_prefixes => [$prefix1,$prefix2,...] \& marker => $bucket_marker, \& next_marker => $bucket_next_available_marker, \& max_keys => $bucket_max_keys, \& is_truncated => $bucket_is_truncated_boolean \& keys => [$key1,$key2,...] \& } .Ve .PP Explanation of bits of that: .IP "common_prefixes" 4 .IX Item "common_prefixes" If list_bucket was requested with a delimiter, common_prefixes will contain a list of prefixes matching that delimiter. Drill down into these prefixes by making another request with the prefix parameter. .IP "is_truncated" 4 .IX Item "is_truncated" B flag that indicates whether or not all results of your query were returned in this response. If your results were truncated, you can make a follow-up paginated request using the Marker parameter to retrieve the rest of the results. .IP "next_marker" 4 .IX Item "next_marker" A convenience element, useful when paginating with delimiters. The value of \f(CW\*(C`next_marker\*(C'\fR, if present, is the largest (alphabetically) of all key names and all CommonPrefixes prefixes in the response. If the \f(CW\*(C`is_truncated\*(C'\fR flag is set, request the next page of results by setting \f(CW\*(C`marker\*(C'\fR to the value of \f(CW\*(C`next_marker\*(C'\fR. This element is only present in the response if the \f(CW\*(C`delimiter\*(C'\fR parameter was sent with the request. .PP Each key is a hashref that looks like this: .PP .Vb 9 \& { \& key => $key, \& last_modified => $last_mod_date, \& etag => $etag, # An MD5 sum of the stored content. \& size => $size, # Bytes \& storage_class => $storage_class # Doc? \& owner_id => $owner_id, \& owner_displayname => $owner_name \& } .Ve .SS "list_bucket_all" .IX Subsection "list_bucket_all" List all keys in this bucket without having to worry about \&'marker'. This is a convenience method, but may make multiple requests to S3 under the hood. .PP Takes the same arguments as list_bucket. .SS "_perform_operation" .IX Subsection "_perform_operation" .Vb 3 \& my $response = $s3\->_perform_operation (\*(AqOperation\*(Aq => ( \& # ... operation request parameters \& )); .Ve .PP Internal operation implementation method, takes request construction parameters, performs necessary \s-1HTTP\s0 requests(s) and returns Response instance. .PP Method takes same named parameters as realted Request class. .PP Method provides available contextual parameters by default (eg s3, bucket) .PP Method invokes contextual error handler. .SH "CALLING CONVENTION" .IX Header "CALLING CONVENTION" \&\fIAvailable since v0.97\fR \- calling convention extentend .PP In order to make method calls somehow consistent, backward compatible, and extendable, \s-1API\s0's methods support multiple ways how to provide their arguments .IP "plain named arguments (preferred)" 4 .IX Item "plain named arguments (preferred)" .Vb 1 \& method (named => \*(Aqargument\*(Aq, another => \*(Aqargument\*(Aq); .Ve .IP "trailing configuration hash" 4 .IX Item "trailing configuration hash" .Vb 2 \& method ({ named => \*(Aqargument\*(Aq, another => \*(Aqargument\*(Aq }); \& method (positional, { named => \*(Aqargument\*(Aq, another => \*(Aqargument\*(Aq } ); .Ve .Sp Last argument of every method can be configuration hash, treated as additional named arguments. Can be combined with named arguments. .IP "positional arguments with optional named arguments" 4 .IX Item "positional arguments with optional named arguments" .Vb 2 \& method (positional, named => \*(Aqargument\*(Aq, another => \*(Aqargument\*(Aq); \& method (positional, { named => \*(Aqargument\*(Aq, another => \*(Aqargument\*(Aq } ); .Ve .Sp For methods supporting mandatory positional arguments additional named arguments and/or configuration hash is supported. .Sp Named arguments or configuration hash can specify value of positional arguments as well removing it from list of required positional arguments for given call (see example) .Sp .Vb 3 \& $s3\->bucket\->add_key (\*(Aqkey\*(Aq, \*(Aqvalue\*(Aq, acl => $acl); \& $s3\->bucket\->add_key (\*(Aqvalue\*(Aq, key => \*(Aqkey\*(Aq, acl => $acl); \& $s3\->bucket\->add_key (key => \*(Aqkey\*(Aq, value => \*(Aqvalue\*(Aq, acl => $acl); .Ve .SH "ERROR HANDLING" .IX Header "ERROR HANDLING" Net::Amazon::S3 supports pluggable error handling via Net::Amazon::S3::Error::Handler. .PP When response ends up with an error, every method reports it, and in case it receives control back (no exception), it returns \f(CW\*(C`undef\*(C'\fR. .PP Default error handling for Net::Amazon::S3 is Net::Amazon::S3::Error::Handler::Legacy which (mostly) sets \f(CW\*(C`err\*(C'\fR and \f(CW\*(C`errstr\*(C'\fR. .SH "LICENSE" .IX Header "LICENSE" This module contains code modified from Amazon that contains the following notice: .PP .Vb 8 \& # This software code is made available "AS IS" without warranties of any \& # kind. You may copy, display, modify and redistribute the software \& # code either by itself or as incorporated into your code; provided that \& # you do not remove any proprietary notices. Your use of this software \& # code is at your own risk and you waive any claim against Amazon \& # Digital Services, Inc. or its affiliates with respect to your use of \& # this software code. (c) 2006 Amazon Digital Services, Inc. or its \& # affiliates. .Ve .SH "TESTING" .IX Header "TESTING" Testing S3 is a tricky thing. Amazon wants to charge you a bit of money each time you use their service. And yes, testing counts as using. Because of this, the application's test suite skips anything approaching a real test unless you set these three environment variables: .IP "\s-1AMAZON_S3_EXPENSIVE_TESTS\s0" 4 .IX Item "AMAZON_S3_EXPENSIVE_TESTS" Doesn't matter what you set it to. Just has to be set .IP "\s-1AWS_ACCESS_KEY_ID\s0" 4 .IX Item "AWS_ACCESS_KEY_ID" Your \s-1AWS\s0 access key .IP "\s-1AWS_ACCESS_KEY_SECRET\s0" 4 .IX Item "AWS_ACCESS_KEY_SECRET" Your \s-1AWS\s0 sekkr1t passkey. Be forewarned that setting this environment variable on a shared system might leak that information to another user. Be careful. .SH "AUTHOR" .IX Header "AUTHOR" Leon Brocard and unknown Amazon Digital Services programmers. .PP Brad Fitzpatrick \- return values, Bucket object .PP Pedro Figueiredo \- since 0.54 .PP Branislav Zahradník \- since v0.81 .SH "SEE ALSO" .IX Header "SEE ALSO" Net::Amazon::S3::Bucket .SH "AUTHOR" .IX Header "AUTHOR" Branislav Zahradník .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2022 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.