Skip to content

Commit

Permalink
Added POD; bumped version
Browse files Browse the repository at this point in the history
  • Loading branch information
mfontani committed Nov 22, 2009
1 parent 9dbf058 commit 9ff623a
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dist.ini
@@ -1,5 +1,5 @@
name = Net-RackSpace-CloudServers
version = 0.09_00
version = 0.09_10
author = Marco Fontani
license = Perl_5
copyright_holder = Marco Fontani
Expand All @@ -11,6 +11,7 @@ Moose = 0.87
MooseX::StrictConstructor = 0
LWP::ConnCache::MaxKeepAliveRequests = 0
LWP::UserAgent::Determined = 0
HTTP::Request = 0
JSON = 0
YAML = 0

Expand Down
110 changes: 109 additions & 1 deletion lib/Net/RackSpace/CloudServers/Limits.pm
Expand Up @@ -61,4 +61,112 @@ sub refresh {
return $self;
}

1;
=head1 NAME
Net::RackSpace::CloudServers::Limits- a RackSpace CloudServers Limits instance
=head1 SYNOPSIS
use Net::RackSpace::CloudServers;
use Net::RackSpace::CloudServers::Limits;
my $cs = Net::RackSpace::CloudServers->new(
user => $ENV{CLOUDSERVERS_USER},
key => $ENV{CLOUDSERVERS_KEY},
);
my $limits = Net::RackSpace::CloudServers::Limits->new(
cloudservers => $cs,
);
$limits->refresh();
print "Can still allocate ", $limits->totalramsize, " MB RAM\n";
print "Can still use ", $limits->maxipgroups, " IP Groups\n";
print "Can have ", $limits->maxipgroupmembers, " more IP groups members\n";
# next bit isn't OO-ed yet.
foreach my $k ( @{ $limits->rate } ) {
print $k->{verb}, ' to URI ', $k->{URI}, ' remaining: ',
$k->{remaining}, ' per ', $k->{unit},
' (will be reset at: ', scalar localtime $k->{resetTime}, ')',
"\n";
}
=head1 METHODS
=head2 new / BUILD
The constructor creates a Limits half-object. See L<refresh> to refresh the limits once gathered.
This normally gets created for you by L<Net::RackSpace::Cloudserver>'s L<limits> method.
Needs a Net::RackSpace::CloudServers object as B<cloudserver> parameter.
=head2 refresh
This method refreshes the information contained in the object
=head1 ATTRIBUTES
=head2 totalramsize
Indicates the maximum amount of RAM (in megabytes) linked to your account.
=head2 maxipgroups
Indicates the maximum number of shared IP groups your account can create
=head2 maxipgroupmembers
Indicates the maximum amount of servers that can be associated with any one shared IP group
=head2 rate
TODO: not yet OO-ified.
Is an arrayref of the rate-limits that currently apply to your account via the API.
You'll receive 413 errors in case you exceed the limits described.
=head1 AUTHOR
Marco Fontani, C<< <mfontani at cpan.org> >>
=head1 BUGS
Please report any bugs or feature requests to C<bug-net-rackspace-cloudservers at rt.cpan.org>, or through
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-RackSpace-CloudServers>.
I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Net::RackSpace::CloudServers::Limits
You can also look for information at:
=over 4
=item * RT: CPAN's request tracker
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-RackSpace-CloudServers>
=item * AnnoCPAN: Annotated CPAN documentation
L<http://annocpan.org/dist/Net-RackSpace-CloudServers>
=item * CPAN Ratings
L<http://cpanratings.perl.org/d/Net-RackSpace-CloudServers>
=item * Search CPAN
L<http://search.cpan.org/dist/Net-RackSpace-CloudServers/>
=back
=head1 COPYRIGHT & LICENSE
Copyright 2009 Marco Fontani, all rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=cut

1; # End of Net::RackSpace::CloudServers::Limits
6 changes: 6 additions & 0 deletions lib/Net/RackSpace/CloudServers/Server.pm
Expand Up @@ -172,6 +172,12 @@ Needs a Net::RackSpace::CloudServers object as B<cloudserver> parameter.
This creates a real server based on a Server template object (TODO: will accept all the other build parameters).
=head2 delete_server
This will ask RackSpace to delete the cloud server instance specified in this object's ID from the system.
This operation is irreversible. Please notice that all images created from this server (if any) will also
be removed. This method doesn't return anything on success, and C<confess()>es on failure.
=head2 change_name
Changes the server's name to the new value given. Dies on error, or returns the response
Expand Down

0 comments on commit 9ff623a

Please sign in to comment.