![]() |
![]()
| ![]() |
![]()
NAMENet::Mosso::CloudFiles::Container - Represent a Cloud Files container DESCRIPTIONThis class represents a container in Cloud Files. It is created by calling new_container or container on a Net::Mosso::CloudFiles object. METHODSnameReturns the name of the container: say 'have container ' . $container->name; object_countReturns the total number of objects in the container: my $object_count = $container->object_count; bytes_usedReturns the total number of bytes used by objects in the container: my $bytes_used = $container->bytes_used; objectsReturns a list of objects in the container as Net::Mosso::CloudFiles::Object objects. As the API only returns ten thousand objects per request, this module may have to do multiple requests to fetch all the objects in the container. This is exposed by using a Data::Stream::Bulk object. You can also pass in a prefix: foreach my $object ($container->objects->all) { ... } my @objects = $container->objects(prefix => 'dir/')->all; objectThis returns a <Net::Mosso::CloudFiles::Object> representing an object. my $xxx = $container->object( name => 'XXX' ); my $yyy = $container->object( name => 'YYY', content_type => 'text/plain' ); deleteDeletes the container, which should be empty: $container->delete; SEE ALSONet::Mosso::CloudFiles, Net::Mosso::CloudFiles::Object. AUTHORLeon Brocard <acme@astray.com>. COPYRIGHTCopyright (C) 2008-9, Leon Brocard LICENSEThis module is free software; you can redistribute it or modify it under the same terms as Perl itself.
|