NAME
Amazon::S3::BucketV2 - lightweight interface to various S3 methods
SYNOPSIS
use Amazon::S3;
use Amazon::S3::BucketV2;
my $s3 = Amazon::S3->new(
{ aws_access_key_id => $aws_access_key_id,
aws_secret_access_key => $aws_secret_access_key,
}
);
my $s3 = Amazon::S3->new();
my $bucket = Amazon::S3::BucketV2->new(account => $s3, bucket => 'foo');
$bucket->DeleteObject($key);
$bucket->DeleteObjects(undef,
{ Delete => { Object => [ { Key => $key, Version => $version } ] } } );
DESCRIPTION
A lightweight, generic interface to the AWS S3 API. Amazon::S3::BucketV2 is a subclass of Amazon::S3::Bucket. In addition to the methods described below you can still use the convenience methods offered in the parent class.
Note that this is an experimental implementation and may change in the future.
The methods listed below should be called with a list (or hash reference) of key/value pairs. Depending on your needs and the API being invoked some of these keys may not be required.
- key
-
The key in the S3 bucket.
- body
-
The request body. This should be a hash ref which will be converted to an XML payload to be sent for the request.
You need to review the required payload for the API being invoked and provide the appropriate Perl object to be converted to XML.
To see how your Perl object will be serialized call the
create_xmlmethod.For example the DeleteObjects API takes a payload that looks like this:
<Delete xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Object> <Key>string</Key> <VersionId>string</VersionId> </Object> ... <Quiet>boolean</Quiet> </Delete>The corresponding Perl object would be created like this:
my $content = { Delete => { Object => [ { Key => '/foo', VersionId => 'OYcLXagmS.WaD..oyH4KRguB95_YhLs7' } ] } };...and to verify how that Perl object would be serialized as XML:
use Amazon::S3::Util qw(create_xml_request); my $content = { Delete => { Object => [ { Key => '/foo', VersionId => 'OYcLXagmS.WaD..oyH4KRguB95_YhLs7' } ] } }; print create_xml_request($content); - uri_params
-
A hash ref of additional query string parameters.
- headers
-
A hash ref of additional headers to send with the request. The API methods will automatically add the rquired headers for most calls. Review the API specifications to see how to send additional headers you might require.
Example:
$bucket->DeleteObject(key => $key);
$bucket->DeleteObject(key => $key, uri_param => { versionId => $version });
my $content
= { Delete => { Object => [ { Key => $key, Version => $version } ] } };
$bucket->DeleteObject(body => $content);
METHODS AND SUBROUTINES
The methods below can be called in snake or CamelCase. Consult the official AWS S3 API guide for documentation on each method.
https://docs.aws.amazon.com/AmazonS3/latest/API/Welcome.html
delete_bucket
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html
delete_bucket_analytics_configuration
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html
delete_bucket_cors
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html
delete_bucket_encryption
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html
delete_bucket_intelligent_tiering
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTiering.html
delete_bucket_inventory_configuration
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html
delete_bucket_lifecycle
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html
delete_bucket_metrics_configuration
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html
delete_bucket_ownership_controls
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketOwnershipControls.html
delete_bucket_policy
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketPolicy.html
delete_bucket_replication
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html
delete_bucket_tagging
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html
delete_bucket_website
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketWebsite.html
delete_object
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html
delete_objects
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html
delete_object_tagging
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html
delete_public_access_block
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html
get_bucket_accelerate_configuration
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAccelerateConfiguration.html
get_bucket_acl
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAcl.html
get_bucket_analytics
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalytics.html
get_bucket_cors
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketCors.html
get_bucket_encryption
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html
get_bucket_intelligent_tiering_configuration
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html
get_bucket_inventory_configuration
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html
get_bucket_lifecycle_configuration
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html
get_bucket_location
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLocation.html
get_bucket_logging
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLogging.html
get_bucket_metrics_configuration
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html
get_bucket_notification_configuration
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html
get_bucket_ownership_controls
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketOwnershipControls.html
get_bucket_policy
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicy.html
get_bucket_policy_status
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html
get_bucket_replication
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html
get_bucket_request_payment
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketRequestPayment.html
get_bucket_tagging
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html
get_bucket_versioning
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html
get_bucket_website
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketWebsite.html
get_object_acl
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html
get_object_attributes
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html
get_object_legal_hold
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLegalHold.html
get_object_lock_configuration
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLockConfiguration.html
get_object_retention
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectRetention.html
get_object_tagging
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html
get_object_torrent
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTorrent.html
get_public_access_block
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html
put_bucket_cors
https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html
put_bucket_encryption
https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html
put_bucket_intelligent_tiering_configuration
https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html
put_bucket_lifecycle
https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html
put_bucket_lifecycle_configuration
https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html
put_bucket_replication_configuration
https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplicationConfiguration.html
put_bucket_tagging
https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html
put_bucket_versioning
https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html
put_object
https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html
put_object_acl
https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectAcl.html
put_object_legal_hold
https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectLegalHold.html
put_object_lock_configuraiton
https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectLockConfiguraiton.html
put_object_retention
https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectRetention.html
put_object_tagging
https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html
put_public_access_block
https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html
restore_object
https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html
upload_part
https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html
upload_part_copy
https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html
SEE OTHER
Amazon::S3, Amazon::S3::Bucket
AUTHOR
Rob Lauer - <bigfoot@cpan.org>