The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WebService::ProfitBricks - ProfitBricks Base Class

DESCRIPTION

Profitbricks API

This is the first version of the API implementation. This is currently work-in-progress.

With this library it is possible to provision your ProftBricks datacenter with perl. This library will connect to the SOAP webservice of ProfitBricks.

HELP

If you need help or want to report bugs please feel free to use our issue tracker.

  • http://github.com/Krimdomu/p5-webservice-profitbricks/issues

SYNOPSIS

 use WebService::ProfitBricks qw/DataCenter Image IpBlock/;
 WebService::ProfitBricks->auth($user, $password);
    
 Image->list;
 my $dc = DataCenter->new(dataCenterName => "DC1", region => "EUROPE");
 $dc->save;
 $dc->wait_for_provisioning;
   
 my $stor1 = $dc->storage->new(size => 50, storageName => "store01", mountImageId => $use_image, profitBricksImagePassword => $root_pw);
 $stor1->save;
 $dc->wait_for_provisioning;
    
 my $srv1 = $dc->server->new(cores => 1, ram => 512, serverName => "srv01", lanId => 1, bootFromStorageId => $stor1->storageId, internetAccess => 'true');
 $srv1->save;
 $dc->wait_for_provisioning;

METHODS

This class inherits from WebService::ProfitBricks::Base. This is the base class for all the other ProfitBricks classes.

find_by_id($id)

Tries to find a thing with the given $id.

 my $server = $dc->server->find_by_id("a-b-c-d");
save()

This method created the current object at ProfitBricks. Don't call this method if you only want to update an object. Use update instead.

 my $dc = DataCenter->new(dataCenterName => "DC1", region => "EUROPE");
 $dc->save;
update()

Updates an exisisting object at ProfitBricks. If you want to create a new object use the save method instead.

 my $dc = DataCenter->find_by_name("DC1");
 $dc->dataCenterName("new_name");
 $dc->update;
delete();

This function delete the current object.

auth($user, $password)

Sets the authentication.