Yasutaka ATARASHI (新 康孝) > AnyEvent-Net-Amazon-S3-v0.01.0.57 > AnyEvent::Net::Amazon::S3::Client::Bucket

Download:
AnyEvent-Net-Amazon-S3-v0.01.0.57.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: v0.01.0.57   Source   Latest Release: AnyEvent-Net-Amazon-S3-v0.03.0.60

NAME ^

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

VERSION ^

version v0.01.0.57

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

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.

syntax highlighting: