WebService::ProfitBricks - ProfitBricks Base Class
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.
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
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;
This class inherits from WebService::ProfitBricks::Base. This is the base class for all the other ProfitBricks classes.
Tries to find a thing with the given $id.
my $server = $dc->server->find_by_id("a-b-c-d");
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;
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;
This function delete the current object.
Sets the authentication.
To install WebService::ProfitBricks, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::ProfitBricks
CPAN shell
perl -MCPAN -e shell install WebService::ProfitBricks
For more information on module installation, please visit the detailed CPAN module installation guide.