Net::RackSpace::CloudServers - Interface to RackSpace CloudServers via API
version 0.15
use Net::RackSpace::CloudServers; my $cs = Net::RackSpace::CloudServers->new( user => 'myusername', key => 'mysecretkey', # location => 'UK', ); # list my servers; my @servers = $cs->get_server; foreach my $server ( @servers ) { print 'Have server ', $server->name, ' id ', $server->id, "\n"; }
The constructor logs you into CloudServers:
my $cs = Net::RackSpace::CloudServers->new( user => 'myusername', key => 'mysecretkey', # location => 'US', );
The location parameter can be either US or UK, as the APIs have the same interface and just different endpoints. This is all handled transparently. The default is to use the US API endpoint.
location
US
UK
Lists all the servers linked to the account. If no ID is passed as parameter, returns an array of Net::RackSpace::CloudServers::Server object containing only id and name set. If an ID is passed as parameter, it will return a Net::RackSpace::CloudServers::Server object containing id, name, imageid, etc. See Net::RackSpace::CloudServers::Server for details.
my @servers = $cs->get_server; # all servers, id/name my $test_server = $cs->get_server(1); # ID 1, detailed
Lists more details about all the servers and returns them as a Net::RackSpace::CloudServers::Server object:
my @servers = $cs->get_server_detail; # all servers, id/name my $test_server = $cs->get_server_detail(1); # ID 1, detailed
Lists all the limits currently set for the account, and returns them as a Net::RackSpace::CloudServers::Limits object:
my $limits = $cs->limits;
Lists all the flavors able to be used. If no ID is passed as parameter, returns an array of Net::RackSpace::CloudServers::Flavor object containing only id and name set. If an ID is passed as parameter, it will return a Net::RackSpace::CloudServers::Flavor object containing id, name, ram and disk.
my @flavors = $cs->get_flavor; foreach (@flavors) { print $_->id, ' ', $_->name, "\n" } my $f1 = $cs->get_flavor(1); print join(' ', $f1->id, $f1->name, $f1->ram, $f1->disk), "\n";
Lists details of all the flavors able to be used. If no ID is passed as parameter, returns an array of Net::RackSpace::CloudServers::Flavor. All details are returned back: id, name, ram and disk. If an ID is passed as parameter, it will return a Net::RackSpace::CloudServers::Flavor object with all details filled in.
Lists all the server/backup images able to be used. If no ID is passed as parameter, returns an array of Net::RackSpace::CloudServers::Image object containing only id and name set. If an ID is passed as parameter, it will return a Net::RackSpace::CloudServers::Image object with all the available attributes set.
my @images = $cs->get_image; foreach (@images) { print $_->id, ' ', $_->name, "\n" } my $f1 = $cs->get_image(1); print join(' ', $f1->id, $f1->name, $f1->updated, $f1->status), "\n";
Lists details of all the server/backup images able to be used. If no ID is passed as parameter, returns an array of Net::RackSpace::CloudServers::Image. All details are returned back: id, name, serverid, updated, created, status and progress. If an ID is passed as parameter, it will return a Net::RackSpace::CloudServers::Image object with all details filled in.
Deletes a previously created backup image. Needs the image ID passed as parameter, returns undef in case of success or confess()es in case of error.
Marco Fontani, <mfontani at cpan.org>
<mfontani at cpan.org>
Please report any bugs or feature requests to bug-net-rackspace-cloudservers at rt.cpan.org, or through the web interface at 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.
bug-net-rackspace-cloudservers at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Net::RackSpace::CloudServers
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-RackSpace-CloudServers
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Net-RackSpace-CloudServers
CPAN Ratings
http://cpanratings.perl.org/d/Net-RackSpace-CloudServers
Search CPAN
http://search.cpan.org/dist/Net-RackSpace-CloudServers/
Léon Brocard for Net::Mosso::CloudFiles
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.
To install Net::RackSpace::CloudServers, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::RackSpace::CloudServers
CPAN shell
perl -MCPAN -e shell install Net::RackSpace::CloudServers
For more information on module installation, please visit the detailed CPAN module installation guide.