NAME

AnyEvent::Net::Amazon::S3::Client::Bucket - An easy-to-use Amazon S3 client bucket

VERSION

version v0.02.0.58

SYNOPSIS

# return the bucket name
print $bucket->name . "\n";

# return the bucket location constraint
print "Bucket is in the " . $bucket->location_constraint . "\n";

# return the ACL XML
my $acl = $bucket->acl;

# list objects in the bucket
# this returns a L<Data::Stream::Bulk> object which returns a
# stream of L<AnyEvent::Net::Amazon::S3::Client::Object> objects, as it may
# have to issue multiple API requests
my $stream = $bucket->list;
until ( $stream->is_done ) {
  foreach my $object ( $stream->items ) {
    ...
  }
}

# or list by a prefix
my $prefix_stream = $bucket->list( { prefix => 'logs/' } );

# returns a L<AnyEvent::Net::Amazon::S3::Client::Object>, which can then
# be used to get or put
my $object = $bucket->object( key => 'this is the key' );

# delete the bucket (it must be empty)
$bucket->delete;

DESCRIPTION

This module represents buckets.

This module provides the same interface as Net::Amazon::S3::Client::Bucket. In addition, some asynchronous methods returning AnyEvent condition variable are added.

METHODS

All Net::Amazon::S3::Client::Bucket methods are available. In addition, there are the following asynchronous methods. Arguments of the methods are identical as original but return value becomes AnyEvent condition variable. You can get actual return value by calling shift->recv().

acl_async
delete_async
list_async
location_constraint_async
delete_multi_object_async

list

In addition to described in Net::Amazon::S3::Client::Bucket, max_keys and marker options can be accepted.

AUTHOR

Yasutaka ATARASHI <yakex@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Yasutaka ATARASHI.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.