Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (19 sloc) 0.774 kb
#!perl
use strict;
use warnings;
use Net::RackSpace::CloudServers;
my $user = $ENV{'CLOUDSERVERS_USER'} or die "Need CLOUDSERVERS_USER environment variable set";
my $key = $ENV{'CLOUDSERVERS_KEY'} or die "Need CLOUDSERVERS_KEY environment variable set";
$Net::RackSpace::CloudServers::DEBUG = 1;
my $CS = Net::RackSpace::CloudServers->new(
user => $user,
key => $key,
);
my @flavors = $CS->get_flavor_detail;
my @images = $CS->get_image_detail;
my @servers = $CS->get_server_detail;
my $srvapi = ( grep { $_->name eq 'apitest' } @servers )[0];
die "can't find server named 'apitest'. Create one." if ( !defined $srvapi );
print "changing root password..\n";
$srvapi->change_root_password('toor');
print "Changed. Login to ", $srvapi->public_address->[0], "\n";
Jump to Line
Something went wrong with that request. Please try again.