Net::Google::Storage - Access the Google Storage JSON API (currently experimental).
version 0.2.0
my $gs = Net::Google::Storage->new( projectId => $projectId, %agent_args );
See Net::Google::Storage::Agent for a decription of %agent_args.
%agent_args
my $buckets = $gs->list_buckets(); my $bucket = $gs->get_bucket($bucket_name); my $new_bucket = $gs->insert_bucket({id => $new_bucket_name}); $gs->delete_bucket($bucket_name); my $objects = $gs->list_objects($bucket_name); my $object = $gs->get_object(bucket => $bucket_name, object => $object_name); $gs->download_object(bucket => $bucket_name, object => $object_name, filename => $filename); my $object = $gs->insert_object(bucket => $bucket_name, object => {name => $object_name}, filename => $filename); $gs->delete_object(bucket => $bucket_name, object => $object_name);
Net::Google::Storage is a library for interacting with the JSON version of the Google Storage API, which is currently (as at 2012-09-17) marked as experimental.
This module does not (yet) cover the entire surface of the API, but it is a decent attempt at providing the most important functionality.
See https://developers.google.com/storage/docs/json_api/ for documentation of the API itself.
Google's identifier of the project you are accessing. Available from the API Console.
Constructs a shiny new Net::Google::Storage object. Arguments include projectId and the attributes of Net::Google::Storage::Agent
projectId
Returns an arrayref of Net::Google::Storage::Bucket objects for the current projectId.
Takes a bucket name as the only argument, returns the matching Net::Google::Storage::Bucket object or undef if nothing matches.
Takes some bucket metadata as the only argument (could be as simple as {id => $bucket_name}), creates a new bucket and returns the matching Net::Google::Storage::Bucket object.
{id => $bucket_name}
Takes a bucket name as the only argument, deletes the bucket.
Takes a bucket name as the only argument, returns an arrayref of Net::Google::Storage::Object objects.
Takes a hash (not hashref) of arguments with keys: bucket and object and returns the matching Net::Google::Storage::Object object (or undef if no match was found).
Takes a hash (not hashref) of arguments with keys: bucket, object, and filename and downloads the matching object as the desired filename.
Returns undef if the object doesn't exist, true for success.
Takes a hash of arguments with keys: bucket, filename and object where object contains the necessary metadata to upload the file, which is, at minimum, the name field.
Takes a hash of arguments with keys: bucket and object and deletes the matching object.
Glenn Fowler <cebjyre@cpan.org>
This software is copyright (c) 2012 by Glenn Fowler.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Net::Google::Storage, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Google::Storage
CPAN shell
perl -MCPAN -e shell install Net::Google::Storage
For more information on module installation, please visit the detailed CPAN module installation guide.